mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Using libmesh element references where possible.
This commit is contained in:
parent
a1bbdfb940
commit
16e05739a9
3 changed files with 13 additions and 8 deletions
|
|
@ -67,13 +67,18 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
|
|||
int n_threads = 1;
|
||||
#endif
|
||||
|
||||
// initialize libmesh
|
||||
// initialize libMesh if it hasn't been initialized already
|
||||
// by a call external to OpenMC
|
||||
if (!settings::LMI && !libMesh::initialized())
|
||||
{
|
||||
#ifdef OPENMC_MPI
|
||||
// pass command line args, empty MPI communicator, and number of threads.
|
||||
// Because libMesh was not initialized, we assume that OpenMC is the primary
|
||||
// application and that its main MPI comm should be used.
|
||||
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, comm, n_threads);
|
||||
#else
|
||||
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, n_threads);
|
||||
// pass command line args, empty MPI communicator, and number of threads
|
||||
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, 0, n_threads);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue