Some cleanup (reordering of methods to match in inheritance) and including libmesh collision tallies in testing.

This commit is contained in:
Patrick Shriwise 2020-04-09 12:37:33 -05:00
parent c4087307f0
commit 700d62c9ef
25 changed files with 824 additions and 132 deletions

View file

@ -41,6 +41,8 @@ namespace openmc {
// Global variables
//==============================================================================
extern "C" const bool libmesh_enabled;
class Mesh;
namespace model {
@ -277,17 +279,12 @@ public:
class UnstructuredMesh : public Mesh {
public:
// constructors
// Constructors
UnstructuredMesh() {};
UnstructuredMesh(pugi::xml_node node);
UnstructuredMesh(const std::string& filename);
std::string bin_label(int bin) const override;
//! Write mesh data to an HDF5 group.
//
//! \param[in] group HDF5 group
void to_hdf5(hid_t group) const;
// Methods
//! Add a variable to the mesh instance
virtual void add_score(const std::string& var_name) = 0;
@ -297,14 +294,31 @@ public:
std::vector<double> values,
std::vector<double> std_dev) = 0;
//! Write the unstructured mesh to file
//
//
//! \param[in] filename Name of the file to write
virtual void write(std::string filename) const = 0;
//! Retrieve a centroid for the mesh cell
//
//! \param[in] bin Bin to return the centroid for
//! \return The centroid of the bin
virtual Position centroid(int bin) const = 0;
//! Get the volume of a mesh bin
//
//! \param[in] bin Bin to return the volume for
//! \return The volume of the bin
virtual double volume(int bin) const = 0;
//! Get the library used for this unstructured mesh
virtual std::string library() const = 0;
std::string bin_label(int bin) const override;
void to_hdf5(hid_t group) const override;
// Data members
std::string filename_; //!< Path to unstructured mesh file
};
@ -331,27 +345,18 @@ public:
//
//! \param[in] p Particle to check
//! \param[out] bins Surface bins that were crossed
void surface_bins_crossed(const Particle& p, std::vector<int>& bins) const;
void surface_bins_crossed(const Particle* p, std::vector<int>& bins) const;
//! Get bin at a given position.
//
//! \param[in] r Position to get bin for
//! \return Mesh bin
int get_bin(Position r) const;
std::string library() const override;
int n_bins() const override;
int n_surface_bins() const override;
//! Retrieve a centroid for the mesh cell
//
// \param[in] bin Bin to return the volume for
// \return The centroid of the element
Position centroid(int bin) const override;
std::pair<std::vector<double>, std::vector<double>>
plot(Position plot_ll, Position plot_ur) const override;
double volume(int bin) const override;
std::string library() const override;
//! Add a score to the mesh instance
void add_score(const std::string& score);
@ -372,7 +377,9 @@ public:
//! Write the mesh with any current tally data
void write(std::string base_filename) const;
bool intersects(Position& r0, Position r1, int* ijk);
Position centroid(int bin) const override;
double volume(int bin) const override;
private:
@ -468,7 +475,7 @@ private:
std::pair<moab::Tag, moab::Tag>
get_score_tags(std::string score) const;
// data members
// Data members
moab::Range ehs_; //!< Range of tetrahedra EntityHandle's in the mesh
moab::EntityHandle tetset_; //!< EntitySet containing all tetrahedra
moab::EntityHandle kdtree_root_; //!< Root of the MOAB KDTree
@ -490,40 +497,35 @@ public:
LibMesh(const std::string& filename);
// Methods
// standard mesh functions
void bins_crossed(const Particle* p,
std::vector<int>& bins,
std::vector<double>& lengths) const override;
int get_bin(Position r) const override;
void surface_bins_crossed(const Particle* p, std::vector<int>& bins) const override;
std::string library() const override;
int get_bin(Position r) const override;
int n_bins() const override;
int n_surface_bins() const override;
void surface_bins_crossed(const Particle* p,
std::vector<int>& bins) const override;
std::pair<std::vector<double>, std::vector<double>> plot(Position plot_ll,
Position plot_ur) const override;
void write(std::string filename) const override;
//! Add a variable to the libmesh mesh instance
void add_score(const std::string& var_name) override;
//! Set the value of a bin for a variable on the libmesh mesh instance
void set_score_data(const std::string& var_name,
std::vector<double> values,
std::vector<double> std_dev) override;
void write(std::string filename) const override;
Position centroid(int bin) const override;
double volume(int bin) const override;
std::string library() const override;
private:
//! Setup method for the mesh. Builds data structures,
@ -536,43 +538,14 @@ private:
//! Translate an element pointer to a bin value
int get_bin_from_element(const libMesh::Elem* elem) const;
//! Check whether if a point moving in a given direction
//! is inside the element
//
//! \param[in] r In: point to be checked
//! \param[in] u In: direction (this is arbitrary, any normalized direction will do)
//! \param[in] e In: libmesh element in question
//! \return whether or not the point is in the tet
bool inside_tet(const libMesh::Point& r,
const libMesh::Point& u,
const libMesh::Elem* e) const;
//! Check if a point moving in a given direction
//! is inside the element
//
//! \param[in] r In: point to be checked
//! \param[in] u In: direction (this is arbitrary, any normalized direction will do)
//! \param[in] e In: libmesh element in question
//! \return whether or not the point is in the tet
bool inside_tet(const libMesh::Point& r,
const libMesh::Point& u,
std::unique_ptr<libMesh::Elem> e) const;
double first(const libMesh::Node& a,
const libMesh::Node& b) const;
// Data members
private:
std::unique_ptr<libMesh::Mesh> m_; //!< pointer to the libmesh mesh instance
std::vector<std::unique_ptr<libMesh::PointLocatorBase>> point_locators_; //!< pointers to locators for each thread
std::unique_ptr<libMesh::EquationSystems> equation_systems_; //!< pointer to the equation systems of the mesh (for result output)
std::map<std::string, unsigned int> variable_map_; //!< mapping of variable names (scores) to their numbers on the mesh
libMesh::BoundingBox bbox_; //!< bounding box of the mesh
libMesh::Sphere bsphere_; //<! bounding sphere of the mesh
std::string eq_system_name_; //!< name of the equation system holding OpenMC results
libMesh::Elem* first_element_; //!< pointer to the first element in the mesh (maybe should be a key?)
std::set<libMesh::Elem*> boundary_elements_; //<! all boundary elements in the mesh
};
#endif

