From 483ec403fd1883c3e348665d9d303d13b165dc95 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 18 Feb 2020 17:03:54 -0600 Subject: [PATCH] Fixing CAPI function for unstructured mesh. --- src/mesh.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/mesh.cpp b/src/mesh.cpp index 6697b277a5..f311448da5 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -1419,11 +1419,22 @@ extern "C" int openmc_add_unstrucutred_mesh(const char filename[], const char library[], int* mesh_id) { + bool valid_lib = false; +#ifdef DAGMC if (library == "moab") { model::meshes.push_back(std::move(std::make_unique(filename))); - } else if (library == "libmesh") { + valid_lib = true; + } +#endif + +#ifdef LIBMESH + if (library == "libmesh") { model::meshes.push_back(std::move(std::make_unique(filename))); - } else { + valid_lib = true; + } +#endif + + if (!valid_lib) { set_errmsg("Mesh library " + std::string(library) + \ "is not supported by this build of OpenMC"); return OPENMC_E_INVALID_ARGUMENT;