mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Reduce nested code in create_interface by changing if statement following @pshriwise suggestion
This commit is contained in:
parent
fa588b373f
commit
ffeed77d5d
1 changed files with 8 additions and 8 deletions
16
src/mesh.cpp
16
src/mesh.cpp
|
|
@ -1630,15 +1630,15 @@ void
|
|||
MOABMesh::create_interface()
|
||||
{
|
||||
// Do not create a MOAB instance if one is already in memory
|
||||
if (!mbi_) {
|
||||
// create MOAB instance
|
||||
mbi_ = std::make_shared<moab::Core>();
|
||||
if (mbi_) return;
|
||||
|
||||
// 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 MOAB instance
|
||||
mbi_ = std::make_shared<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_);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue