Ensure n_dimension_ attribute is set for unstructured meshes. (#3575)

This commit is contained in:
Patrick Shriwise 2025-09-19 15:00:51 -05:00 committed by GitHub
parent ecb0a3361f
commit ca63da91b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -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;

View file

@ -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();