From 781bc8adf57faf2ae94c8a5c415dba01e0e3c2c7 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Tue, 17 Dec 2019 20:44:56 -0600 Subject: [PATCH] Adding equation system to mesh. --- include/openmc/mesh.h | 5 ++++- src/mesh.cpp | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/openmc/mesh.h b/include/openmc/mesh.h index 7470d6052..417097df7 100644 --- a/include/openmc/mesh.h +++ b/include/openmc/mesh.h @@ -24,9 +24,10 @@ #ifdef LIBMESH #include "libmesh/libmesh.h" +#include "libmesh/elem.h" +#include "libmesh/equation_systems.h" #include "libmesh/mesh.h" #include "libmesh/point.h" -#include "libmesh/elem.h" #endif namespace openmc { @@ -509,6 +510,8 @@ public: private: std::unique_ptr m_; std::unique_ptr point_locator_; + std::unique_ptr equation_systems_; + std::string eq_system_name_; libMesh::Elem* first_element_; std::set boundary_elements_; }; diff --git a/src/mesh.cpp b/src/mesh.cpp index edf0529e7..454cc9188 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -2054,6 +2054,13 @@ LibMesh::LibMesh(pugi::xml_node node) : UnstructuredMeshBase(node) { m_ = std::unique_ptr(new libMesh::Mesh(settings::LMI->comm(), 3)); m_->read(filename_); + m_->prepare_for_use(); + + eq_system_name_ = "mesh_" + std::to_string(id_) + "_system"; + + equation_systems_ = + std::unique_ptr(new libMesh::EquationSystems(*m_)); + auto& eq_sys = equation_systems_->add_system(eq_system_name_); point_locator_ = m_->sub_point_locator(); point_locator_->enable_out_of_mesh_mode();