mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
added public mesh_ptr() accessor. moved m->prepare_for_use() to filename constructor since it only happens there. for consistency, added theh length_multiplier scale modification to constructors
This commit is contained in:
parent
6a9be64d71
commit
fd8a820708
2 changed files with 14 additions and 6 deletions
|
|
@ -704,6 +704,8 @@ public:
|
|||
|
||||
double volume(int bin) const override;
|
||||
|
||||
libMesh::MeshBase * mesh_ptr() const;
|
||||
|
||||
private:
|
||||
void initialize() override;
|
||||
void set_mesh_pointer_from_filename(const std::string& filename);
|
||||
|
|
|
|||
18
src/mesh.cpp
18
src/mesh.cpp
|
|
@ -2332,6 +2332,9 @@ LibMesh::LibMesh(libMesh::MeshBase & input_mesh, double length_multiplier)
|
|||
{
|
||||
m_ = &input_mesh;
|
||||
set_length_multiplier(length_multiplier);
|
||||
if (specified_length_multiplier_) {
|
||||
libMesh::MeshTools::Modification::scale(*m_, length_multiplier_);
|
||||
}
|
||||
initialize();
|
||||
}
|
||||
|
||||
|
|
@ -2340,6 +2343,10 @@ LibMesh::LibMesh(const std::string& filename, double length_multiplier)
|
|||
{
|
||||
set_mesh_pointer_from_filename(filename);
|
||||
set_length_multiplier(length_multiplier);
|
||||
if (specified_length_multiplier_) {
|
||||
libMesh::MeshTools::Modification::scale(*m_, length_multiplier_);
|
||||
}
|
||||
m_->prepare_for_use();
|
||||
initialize();
|
||||
}
|
||||
|
||||
|
|
@ -2362,12 +2369,6 @@ void LibMesh::initialize()
|
|||
// assuming that unstructured meshes used in OpenMC are 3D
|
||||
n_dimension_ = 3;
|
||||
|
||||
if (specified_length_multiplier_) {
|
||||
libMesh::MeshTools::Modification::scale(*m_, length_multiplier_);
|
||||
}
|
||||
|
||||
m_->prepare_for_use();
|
||||
|
||||
// ensure that the loaded mesh is 3 dimensional
|
||||
if (m_->mesh_dimension() != n_dimension_) {
|
||||
fatal_error(fmt::format("Mesh file {} specified for use in an unstructured "
|
||||
|
|
@ -2565,6 +2566,11 @@ double LibMesh::volume(int bin) const
|
|||
return m_->elem_ref(bin).volume();
|
||||
}
|
||||
|
||||
libMesh::MeshBase * mesh_ptr() const
|
||||
{
|
||||
return m_;
|
||||
}
|
||||
|
||||
#endif // LIBMESH
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue