diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index c15e25697..fbc6c46f5 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -666,9 +666,8 @@ class UnstructuredMesh : public Mesh { public: // Constructors - UnstructuredMesh() {}; + UnstructuredMesh() { n_dimension_ = 3; }; UnstructuredMesh(pugi::xml_node node); - UnstructuredMesh(const std::string& filename); static const std::string mesh_type; virtual std::string get_mesh_type() const override; diff --git a/src/mesh.cpp b/src/mesh.cpp index 3e4ff1a3e..b7396a25a 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -590,6 +590,8 @@ Position StructuredMesh::sample_element( UnstructuredMesh::UnstructuredMesh(pugi::xml_node node) : Mesh(node) { + n_dimension_ = 3; + // check the mesh type if (check_for_node(node, "type")) { auto temp = get_node_value(node, "type", true, true); @@ -2519,7 +2521,9 @@ MOABMesh::MOABMesh(pugi::xml_node node) : UnstructuredMesh(node) } MOABMesh::MOABMesh(const std::string& filename, double length_multiplier) + : UnstructuredMesh() { + n_dimension_ = 3; filename_ = filename; set_length_multiplier(length_multiplier); initialize(); @@ -3242,6 +3246,7 @@ LibMesh::LibMesh(libMesh::MeshBase& input_mesh, double length_multiplier) LibMesh::LibMesh(const std::string& filename, double length_multiplier) : adaptive_(false) { + n_dimension_ = 3; set_mesh_pointer_from_filename(filename); set_length_multiplier(length_multiplier); initialize();