mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Taking care of a couple setup issues.
This commit is contained in:
parent
3c280c1e17
commit
670d76117c
1 changed files with 15 additions and 1 deletions
16
src/mesh.cpp
16
src/mesh.cpp
|
|
@ -1507,6 +1507,15 @@ openmc_mesh_set_params(int32_t index, int n, const double* ll, const double* ur,
|
|||
#ifdef DAGMC
|
||||
|
||||
UnstructuredMesh::UnstructuredMesh(pugi::xml_node node) : Mesh(node) {
|
||||
|
||||
// check the mesh type
|
||||
if (check_for_node(node, "type")) {
|
||||
auto temp = get_node_value(node, "type", true, true);
|
||||
if (temp != "unstructured") {
|
||||
fatal_error("Invalid mesh type: " + temp);
|
||||
}
|
||||
}
|
||||
|
||||
// get the filename of the unstructured mesh to load
|
||||
if (check_for_node(node, "mesh_file")) {
|
||||
filename_ = get_node_value(node, "mesh_file");
|
||||
|
|
@ -1518,8 +1527,13 @@ UnstructuredMesh::UnstructuredMesh(pugi::xml_node node) : Mesh(node) {
|
|||
|
||||
// create MOAB instance
|
||||
mbi_ = std::shared_ptr<moab::Interface>(new moab::Core());
|
||||
// create meshset to load mesh into
|
||||
moab::ErrorCode rval = mbi_->create_meshset(moab::MESHSET_SET, meshset_);
|
||||
if (rval != moab::MB_SUCCESS) {
|
||||
fatal_error("Failed to create fileset for umesh: " + filename_);
|
||||
}
|
||||
// load unstructured mesh file
|
||||
moab::ErrorCode rval = mbi_->load_file(filename_.c_str(), &meshset_);
|
||||
rval = mbi_->load_file(filename_.c_str(), &meshset_);
|
||||
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