Skip to content

Commit ca63da9

Browse files
authored
Ensure n_dimension_ attribute is set for unstructured meshes. (#3575)
1 parent ecb0a33 commit ca63da9

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/openmc/mesh.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,9 +666,8 @@ class UnstructuredMesh : public Mesh {
666666

667667
public:
668668
// Constructors
669-
UnstructuredMesh() {};
669+
UnstructuredMesh() { n_dimension_ = 3; };
670670
UnstructuredMesh(pugi::xml_node node);
671-
UnstructuredMesh(const std::string& filename);
672671

673672
static const std::string mesh_type;
674673
virtual std::string get_mesh_type() const override;

src/mesh.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,8 @@ Position StructuredMesh::sample_element(
590590

591591
UnstructuredMesh::UnstructuredMesh(pugi::xml_node node) : Mesh(node)
592592
{
593+
n_dimension_ = 3;
594+
593595
// check the mesh type
594596
if (check_for_node(node, "type")) {
595597
auto temp = get_node_value(node, "type", true, true);
@@ -2519,7 +2521,9 @@ MOABMesh::MOABMesh(pugi::xml_node node) : UnstructuredMesh(node)
25192521
}
25202522

25212523
MOABMesh::MOABMesh(const std::string& filename, double length_multiplier)
2524+
: UnstructuredMesh()
25222525
{
2526+
n_dimension_ = 3;
25232527
filename_ = filename;
25242528
set_length_multiplier(length_multiplier);
25252529
initialize();
@@ -3242,6 +3246,7 @@ LibMesh::LibMesh(libMesh::MeshBase& input_mesh, double length_multiplier)
32423246
LibMesh::LibMesh(const std::string& filename, double length_multiplier)
32433247
: adaptive_(false)
32443248
{
3249+
n_dimension_ = 3;
32453250
set_mesh_pointer_from_filename(filename);
32463251
set_length_multiplier(length_multiplier);
32473252
initialize();

0 commit comments

Comments
 (0)