diff --git a/include/openmc/state_point.h b/include/openmc/state_point.h index 1c728cfdb2..f93fa00aaa 100644 --- a/include/openmc/state_point.h +++ b/include/openmc/state_point.h @@ -18,10 +18,7 @@ void write_source_bank(hid_t group_id, bool surf_source_bank); void read_source_bank(hid_t group_id, std::vector& sites, bool distribute); void write_tally_results_nr(hid_t file_id); void restart_set_keff(); - -#if defined(LIBMESH) || defined(DAGMC) void write_unstructured_mesh_results(); -#endif } // namespace openmc #endif // OPENMC_STATE_POINT_H diff --git a/src/state_point.cpp b/src/state_point.cpp index 0e569a0700..263fd0ae8c 100644 --- a/src/state_point.cpp +++ b/src/state_point.cpp @@ -55,7 +55,7 @@ openmc_statepoint_write(const char* filename, bool* write_source) write_message("Creating state point " + filename_ + "...", 5); #if defined(LIBMESH) || defined(DAGMC) - // write unstructured mesh tallies to VTK if possible + // write unstructured mesh tallies to VTK write_unstructured_mesh_results(); #endif @@ -770,9 +770,13 @@ void read_source_bank(hid_t group_id, std::vector& sites, bool d H5Tclose(banktype); } -#if defined(LIBMESH) || defined(DAGMC) + + void write_unstructured_mesh_results() { +#if !defined(LIBMESH) && !defined(DAGMC) + fatal_error("Unstructured mesh is disabled for this build of OpenMC."); +#else for (auto& tally : model::tallies) { @@ -868,8 +872,8 @@ void write_unstructured_mesh_results() { for (const auto& score : tally_scores) { umesh->remove_score(score); } } } + #endif } -#endif void write_tally_results_nr(hid_t file_id) {