Skip to content
19 changes: 19 additions & 0 deletions include/openmc/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,13 @@ class Mesh {
// Constructors and destructor
Mesh() = default;
Mesh(pugi::xml_node node);
Mesh(hid_t group);
virtual ~Mesh() = default;

template<typename T>
static const std::unique_ptr<Mesh>& create(
T dataset, const std::string& mesh_type, const std::string& mesh_library);

// Methods
//! Perform any preparation needed to support point location within the mesh
virtual void prepare_for_point_location() {};
Expand Down Expand Up @@ -258,6 +263,7 @@ class StructuredMesh : public Mesh {
public:
StructuredMesh() = default;
StructuredMesh(pugi::xml_node node) : Mesh {node} {};
StructuredMesh(hid_t group) : Mesh {group} {};
virtual ~StructuredMesh() = default;

using MeshIndex = std::array<int, 3>;
Expand Down Expand Up @@ -423,6 +429,7 @@ class PeriodicStructuredMesh : public StructuredMesh {
public:
PeriodicStructuredMesh() = default;
PeriodicStructuredMesh(pugi::xml_node node) : StructuredMesh {node} {};
PeriodicStructuredMesh(hid_t group) : StructuredMesh {group} {};

Position local_coords(const Position& r) const override
{
Expand All @@ -442,6 +449,7 @@ class RegularMesh : public StructuredMesh {
// Constructors
RegularMesh() = default;
RegularMesh(pugi::xml_node node);
RegularMesh(hid_t group);

// Overridden methods
int get_index_in_direction(double r, int i) const override;
Expand Down Expand Up @@ -492,6 +500,7 @@ class RectilinearMesh : public StructuredMesh {
// Constructors
RectilinearMesh() = default;
RectilinearMesh(pugi::xml_node node);
RectilinearMesh(hid_t group);

// Overridden methods
int get_index_in_direction(double r, int i) const override;
Expand Down Expand Up @@ -534,6 +543,7 @@ class CylindricalMesh : public PeriodicStructuredMesh {
// Constructors
CylindricalMesh() = default;
CylindricalMesh(pugi::xml_node node);
CylindricalMesh(hid_t group);

// Overridden methods
virtual MeshIndex get_indices(Position r, bool& in_mesh) const override;
Expand Down Expand Up @@ -598,6 +608,7 @@ class SphericalMesh : public PeriodicStructuredMesh {
// Constructors
SphericalMesh() = default;
SphericalMesh(pugi::xml_node node);
SphericalMesh(hid_t group);

// Overridden methods
virtual MeshIndex get_indices(Position r, bool& in_mesh) const override;
Expand Down Expand Up @@ -668,6 +679,7 @@ class UnstructuredMesh : public Mesh {
// Constructors
UnstructuredMesh() { n_dimension_ = 3; };
UnstructuredMesh(pugi::xml_node node);
UnstructuredMesh(hid_t group);

static const std::string mesh_type;
virtual std::string get_mesh_type() const override;
Expand Down Expand Up @@ -774,6 +786,7 @@ class MOABMesh : public UnstructuredMesh {
// Constructors
MOABMesh() = default;
MOABMesh(pugi::xml_node);
MOABMesh(hid_t group);
MOABMesh(const std::string& filename, double length_multiplier = 1.0);
MOABMesh(std::shared_ptr<moab::Interface> external_mbi);

Expand Down Expand Up @@ -943,6 +956,7 @@ class LibMesh : public UnstructuredMesh {
public:
// Constructors
LibMesh(pugi::xml_node node);
LibMesh(hid_t group);
LibMesh(const std::string& filename, double length_multiplier = 1.0);
LibMesh(libMesh::MeshBase& input_mesh, double length_multiplier = 1.0);

Expand Down Expand Up @@ -1069,6 +1083,11 @@ class AdaptiveLibMesh : public LibMesh {
//! \param[in] root XML node
void read_meshes(pugi::xml_node root);

//! Read meshes from a HDF5 file
//
//! \param[in] group HDF5 group
void read_meshes(hid_t group);

//! Write mesh data to an HDF5 group
//
//! \param[in] group HDF5 group
Expand Down
Loading
Loading