[MOAB-dev] r1899 - MOAB/trunk/tools/mcnpmit
bmsmith at mcs.anl.gov
bmsmith at mcs.anl.gov
Mon Jun 16 11:27:03 CDT 2008
Author: bmsmith
Date: 2008-06-16 11:27:02 -0500 (Mon, 16 Jun 2008)
New Revision: 1899
Modified:
MOAB/trunk/tools/mcnpmit/main.cpp
MOAB/trunk/tools/mcnpmit/mcnpmit.cpp
Log:
feature: added relative error data
bug: moved cfd_iter++ out of the hex-tagging loop to cover the situation in which the mcnp mesh does not cover the entire cfd mesh. In this case some cfd coordinates will not find an mcnp hex, and this is ok.
Modified: MOAB/trunk/tools/mcnpmit/main.cpp
===================================================================
--- MOAB/trunk/tools/mcnpmit/main.cpp 2008-06-14 01:47:00 UTC (rev 1898)
+++ MOAB/trunk/tools/mcnpmit/main.cpp 2008-06-16 16:27:02 UTC (rev 1899)
@@ -23,7 +23,7 @@
MCNPError next_int(std::string, int&, int&);
MCNPError result;
-MBTag coord_tag, rotation_tag, cfd_heating_tag;
+MBTag coord_tag, rotation_tag, cfd_heating_tag, cfd_error_tag;
std::string h5m_filename;
std::string CAD_filename;
@@ -160,6 +160,7 @@
cfd_iter = cfd_verts.begin();
MBresult = MBI->tag_create("heating_tag", sizeof(double), MB_TAG_DENSE, MB_TYPE_DOUBLE, cfd_heating_tag, 0);
+ MBresult = MBI->tag_create("error_tag", sizeof(double), MB_TAG_DENSE, MB_TYPE_DOUBLE, cfd_error_tag, 0);
std::cout << std::endl << "Read in mesh with query points." << std::endl << std::endl;
@@ -169,6 +170,8 @@
double testpt[3];
double transformed_pt[3];
double taldata;
+ double errdata;
+
MBCartVect testvc;
bool found = false;
@@ -249,16 +252,19 @@
}
if (MBElemUtil::point_in_trilinear_hex(hexverts, testvc, 1.e-6)) {
- MBresult = MBI -> tag_get_data( MCNP->tally_tag, &(*rit), 1, &taldata);
- outfile << n << ","
+ MBresult = MBI -> tag_get_data( MCNP->tally_tag, &(*rit), 1, &taldata);
+ MBresult = MBI -> tag_get_data( MCNP->relerr_tag, &(*rit), 1, &errdata);
+
+ outfile << n << ","
<< testpt[0] << ","
<< testpt[1] << ","
<< testpt[2] << ","
- << taldata << std::endl;
+ << taldata << ","
+ << errdata << std::endl;
if (!read_qnv) {
MBresult = MBI->tag_set_data(cfd_heating_tag, &(*cfd_iter), 1, &taldata);
- cfd_iter++;
+ MBresult = MBI->tag_set_data(cfd_error_tag, &(*cfd_iter), 1, &errdata);
}
found = true;
@@ -268,6 +274,8 @@
}
}
+ if (!read_qnv) cfd_iter++;
+
if (!found) {
std::cout << n << " " << testvc << std::endl;
}
Modified: MOAB/trunk/tools/mcnpmit/mcnpmit.cpp
===================================================================
--- MOAB/trunk/tools/mcnpmit/mcnpmit.cpp 2008-06-14 01:47:00 UTC (rev 1898)
+++ MOAB/trunk/tools/mcnpmit/mcnpmit.cpp 2008-06-16 16:27:02 UTC (rev 1899)
@@ -341,8 +341,8 @@
// Need to read in relative error entry and tag ...
result = next_number(s, d, fpos);
if (result == MCNP_FAILURE) return MCNP_FAILURE;
- // MBresult = MBI -> tag_set_data(relerr_tag, &handle, 1, &d);
- // if (MBresult != MB_SUCCESS) return MCNP_FAILURE;
+ MBresult = MBI -> tag_set_data(relerr_tag, &handle, 1, &d);
+ if (MBresult != MB_SUCCESS) return MCNP_FAILURE;
return MCNP_SUCCESS;
}
More information about the moab-dev
mailing list