View file

@ -45,6 +45,9 @@ def _dagmc_enabled():
def _coord_levels():
return c_int.in_dll(_dll, "n_coord_levels").value
def _libmesh_enabled():
return c_bool.in_dll(_dll, "libmesh_enabled").value
from .error import *
from .core import *
from .nuclide import *

View file

@ -632,7 +632,7 @@ class UnstructuredMesh(MeshBase):
self.filename = filename
self._volumes = None
self._centroids = None
self._mesh_lib = 'moab'
self._library = 'moab'
@property
def filename(self):
@ -644,13 +644,13 @@ class UnstructuredMesh(MeshBase):
self._filename = filename
@property
def mesh_lib(self):
def library(self):
return self._mesh_lib
@mesh_lib.setter
def mesh_lib(self, mesh_lib):
@library.setter
def library(self, mesh_lib):
cv.check_value('mesh_lib', mesh_lib, ('moab', 'libmesh'))
self._mesh_lib = mesh_lib
self._library = mesh_lib
@property
def size(self):
@ -811,7 +811,7 @@ class UnstructuredMesh(MeshBase):
element.set("id", str(self._id))
element.set("type", "unstructured")
subelement = ET.SubElement(element, "filename")
element.set("library", self._mesh_lib)
element.set("library", self._library)
subelement.text = self.filename
return element

View file

