mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Writing unstructured mesh results with statepoint.
This commit is contained in:
parent
6749f72fec
commit
1b2456632b
3 changed files with 18 additions and 1 deletions
|
|
@ -397,6 +397,7 @@ public:
|
|||
private:
|
||||
moab::Range ehs_; //!< Range of tetrahedra EntityHandle's in the mesh
|
||||
moab::EntityHandle meshset_; //!< EntitySet containing all Tets/Tris
|
||||
moab::EntityHandle tet_set_;
|
||||
moab::EntityHandle kdtree_root_; //!< Root of the MOAB KDTree
|
||||
std::shared_ptr<moab::Interface> mbi_; //!< MOAB instance
|
||||
std::unique_ptr<moab::AdaptiveKDTree> kdtree_; //!< MOAB KDTree instance
|
||||
|
|
|
|||
17
src/mesh.cpp
17
src/mesh.cpp
|
|
@ -1583,6 +1583,17 @@ UnstructuredMesh::UnstructuredMesh(pugi::xml_node node) : Mesh(node) {
|
|||
warning("Non-tetrahedral elements found in unstructured mesh: " + filename_);
|
||||
}
|
||||
|
||||
// make an entity set for all tetrahedra (used later in output)
|
||||
rval = mbi_->create_meshset(moab::MESHSET_SET, tet_set_);
|
||||
if (rval != moab::MB_SUCCESS) {
|
||||
fatal_error("Failed to create an entity set for the tetrahedral elements");
|
||||
}
|
||||
|
||||
rval = mbi_->add_entities(tet_set_, ehs_);
|
||||
if (rval != moab::MB_SUCCESS) {
|
||||
fatal_error("Failed to add tetrahedra to an entity set.");
|
||||
}
|
||||
|
||||
compute_barycentric_data(ehs_);
|
||||
build_kdtree(ehs_);
|
||||
}
|
||||
|
|
@ -2118,8 +2129,12 @@ UnstructuredMesh::write(std::string base_filename) const {
|
|||
// add extension to the base name
|
||||
base_filename += ".h5m";
|
||||
|
||||
// write the tetrahedral elements of the mesh only
|
||||
// to avoid clutter from zero-value data on other
|
||||
// elements during visualization
|
||||
|
||||
moab::ErrorCode rval;
|
||||
rval = mbi_->write_mesh(base_filename.c_str());
|
||||
rval = mbi_->write_mesh(base_filename.c_str(), &tet_set_, 1);
|
||||
if (rval != moab::MB_SUCCESS) {
|
||||
std::stringstream msg;
|
||||
msg << "Failed to write unstructured mesh " << id_;
|
||||
|
|
|
|||
|
|
@ -717,6 +717,7 @@ void write_unstructured_mesh_results() {
|
|||
tally->id_,
|
||||
simulation::current_batch,
|
||||
w);
|
||||
|
||||
umesh->write(umesh_filename);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue