mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Small refactor of MOAB construction into its own method
This commit is contained in:
parent
c8db88dff2
commit
9ab4ae4755
2 changed files with 22 additions and 7 deletions
|
|
@ -412,6 +412,9 @@ private:
|
|||
|
||||
// Methods
|
||||
|
||||
//! Create the MOAB interface pointer
|
||||
void create_interface();
|
||||
|
||||
//! Find all intersections with faces of the mesh.
|
||||
//
|
||||
//! \param[in] start Staring location
|
||||
|
|
|
|||
26
src/mesh.cpp
26
src/mesh.cpp
|
|
@ -1583,13 +1583,12 @@ MOABMesh::MOABMesh(const std::string& filename) {
|
|||
}
|
||||
|
||||
void MOABMesh::initialize() {
|
||||
// create MOAB instance
|
||||
mbi_ = make_unique<moab::Core>();
|
||||
// load unstructured mesh file
|
||||
moab::ErrorCode rval = mbi_->load_file(filename_.c_str());
|
||||
if (rval != moab::MB_SUCCESS) {
|
||||
fatal_error("Failed to load the unstructured mesh file: " + filename_);
|
||||
}
|
||||
|
||||
// Create the MOAB interface and load data from file
|
||||
create_interface();
|
||||
|
||||
// Initialise MOAB error code
|
||||
moab::ErrorCode rval = moab::MB_SUCCESS;
|
||||
|
||||
// set member range of tetrahedral entities
|
||||
rval = mbi_->get_entities_by_dimension(0, n_dimension_, ehs_);
|
||||
|
|
@ -1619,6 +1618,19 @@ void MOABMesh::initialize() {
|
|||
build_kdtree(ehs_);
|
||||
}
|
||||
|
||||
void
|
||||
MOABMesh::create_interface()
|
||||
{
|
||||
// create MOAB instance
|
||||
mbi_ = make_unique<moab::Core>();
|
||||
|
||||
// load unstructured mesh file
|
||||
moab::ErrorCode rval = mbi_->load_file(filename_.c_str());
|
||||
if (rval != moab::MB_SUCCESS) {
|
||||
fatal_error("Failed to load the unstructured mesh file: " + filename_);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MOABMesh::build_kdtree(const moab::Range& all_tets)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue