mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Adjusting how the LibMesh comm is stored.
This commit is contained in:
parent
7323ae526f
commit
b54bbad9d9
4 changed files with 10 additions and 3 deletions
|
|
@ -29,6 +29,7 @@ namespace settings {
|
|||
|
||||
#ifdef LIBMESH
|
||||
extern std::unique_ptr<libMesh::LibMeshInit> LMI;
|
||||
extern libMesh::Parallel::Communicator* libmesh_comm;
|
||||
#endif
|
||||
|
||||
// Boolean flags
|
||||
|
|
|
|||
|
|
@ -68,7 +68,11 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
|
|||
#endif
|
||||
|
||||
// initialize libmesh
|
||||
if (!settings::LMI) settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, n_threads);
|
||||
if (!settings::LMI && !libMesh::initialized())
|
||||
{
|
||||
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, n_threads);
|
||||
settings::libmesh_comm = &(settings::LMI->comm());
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -2190,10 +2190,11 @@ LibMesh::centroid(int bin) const {
|
|||
std::string LibMesh::library() const { return "libmesh"; }
|
||||
|
||||
void LibMesh::initialize() {
|
||||
// always 3 for unstructured meshes
|
||||
// always 3 for unstructured meshes
|
||||
n_dimension_ = 3;
|
||||
|
||||
m_ = std::unique_ptr<libMesh::Mesh>(new libMesh::Mesh(settings::LMI->comm(), 3));
|
||||
m_ = std::make_unique<libMesh::Mesh>(*settings::libmesh_comm, 3);
|
||||
|
||||
m_->read(filename_);
|
||||
m_->prepare_for_use();
|
||||
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ namespace settings {
|
|||
|
||||
#ifdef LIBMESH
|
||||
std::unique_ptr<libMesh::LibMeshInit> LMI;
|
||||
libMesh::Parallel::Communicator* libmesh_comm;
|
||||
#endif
|
||||
|
||||
// Default values for boolean flags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue