A couple more changes for robustness.

This commit is contained in:
Patrick Shriwise 2021-03-12 10:32:14 -06:00
parent fd00bd94b2
commit f673a8dad2

View file

@ -60,7 +60,7 @@ std::vector<std::unique_ptr<Mesh>> meshes;
#ifdef LIBMESH
namespace settings {
std::unique_ptr<libMesh::LibMeshInit> libmesh_init;
const libMesh::Parallel::Communicator* libmesh_comm;
const libMesh::Parallel::Communicator* libmesh_comm {nullptr};
}
#endif
@ -2155,6 +2155,9 @@ void LibMesh::initialize()
fatal_error("Attempting to use an unstructured mesh without a libMesh communicator.");
}
// assuming that unstructured meshes used in OpenMC are 3D
n_dimension_ = 3;
m_ = std::make_unique<libMesh::Mesh>(*settings::libmesh_comm, n_dimension_);
m_->read(filename_);
m_->prepare_for_use();