From 19cea16ef9d5b1bd9c501899aa4c07f6be8a6740 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Mon, 7 Dec 2020 19:29:59 -0600 Subject: [PATCH] Adding check that the LibMeshInit object is set. --- src/initialize.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/initialize.cpp b/src/initialize.cpp index c6d8250c1..d30581e06 100644 --- a/src/initialize.cpp +++ b/src/initialize.cpp @@ -68,7 +68,7 @@ int openmc_init(int argc, char* argv[], const void* intracomm) #endif // initialize libMesh if it hasn't been initialized already -// by a call external to OpenMC +// (if initialized externally, the LMI object needs to be provided also) if (!settings::LMI && !libMesh::initialized()) { #ifdef OPENMC_MPI @@ -81,6 +81,10 @@ if (!settings::LMI && !libMesh::initialized()) settings::LMI = std::make_unique(argc, argv, 0, n_threads); #endif } + +if (!settings::LMI) { + fatal_error("libMesh::LibMeshInit object isn't set."); +} #endif // Start total and initialization timer