@ -39,6 +39,13 @@ namespace openmc {
// Global variables
//==============================================================================
#ifdef LIBMESH
const bool libmesh_enabled = true;
#else
const bool libmesh_enabled = false;
#endif
namespace model {
std::unordered_map<int32_t, int32_t> mesh_map;
@ -2205,25 +2212,10 @@ void LibMesh::initialize() {
point_locators_[i]->enable_out_of_mesh_mode();
}
// will need mesh neighbors to walk the mesh
m_->find_neighbors();
first_element_ = *m_->elements_begin();
// bounding box for the mesh
bbox_ = libMesh::MeshTools::create_bounding_box(*m_);
bsphere_ = libMesh::MeshTools::bounding_sphere(*m_);
// determine boundary elements and create bounding box
for (int i = 0; i < m_->n_elem(); i++) {
auto e = m_->elem_ptr(i);
for (int k = 0; k < e->n_neighbors(); k++) {
if (!e->neighbor_ptr(k)) {
boundary_elements_.insert(e);
}
}
}
}
int LibMesh::n_bins() const {
@ -2243,15 +2235,6 @@ LibMesh::surface_bins_crossed(const Particle* p,
throw std::runtime_error{"Unstructured mesh surface tallies are not implemented."};
}
std::pair<std::vector<double>, std::vector<double>>
LibMesh::plot(Position plot_ll,
Position plot_ur) const { return {}; }
const libMesh::Elem*
LibMesh::get_element_from_bin(int bin) const {
return m_->elem_ptr(bin);
}
void
LibMesh::add_score(const std::string& var_name) {
// check if this is a new varaible
@ -2309,7 +2292,7 @@ LibMesh::set_score_data(const std::string& var_name,
void LibMesh::write(std::string filename) const {
libMesh::ExodusII_IO exo(*m_);
std::set<std::string> systems_out = {eq_system_name_};
exo.write_discontinuous_exodusII(filename, *equation_systems_, &systems_out);
exo.write_discontinuous_exodusII(filename + ".e", *equation_systems_, &systems_out);
}
void
@ -2328,11 +2311,10 @@ LibMesh::get_bin(Position r) const
libMesh::Point p(r.x, r.y, r.z);
// quick rejection check
// if (bsphere_.above_surface(p) || !bbox_.contains_point(p)) { return -1; }
if (!bbox_.contains_point(p)) { return -1; }
int thread = omp_get_thread_num();
auto e = (*point_locators_[thread])(p);
int thread = omp_get_thread_num();
auto e = (*point_locators_[thread])(p, false);
if (!e) {
return -1;
} else {
@ -2343,29 +2325,19 @@ LibMesh::get_bin(Position r) const
int
LibMesh::get_bin_from_element(const libMesh::Elem* elem) const {
int bin = elem->id() - first_element_->id();
if (bin >= n_bins()) {
std::stringstream s;
s << "Invalid bin: " << bin;
fatal_error(s);
if (bin >= n_bins() || bin < 0) {
fatal_error(fmt::format("Invalid bin: {}", bin));
}
return bin;
}
bool
LibMesh::inside_tet(const libMesh::Point& r,
const libMesh::Point& u,
std::unique_ptr<libMesh::Elem> e) const
{
return inside_tet(r, u, e.get());
}
std::pair<std::vector<double>, std::vector<double>>
LibMesh::plot(Position plot_ll,
Position plot_ur) const { return {}; }
bool
LibMesh::inside_tet(const libMesh::Point& r,
const libMesh::Point& u,
const libMesh::Elem* e) const
{
return e->contains_point(r, FP_COINCIDENT);
const libMesh::Elem*
LibMesh::get_element_from_bin(int bin) const {
return m_->elem_ptr(bin);
}
double LibMesh::volume(int bin) const { return m_->elem_ref(bin).volume(); }

View file

@ -70,8 +70,8 @@
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="2" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.h5m</filename>
<mesh id="2" library="libmesh" type="unstructured">
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="1" type="mesh">
<bins>1</bins>

View file

@ -70,8 +70,8 @@
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="4" library="moab" type="unstructured">
<filename>test_mesh_tets.h5m</filename>
<mesh id="4" library="libmesh" type="unstructured">
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="3" type="mesh">
<bins>3</bins>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="19" material="19" name="fuel" region="109 -110 111 -112 113 -114" universe="7" />
<cell id="20" material="20" name="clad" region="(-109 | 110 | -111 | 112 | -113 | 114) (115 -116 117 -118 119 -120)" universe="7" />
<cell id="21" material="21" name="water" region="(-115 | 116 | -117 | 118 | -119 | 120) (121 -122 123 -124 125 -126)" universe="7" />
<surface coeffs="-5.0" id="109" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="110" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="111" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="112" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="113" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="114" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="115" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="116" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="117" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="118" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="119" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="120" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-10" id="121" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="10" id="122" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-10" id="123" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="10" id="124" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-10" id="125" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="10" id="126" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="19" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="20" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="21" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="13">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="14" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="13" type="mesh">
<bins>13</bins>
</filter>
<filter id="14" type="mesh">
<bins>14</bins>
</filter>
<tally id="13" name="regular mesh tally">
<filters>13</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
<tally id="14" name="unstructured mesh tally">
<filters>14</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="22" material="22" name="fuel" region="127 -128 129 -130 131 -132" universe="8" />
<cell id="23" material="23" name="clad" region="(-127 | 128 | -129 | 130 | -131 | 132) (133 -134 135 -136 137 -138)" universe="8" />
<cell id="24" material="24" name="water" region="(-133 | 134 | -135 | 136 | -137 | 138) (139 -140 141 -142 143 -144)" universe="8" />
<surface coeffs="-5.0" id="127" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="128" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="129" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="130" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="131" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="132" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="133" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="134" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="135" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="136" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="137" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="138" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-10" id="139" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="10" id="140" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-10" id="141" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="10" id="142" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-10" id="143" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="10" id="144" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="22" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="23" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="24" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="15">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="16" library="moab" type="unstructured">
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="15" type="mesh">
<bins>15</bins>
</filter>
<filter id="16" type="mesh">
<bins>16</bins>
</filter>
<tally id="15" name="regular mesh tally">
<filters>15</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
<tally id="16" name="unstructured mesh tally">
<filters>16</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="25" material="25" name="fuel" region="145 -146 147 -148 149 -150" universe="9" />
<cell id="26" material="26" name="clad" region="(-145 | 146 | -147 | 148 | -149 | 150) (151 -152 153 -154 155 -156)" universe="9" />
<cell id="27" material="27" name="water" region="(-151 | 152 | -153 | 154 | -155 | 156) (157 -158 159 -160 161 -162)" universe="9" />
<surface coeffs="-5.0" id="145" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="146" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="147" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="148" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="149" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="150" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="151" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="152" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="153" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="154" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="155" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="156" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-15" id="157" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="15" id="158" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-15" id="159" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="15" id="160" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-15" id="161" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="15" id="162" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="25" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="26" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="27" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="17">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="18" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="17" type="mesh">
<bins>17</bins>
</filter>
<filter id="18" type="mesh">
<bins>18</bins>
</filter>
<tally id="17" name="regular mesh tally">
<filters>17</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="18" name="unstructured mesh tally">
<filters>18</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="28" material="28" name="fuel" region="163 -164 165 -166 167 -168" universe="10" />
<cell id="29" material="29" name="clad" region="(-163 | 164 | -165 | 166 | -167 | 168) (169 -170 171 -172 173 -174)" universe="10" />
<cell id="30" material="30" name="water" region="(-169 | 170 | -171 | 172 | -173 | 174) (175 -176 177 -178 179 -180)" universe="10" />
<surface coeffs="-5.0" id="163" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="164" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="165" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="166" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="167" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="168" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="169" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="170" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="171" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="172" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="173" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="174" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-15" id="175" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="15" id="176" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-15" id="177" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="15" id="178" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-15" id="179" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="15" id="180" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="28" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="29" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="30" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="19">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="20" library="moab" type="unstructured">
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="19" type="mesh">
<bins>19</bins>
</filter>
<filter id="20" type="mesh">
<bins>20</bins>
</filter>
<tally id="19" name="regular mesh tally">
<filters>19</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="20" name="unstructured mesh tally">
<filters>20</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="31" material="31" name="fuel" region="181 -182 183 -184 185 -186" universe="11" />
<cell id="32" material="32" name="clad" region="(-181 | 182 | -183 | 184 | -185 | 186) (187 -188 189 -190 191 -192)" universe="11" />
<cell id="33" material="33" name="water" region="(-187 | 188 | -189 | 190 | -191 | 192) (193 -194 195 -196 197 -198)" universe="11" />
<surface coeffs="-5.0" id="181" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="182" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="183" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="184" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="185" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="186" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="187" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="188" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="189" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="190" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="191" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="192" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-10" id="193" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="10" id="194" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-10" id="195" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="10" id="196" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-10" id="197" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="10" id="198" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="31" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="32" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="33" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="21">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="22" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="21" type="mesh">
<bins>21</bins>
</filter>
<filter id="22" type="mesh">
<bins>22</bins>
</filter>
<tally id="21" name="regular mesh tally">
<filters>21</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="22" name="unstructured mesh tally">
<filters>22</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="34" material="34" name="fuel" region="199 -200 201 -202 203 -204" universe="12" />
<cell id="35" material="35" name="clad" region="(-199 | 200 | -201 | 202 | -203 | 204) (205 -206 207 -208 209 -210)" universe="12" />
<cell id="36" material="36" name="water" region="(-205 | 206 | -207 | 208 | -209 | 210) (211 -212 213 -214 215 -216)" universe="12" />
<surface coeffs="-5.0" id="199" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="200" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="201" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="202" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="203" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="204" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="205" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="206" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="207" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="208" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="209" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="210" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-10" id="211" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="10" id="212" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-10" id="213" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="10" id="214" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-10" id="215" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="10" id="216" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="34" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="35" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="36" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="23">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="24" library="moab" type="unstructured">
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="23" type="mesh">
<bins>23</bins>
</filter>
<filter id="24" type="mesh">
<bins>24</bins>
</filter>
<tally id="23" name="regular mesh tally">
<filters>23</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="24" name="unstructured mesh tally">
<filters>24</filters>
<scores>flux</scores>
<estimator>tracklength</estimator>
</tally>
</tallies>

View file

@ -70,8 +70,8 @@
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="6" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.h5m</filename>
<mesh id="6" library="libmesh" type="unstructured">
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="5" type="mesh">
<bins>5</bins>

View file

@ -70,8 +70,8 @@
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="8" library="moab" type="unstructured">
<filename>test_mesh_tets.h5m</filename>
<mesh id="8" library="libmesh" type="unstructured">
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="7" type="mesh">
<bins>7</bins>

View file

@ -71,7 +71,7 @@
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="10" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.h5m</filename>
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="9" type="mesh">
<bins>9</bins>

View file

@ -71,7 +71,7 @@
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="12" library="moab" type="unstructured">
<filename>test_mesh_tets.h5m</filename>
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="11" type="mesh">
<bins>11</bins>

View file

@ -71,7 +71,7 @@
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="14" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.h5m</filename>
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="13" type="mesh">
<bins>13</bins>

View file

@ -71,7 +71,7 @@
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="16" library="moab" type="unstructured">
<filename>test_mesh_tets.h5m</filename>
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="15" type="mesh">
<bins>15</bins>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="13" material="13" name="fuel" region="73 -74 75 -76 77 -78" universe="5" />
<cell id="14" material="14" name="clad" region="(-73 | 74 | -75 | 76 | -77 | 78) (79 -80 81 -82 83 -84)" universe="5" />
<cell id="15" material="15" name="water" region="(-79 | 80 | -81 | 82 | -83 | 84) (85 -86 87 -88 89 -90)" universe="5" />
<surface coeffs="-5.0" id="73" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="74" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="75" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="76" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="77" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="78" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="79" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="80" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="81" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="82" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="83" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="84" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-15" id="85" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="15" id="86" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-15" id="87" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="15" id="88" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-15" id="89" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="15" id="90" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="13" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="14" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="15" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="9">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="10" library="moab" type="unstructured">
<filename>test_mesh_tets_w_holes.exo</filename>
</mesh>
<filter id="9" type="mesh">
<bins>9</bins>
</filter>
<filter id="10" type="mesh">
<bins>10</bins>
</filter>
<tally id="9" name="regular mesh tally">
<filters>9</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
<tally id="10" name="unstructured mesh tally">
<filters>10</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,92 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="16" material="16" name="fuel" region="91 -92 93 -94 95 -96" universe="6" />
<cell id="17" material="17" name="clad" region="(-91 | 92 | -93 | 94 | -95 | 96) (97 -98 99 -100 101 -102)" universe="6" />
<cell id="18" material="18" name="water" region="(-97 | 98 | -99 | 100 | -101 | 102) (103 -104 105 -106 107 -108)" universe="6" />
<surface coeffs="-5.0" id="91" name="minimum x" type="x-plane" />
<surface coeffs="5.0" id="92" name="maximum x" type="x-plane" />
<surface coeffs="-5.0" id="93" name="minimum y" type="y-plane" />
<surface coeffs="5.0" id="94" name="maximum y" type="y-plane" />
<surface coeffs="-5.0" id="95" name="minimum z" type="z-plane" />
<surface coeffs="5.0" id="96" name="maximum z" type="z-plane" />
<surface coeffs="-6.0" id="97" name="minimum x" type="x-plane" />
<surface coeffs="6.0" id="98" name="maximum x" type="x-plane" />
<surface coeffs="-6.0" id="99" name="minimum y" type="y-plane" />
<surface coeffs="6.0" id="100" name="maximum y" type="y-plane" />
<surface coeffs="-6.0" id="101" name="minimum z" type="z-plane" />
<surface coeffs="6.0" id="102" name="maximum z" type="z-plane" />
<surface boundary="vacuum" coeffs="-15" id="103" name="minimum x" type="x-plane" />
<surface boundary="vacuum" coeffs="15" id="104" name="maximum x" type="x-plane" />
<surface boundary="vacuum" coeffs="-15" id="105" name="minimum y" type="y-plane" />
<surface boundary="vacuum" coeffs="15" id="106" name="maximum y" type="y-plane" />
<surface boundary="vacuum" coeffs="-15" id="107" name="minimum z" type="z-plane" />
<surface boundary="vacuum" coeffs="15" id="108" name="maximum z" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="16" name="fuel">
<density units="g/cc" value="4.5" />
<nuclide ao="1.0" name="U235" />
</material>
<material id="17" name="zircaloy">
<density units="g/cc" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="18" name="water">
<density units="atom/b-cm" value="0.07416" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>fixed source</run_mode>
<particles>100</particles>
<batches>10</batches>
<source strength="1.0">
<space origin="0.0 0.0 0.0" type="spherical">
<r parameters="0.0 0.0" type="uniform" />
<theta type="discrete">
<parameters>0.0 1.0</parameters>
</theta>
<phi type="discrete">
<parameters>0.0 1.0</parameters>
</phi>
</space>
<angle reference_uvw="-1.0 0.0 0.0" type="monodirectional" />
<energy type="discrete">
<parameters>15000000.0 1.0</parameters>
</energy>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="11">
<dimension>10 10 10</dimension>
<lower_left>-10.0 -10.0 -10.0</lower_left>
<upper_right>10.0 10.0 10.0</upper_right>
</mesh>
<mesh id="12" library="moab" type="unstructured">
<filename>test_mesh_tets.exo</filename>
</mesh>
<filter id="11" type="mesh">
<bins>11</bins>
</filter>
<filter id="12" type="mesh">
<bins>12</bins>
</filter>
<tally id="11" name="regular mesh tally">
<filters>11</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
<tally id="12" name="unstructured mesh tally">
<filters>12</filters>
<scores>flux</scores>
<estimator>collision</estimator>
</tally>
</tallies>

View file

@ -62,17 +62,20 @@ class UnstructuredMeshTest(PyAPITestHarness):
def _cleanup(self):
super()._cleanup()
output = glob.glob('tally*.vtk')
output += glob.glob('tally*.e')
for f in output:
if os.path.exists(f):
os.remove(f)
param_values = (['collision', 'tracklength'], # estimators
param_values = (['libmesh', 'moab'], # mesh libraries
['collision', 'tracklength'], # estimators
[True, False], # geometry outside of the mesh
[(333, 90, 77), None]) # location of holes in the mesh
test_cases = []
for i, (estimator, ext_geom, holes) in enumerate(product(*param_values)):
test_cases.append({'estimator' : estimator,
for i, (lib, estimator, ext_geom, holes) in enumerate(product(*param_values)):
test_cases.append({'library' : lib,
'estimator' : estimator,
'external_geom' : ext_geom,
'holes' : holes,
'inputs_true' : 'inputs_true{}.dat'.format(i)})
@ -81,6 +84,11 @@ for i, (estimator, ext_geom, holes) in enumerate(product(*param_values)):
@pytest.mark.parametrize("test_opts", test_cases)
def test_unstructured_mesh(test_opts):
# skip the tracklength test for libmesh
if test_opts['library'] == 'libmesh' and \
test_opts['estimator'] == 'tracklength':
pytest.skip("Tracklength tallies are not supported using libmesh.")
### Materials ###
materials = openmc.Materials()
@ -185,12 +193,12 @@ def test_unstructured_mesh(test_opts):
regular_mesh_filter = openmc.MeshFilter(mesh=regular_mesh)
if test_opts['holes']:
mesh_filename = "test_mesh_tets_w_holes.h5m"
mesh_filename = "test_mesh_tets_w_holes.exo"
else:
mesh_filename = "test_mesh_tets.h5m"
mesh_filename = "test_mesh_tets.exo"
uscd_mesh = openmc.UnstructuredMesh(mesh_filename)
uscd_mesh.library = 'moab'
uscd_mesh.library = test_opts['library']
uscd_filter = openmc.MeshFilter(mesh=uscd_mesh)
# create tallies