Write surface source files per batch (#3124)

Co-authored-by: Patrick Shriwise <pshriwise@gmail.com>
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Zoe Prieto 2024-10-03 19:32:03 -03:00 committed by GitHub
parent b54de4d761
commit 9686851e7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 167 additions and 48 deletions

View file

@ -129,14 +129,17 @@ extern std::unordered_set<int>
statepoint_batch; //!< Batches when state should be written
extern std::unordered_set<int>
source_write_surf_id; //!< Surface ids where sources will be written
extern int
max_history_splits; //!< maximum number of particle splits for weight windows
extern int64_t max_surface_particles; //!< maximum number of particles to be
//!< banked on surfaces per process
extern int64_t ssw_cell_id; //!< Cell id for the surface source
//!< write setting
extern SSWCellType ssw_cell_type; //!< Type of option for the cell
//!< argument of surface source write
extern int64_t ssw_max_particles; //!< maximum number of particles to be
//!< banked on surfaces per process
extern int64_t ssw_max_files; //!< maximum number of surface source files
//!< to be created
extern int64_t ssw_cell_id; //!< Cell id for the surface source
//!< write setting
extern SSWCellType ssw_cell_type; //!< Type of option for the cell
//!< argument of surface source write
extern TemperatureMethod
temperature_method; //!< method for choosing temperatures
extern double

View file

@ -37,6 +37,7 @@ extern "C" int n_lost_particles; //!< cumulative number of lost particles
extern "C" bool need_depletion_rx; //!< need to calculate depletion rx?
extern "C" int restart_batch; //!< batch at which a restart job resumed
extern "C" bool satisfy_triggers; //!< have tally triggers been satisfied?
extern int ssw_current_file; //!< current surface source file
extern "C" int total_gen; //!< total number of generations simulated
extern double total_weight; //!< Total source weight in a batch
extern int64_t work_per_rank; //!< number of particles per MPI rank

View file

@ -2,6 +2,7 @@
#define OPENMC_STATE_POINT_H
#include <cstdint>
#include <string>
#include <gsl/gsl-lite.hpp>
@ -33,8 +34,11 @@ void load_state_point();
// 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.
void write_source_point(const char* filename, gsl::span<SourceSite> source_bank,
const vector<int64_t>& bank_index);
void write_h5_source_point(const char* filename,
gsl::span<SourceSite> source_bank, const vector<int64_t>& bank_index);
void write_source_point(std::string, gsl::span<SourceSite> source_bank,
const vector<int64_t>& bank_index, bool use_mcpl);
// This appends a source bank specification to an HDF5 file
// that's already open. It is used internally by write_source_point.