Commit 0d56b9c2 authored by bonnell's avatar bonnell

Add XML results to a few more queries.

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@22895 18c085ea-50e0-402c-830e-de6fd14e8384
parent ed42e8c2
......@@ -165,6 +165,9 @@ avtCentroidQuery::PreExecute(void)
// Cyrus Harrison, Tue Sep 18 13:45:35 PDT 2007
// Added support for user settable floating point format string
//
// Kathleen Biagas, Mon Feb 24 15:53:29 PST 2014
// Add Xml results.
//
// ****************************************************************************
void
......@@ -196,6 +199,9 @@ avtCentroidQuery::PostExecute(void)
for (int i = 0 ; i < 3 ; i++)
C_vec[i] = C_tmp[i];
SetResultValues(C_vec);
MapNode result_node;
result_node["centroid"] = C_vec;
SetXmlResult(result_node.ToXML());
}
// ****************************************************************************
......
......@@ -129,11 +129,18 @@ avtExpectedValueQuery::CurveQuery(int n1, const float *x1, const float *y1)
// Cyrus Harrison, Tue Sep 18 13:45:35 PDT 2007
// Added support for user settable floating point format string
//
// Kathleen Biagas, Mon Feb 24 16:24:17 PST 2014
// Add Xml results.
//
// ****************************************************************************
std::string
avtExpectedValueQuery::CreateMessage(double ev)
{
MapNode result_node;
result_node["expected_value"] = ev;
SetXmlResult(result_node.ToXML());
char msg[1024];
std::string format = "The expected value is " + queryAtts.GetFloatFormat()
+ ".";
......
......@@ -709,6 +709,9 @@ avtHohlraumFluxQuery::PreExecute()
// communications were MPI_Allreduce so MPI tried to make them succeed even
// though they were incompatible.
//
// Kathleen Biagas, Mon Feb 24 16:05:24 PST 2014
// Add Xml results.
//
// ****************************************************************************
void
......@@ -739,18 +742,18 @@ avtHohlraumFluxQuery::PostExecute(void)
double resultSum = 0.0;
double resultSum2 = 0.0;
double temperature = 0.0;
for (ii = 0 ; ii < numBins ; ii++)
{
result[ii] = accumBins[ii] / (double)numLines;
resultSum += result[ii];
if (binWidths.size() != 0)
resultSum2 += result[ii] * binWidths[ii];
}
if (binWidths.size() != 0)
temperature = pow( M_PI * resultSum2 / 1028000.0, 0.25 );
// Write all bins to an ultra file
char name[256];
if (PAR_Rank() == 0)
......@@ -765,23 +768,24 @@ avtHohlraumFluxQuery::PostExecute(void)
{
ifile.close();
ofstream ofile(name);
// I would like to stick all this in the file, but the whole thing is
// interpreted as the variable name. -DJB
//ofile << "# Flux values in Eu / (ms*cm2*keV). Sum is " << resultSum << ".";
// I would like to stick all this in the file, but the whole
// thing is interpreted as the variable name. -DJB
//ofile << "# Flux values in Eu / (ms*cm2*keV). Sum is "
// << resultSum << ".";
//if (binWidths.size() != 0)
//{
// ofile << "Temperature is " << temperature << ".";
//}
//ofile << endl;
ofile << "# Hohlraum Flux" << endl;
for (ii = 0 ; ii < numBins ; ii++)
{
ofile << ii << " " << setprecision(14) << result[ii] << endl;
}
ofile.close();
break;
}
}
else
{
ifile.close();
......@@ -790,11 +794,12 @@ avtHohlraumFluxQuery::PostExecute(void)
}
}
std::string msg = "";
std::string format ="";
std::string format = "";
std::string floatFormat = queryAtts.GetFloatFormat();
char buf[512];
MapNode result_node;
SNPRINTF(buf,512,"The hohlraum flux query over %d energy groups "
"was written to %s.\n", numBins, name);
......@@ -802,23 +807,28 @@ avtHohlraumFluxQuery::PostExecute(void)
format = "Sum is " + floatFormat + ".\n";
SNPRINTF(buf,512,format.c_str(), resultSum);
msg+=buf;
result_node["Sum"] = resultSum;
if (binWidths.size() != 0)
{
format = "Temperature is " + floatFormat + ".\n";
SNPRINTF(buf,512,format.c_str(),temperature);
msg+=buf;
result_node["Temperature"] = temperature;
}
result_node["Energy_group_values"] = result;
msg += "Energy group values are: ";
for (ii = 0 ; ii < numBins ; ii++)
{
format = " " + floatFormat;
SNPRINTF(buf,512, format.c_str(), result[ii]);
msg+=buf;
if (ii < numBins-1)
msg+=",";
}
......@@ -828,6 +838,7 @@ avtHohlraumFluxQuery::PostExecute(void)
SetResultValue(temperature);
else
SetResultValue(resultSum);
SetXmlResult(result_node.ToXML());
}
......
......@@ -191,11 +191,18 @@ avtKurtosisQuery::CurveQuery(int n1, const float *x1, const float *y1)
// Cyrus Harrison, Tue Sep 18 13:45:35 PDT 2007
// Added support for user settable floating point format string
//
// Kathleen Biagas, Mon Feb 24 16:08:14 PST 2014
// Add Xml results.
//
// ****************************************************************************
std::string
avtKurtosisQuery::CreateMessage(double kurtosis)
{
MapNode result_node;
result_node["kurtosis"] = kurtosis;
SetXmlResult(result_node.ToXML());
char msg[1024];
std::string format = "The kurtosis of the distribution is "
+ queryAtts.GetFloatFormat() + ".";
......
......@@ -149,11 +149,18 @@ avtL2NormQuery::CurveQuery(int n1, const float *x1, const float *y1)
// Cyrus Harrison, Tue Sep 18 13:45:35 PDT 2007
// Added support for user settable floating point format string
//
// Kathleen Biagas, Mon Feb 24 16:13:22 PST 2014
// Add Xml results.
//
// ****************************************************************************
std::string
avtL2NormQuery::CreateMessage(double l2norm)
{
MapNode result_node;
result_node["L2Norm"] = l2norm;
SetXmlResult(result_node.ToXML());
char msg[1024];
std::string format = "The L2Norm is " + queryAtts.GetFloatFormat() + ".";
SNPRINTF(msg,1024,format.c_str(), l2norm);
......
......@@ -187,6 +187,9 @@ avtMomentOfInertiaQuery::PreExecute(void)
// Cyrus Harrison, Tue Sep 18 13:45:35 PDT 2007
// Added support for user settable floating point format string
//
// Kathleen Biagas, Mon Feb 24 15:53:41 PST 2014
// Add Xml results.
//
// ****************************************************************************
void
......@@ -222,6 +225,9 @@ avtMomentOfInertiaQuery::PostExecute(void)
for (int i = 0 ; i < 9 ; i++)
I_vec[i] = I_tmp[i];
SetResultValues(I_vec);
MapNode result_node;
result_node["moment_of_inertia"] = I_vec;
SetXmlResult(result_node.ToXML());
}
// ****************************************************************************
......
......@@ -194,11 +194,18 @@ avtSkewnessQuery::CurveQuery(int n1, const float *x1, const float *y1)
// Cyrus Harrison, Tue Sep 18 13:45:35 PDT 2007
// Added support for user settable floating point format string
//
// Kathleen Biagas, Mon Feb 24 16:08:51 PST 2014
// Add Xml results.
//
// ****************************************************************************
std::string
avtSkewnessQuery::CreateMessage(double skewness)
{
MapNode result_node;
result_node["skewness"] = skewness;
SetXmlResult(result_node.ToXML());
char msg[1024];
std::string format = "The skewness of the distribution is "
+ queryAtts.GetFloatFormat() + ".";
......
......@@ -318,6 +318,9 @@ avtSummationQuery::PreExecute(void)
// Kathleen Biagas, Thu Feb 13 15:04:58 PST 2014
// Add Xml results.
//
// Kathleen Biagas, Mon Feb 24 15:37:33 PST 2014
// Use sumType instead of variableName for Xml results.
//
// ****************************************************************************
void
......@@ -371,9 +374,9 @@ avtSummationQuery::PostExecute(void)
MapNode result_node;
if (sums.size() == 1)
result_node[variableName] = sums[0];
result_node[sumType] = sums[0];
else
result_node[variableName] = sums;
result_node[sumType] = sums;
char buf[1024];
string str;
if (CalculateAverage())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment