SERiF 0.0.1a
3+1D Stellar Structure and Evolution
Loading...
Searching...
No Matches
meshIO.h
Go to the documentation of this file.
1/* ***********************************************************************
2//
3// Copyright (C) 2025 -- The 4D-STAR Collaboration
4// File Author: Emily Boudreaux
5// Last Modified: March 18, 2025
6//
7// 4DSSE is free software; you can use it and/or modify
8// it under the terms and restrictions the GNU General Library Public
9// License version 3 (GPLv3) as published by the Free Software Foundation.
10//
11// 4DSSE is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14// See the GNU Library General Public License for more details.
15//
16// You should have received a copy of the GNU Library General Public License
17// along with this software; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// *********************************************************************** */
21#pragma once
22
23#include "mfem.hpp"
24#include <string>
25
26namespace serif::mesh {
30 class MeshIO
31 {
32 private:
33 bool loaded_;
34 std::string mesh_file_;
35 std::unique_ptr<mfem::Mesh> m_mesh;
36
37 public:
43 explicit MeshIO(const std::string &mesh_file, double scale_factor = 1.0);
44
49
54 void LinearRescale(double scale_factor) const;
55
60 [[nodiscard]] mfem::Mesh & GetMesh() const noexcept;
61
66 [[nodiscard]] bool IsLoaded() const;
67 };
68}
void LinearRescale(double scale_factor) const
Rescale the mesh by a linear factor.
Definition meshIO.cpp:51
~MeshIO()
Destructor for the MeshIO class.
std::string mesh_file_
Filename of the mesh file.
Definition meshIO.h:34
MeshIO(const std::string &mesh_file, double scale_factor=1.0)
Constructor that initializes the MeshIO object with a mesh file.
Definition meshIO.cpp:30
bool IsLoaded() const
Check if the mesh is loaded.
Definition meshIO.cpp:74
mfem::Mesh & GetMesh() const noexcept
Get the mesh object.
Definition meshIO.cpp:79
std::unique_ptr< mfem::Mesh > m_mesh
The mesh object.
Definition meshIO.h:35
bool loaded_
Flag to indicate if the mesh is loaded.
Definition meshIO.h:33