mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
Some cleanup of libmesh control flow and file write during state_point.
This commit is contained in:
parent
dd609b4191
commit
210d99aed3
4 changed files with 16 additions and 10 deletions
|
|
@ -71,6 +71,7 @@ else()
|
|||
#===============================================================================
|
||||
if(libmesh)
|
||||
find_package(LIBMESH REQUIRED)
|
||||
list(APPEND cxxflags ${LIBMESH_CFLAGS})
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
|
|
@ -415,11 +416,11 @@ if(dagmc)
|
|||
endif()
|
||||
|
||||
if(libmesh)
|
||||
if (debug)
|
||||
target_link_libraries(libopenmc PkgConfig::LIBMESH_DEVEL)
|
||||
else()
|
||||
target_link_libraries(libopenmc PkgConfig::LIBMESH)
|
||||
endif()
|
||||
if (debug)
|
||||
target_link_libraries(libopenmc PkgConfig::LIBMESH_DEVEL)
|
||||
else()
|
||||
target_link_libraries(libopenmc PkgConfig::LIBMESH)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
#===============================================================================
|
||||
|
|
|
|||
|
|
@ -70,7 +70,11 @@ int openmc_init(int argc, char* argv[], const void* intracomm)
|
|||
// initialize libmesh
|
||||
if (!settings::LMI && !libMesh::initialized())
|
||||
{
|
||||
#ifdef OPENMC_MPI
|
||||
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, n_threads, comm);
|
||||
#else
|
||||
settings::LMI = std::make_unique<libMesh::LibMeshInit>(argc, argv, n_threads);
|
||||
#endif
|
||||
settings::libmesh_comm = &(settings::LMI->comm());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2217,6 +2217,7 @@ void LibMesh::initialize() {
|
|||
|
||||
// bounding box for the mesh
|
||||
bbox_ = libMesh::MeshTools::create_bounding_box(*m_);
|
||||
|
||||
}
|
||||
|
||||
int LibMesh::n_bins() const {
|
||||
|
|
|
|||
|
|
@ -54,6 +54,11 @@ openmc_statepoint_write(const char* filename, bool* write_source)
|
|||
// Write message
|
||||
write_message("Creating state point " + filename_ + "...", 5);
|
||||
|
||||
#if defined(LIBMESH) || defined(DAGMC)
|
||||
// write unstructured mesh tallies to VTK if possible
|
||||
write_unstructured_mesh_results();
|
||||
#endif
|
||||
|
||||
hid_t file_id;
|
||||
if (mpi::master) {
|
||||
// Create statepoint file
|
||||
|
|
@ -167,11 +172,6 @@ openmc_statepoint_write(const char* filename, bool* write_source)
|
|||
tally_ids.push_back(tally->id_);
|
||||
write_attribute(tallies_group, "ids", tally_ids);
|
||||
|
||||
#if defined(LIBMESH) || defined(DAGMC)
|
||||
// write unstructured mesh tallies to VTK if possible
|
||||
write_unstructured_mesh_results();
|
||||
#endif
|
||||
|
||||
// Write all tally information except results
|
||||
for (const auto& tally : model::tallies) {
|
||||
hid_t tally_group = create_group(tallies_group,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue