2018-08-20 14:40:32 -05:00
|
|
|
#ifndef OPENMC_STATE_POINT_H
|
|
|
|
|
#define OPENMC_STATE_POINT_H
|
2018-04-20 11:03:40 -05:00
|
|
|
|
|
|
|
|
#include <cstdint>
|
2024-10-03 19:32:03 -03:00
|
|
|
#include <string>
|
2018-04-20 11:03:40 -05:00
|
|
|
|
|
|
|
|
#include "hdf5.h"
|
2018-08-20 14:40:32 -05:00
|
|
|
|
|
|
|
|
#include "openmc/capi.h"
|
2020-10-15 16:41:13 -05:00
|
|
|
#include "openmc/particle.h"
|
2023-03-31 13:46:42 -04:00
|
|
|
#include "openmc/shared_array.h"
|
2025-02-19 19:03:20 -06:00
|
|
|
#include "openmc/span.h"
|
2021-04-22 16:46:23 -04:00
|
|
|
#include "openmc/vector.h"
|
2018-04-20 11:03:40 -05:00
|
|
|
|
|
|
|
|
namespace openmc {
|
|
|
|
|
|
2019-02-05 23:39:22 -06:00
|
|
|
void load_state_point();
|
2023-03-31 13:46:42 -04:00
|
|
|
|
|
|
|
|
// By passing in a filename, source bank, and list of source indices
|
|
|
|
|
// on each MPI rank, this writes an HDF5 file which contains that
|
|
|
|
|
// information which can later be read in by read_source_bank
|
|
|
|
|
// (defined below). If you're writing code to write out a new kind
|
|
|
|
|
// of particle bank, this function is the one you want to use!
|
|
|
|
|
//
|
|
|
|
|
// For example, this is used to write both the surface source sites
|
|
|
|
|
// or fission source sites for eigenvalue continuation runs.
|
|
|
|
|
//
|
|
|
|
|
// This function ends up calling write_source_bank, and is responsible
|
|
|
|
|
// for opening the file to be written to and controlling whether the
|
|
|
|
|
// write is done in parallel (if compiled with parallel HDF5).
|
2023-03-31 23:59:04 -04:00
|
|
|
//
|
|
|
|
|
// bank_index is an exclusive parallel scan of the source_bank.size()
|
|
|
|
|
// values on each rank, used to create global indexing. This vector
|
|
|
|
|
// can be created by calling calculate_parallel_index_vector on
|
|
|
|
|
// source_bank.size() if such a vector is not already available.
|
2025-02-19 19:03:20 -06:00
|
|
|
//
|
|
|
|
|
// The source_bank variable is used as work space if MPI is used,
|
|
|
|
|
// so it cannot be given as a const span.
|
|
|
|
|
void write_h5_source_point(const char* filename, span<SourceSite> source_bank,
|
|
|
|
|
const vector<int64_t>& bank_index);
|
2024-10-03 19:32:03 -03:00
|
|
|
|
2025-02-19 19:03:20 -06:00
|
|
|
void write_source_point(std::string, span<SourceSite> source_bank,
|
2024-10-03 19:32:03 -03:00
|
|
|
const vector<int64_t>& bank_index, bool use_mcpl);
|
2023-03-31 13:46:42 -04:00
|
|
|
|
|
|
|
|
// This appends a source bank specification to an HDF5 file
|
|
|
|
|
// that's already open. It is used internally by write_source_point.
|
2025-02-19 19:03:20 -06:00
|
|
|
void write_source_bank(hid_t group_id, span<SourceSite> source_bank,
|
2023-04-15 12:50:30 -04:00
|
|
|
const vector<int64_t>& bank_index);
|
2023-03-31 13:46:42 -04:00
|
|
|
|
2021-04-16 15:35:33 -04:00
|
|
|
void read_source_bank(
|
2021-04-29 16:23:54 -04:00
|
|
|
hid_t group_id, vector<SourceSite>& sites, bool distribute);
|
2019-02-05 23:39:22 -06:00
|
|
|
void write_tally_results_nr(hid_t file_id);
|
|
|
|
|
void restart_set_keff();
|
2020-02-28 16:24:34 -06:00
|
|
|
void write_unstructured_mesh_results();
|
|
|
|
|
|
2018-04-20 11:03:40 -05:00
|
|
|
} // namespace openmc
|
2018-08-20 14:40:32 -05:00
|
|
|
#endif // OPENMC_STATE_POINT_H
|