Remove Fortan compatibility functions

This commit is contained in:
Paul Romano 2019-02-21 16:04:21 -06:00
parent 6712de2ad9
commit 3cac2a6702
27 changed files with 115 additions and 635 deletions

View file

@ -106,7 +106,7 @@ private:
};
//==============================================================================
// Fortran compatibility
// Non-member functions
//==============================================================================
//! Read material data from materials.xml
@ -114,12 +114,5 @@ void read_materials_xml();
void free_memory_material();
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" int* material_element(int i_material);
extern "C" bool material_isotropic(int i_material, int i_nuc_mat);
} // namespace openmc
#endif // OPENMC_MATERIAL_H

View file

@ -176,7 +176,7 @@ private:
//! Checks for the right version of nuclear data within HDF5 files
void check_data_version(hid_t file_id);
extern "C" bool multipole_in_range(const Nuclide* nuc, double E);
bool multipole_in_range(const Nuclide* nuc, double E);
//==============================================================================
// Global variables
@ -209,14 +209,6 @@ extern MaterialMacroXS material_xs;
void nuclides_clear();
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" void set_micro_xs();
extern "C" void nuclide_calculate_urr_xs(bool use_mp, int i_nuclide,
int i_temp, double E);
} // namespace openmc
#endif // OPENMC_NUCLIDE_H

View file

@ -56,5 +56,7 @@ void print_runtime();
//! Display results for global tallies including k-effective estimators
void print_results();
void write_tallies();
} // namespace openmc
#endif // OPENMC_OUTPUT_H

View file

@ -38,151 +38,133 @@ enum class ParticleType {
neutron, photon, electron, positron
};
extern "C" {
struct LocalCoord {
int cell {-1};
int universe {-1};
int lattice {-1};
int lattice_x {-1};
int lattice_y {-1};
int lattice_z {-1};
double xyz[3]; //!< particle position
double uvw[3]; //!< particle direction
bool rotated {false}; //!< Is the level rotated?
struct LocalCoord {
int cell {-1};
int universe {-1};
int lattice {-1};
int lattice_x {-1};
int lattice_y {-1};
int lattice_z {-1};
double xyz[3]; //!< particle position
double uvw[3]; //!< particle direction
bool rotated {false}; //!< Is the level rotated?
//! clear data from a single coordinate level
void reset();
};
//! clear data from a single coordinate level
void reset();
};
//============================================================================
//! State of a particle being transported through geometry
//============================================================================
//============================================================================
//! State of a particle being transported through geometry
//============================================================================
struct Particle {
int64_t id; //!< Unique ID
int type; //!< Particle type (n, p, e, etc.)
struct Particle {
int64_t id; //!< Unique ID
int type; //!< Particle type (n, p, e, etc.)
int n_coord; //!< number of current coordinate levels
int cell_instance; //!< offset for distributed properties
LocalCoord coord[MAX_COORD]; //!< coordinates for all levels
int n_coord; //!< number of current coordinate levels
int cell_instance; //!< offset for distributed properties
LocalCoord coord[MAX_COORD]; //!< coordinates for all levels
// Particle coordinates before crossing a surface
int last_n_coord; //!< number of current coordinates
int last_cell[MAX_COORD]; //!< coordinates for all levels
// Particle coordinates before crossing a surface
int last_n_coord; //!< number of current coordinates
int last_cell[MAX_COORD]; //!< coordinates for all levels
// Energy data
double E; //!< post-collision energy in eV
double last_E; //!< pre-collision energy in eV
int g; //!< post-collision energy group (MG only)
int last_g; //!< pre-collision energy group (MG only)
// Energy data
double E; //!< post-collision energy in eV
double last_E; //!< pre-collision energy in eV
int g; //!< post-collision energy group (MG only)
int last_g; //!< pre-collision energy group (MG only)
// Other physical data
double wgt; //!< particle weight
double mu; //!< angle of scatter
bool alive; //!< is particle alive?
// Other physical data
double wgt; //!< particle weight
double mu; //!< angle of scatter
bool alive; //!< is particle alive?
// Other physical data
double last_xyz_current[3]; //!< coordinates of the last collision or
//!< reflective/periodic surface crossing for
//!< current tallies
double last_xyz[3]; //!< previous coordinates
double last_uvw[3]; //!< previous direction coordinates
double last_wgt; //!< pre-collision particle weight
double absorb_wgt; //!< weight absorbed for survival biasing
// Other physical data
double last_xyz_current[3]; //!< coordinates of the last collision or
//!< reflective/periodic surface crossing for
//!< current tallies
double last_xyz[3]; //!< previous coordinates
double last_uvw[3]; //!< previous direction coordinates
double last_wgt; //!< pre-collision particle weight
double absorb_wgt; //!< weight absorbed for survival biasing
// What event took place
bool fission; //!< did particle cause implicit fission
int event; //!< scatter, absorption
int event_nuclide; //!< index in nuclides array
int event_MT; //!< reaction MT
int delayed_group; //!< delayed group
// What event took place
bool fission; //!< did particle cause implicit fission
int event; //!< scatter, absorption
int event_nuclide; //!< index in nuclides array
int event_MT; //!< reaction MT
int delayed_group; //!< delayed group
// Post-collision physical data
int n_bank; //!< number of fission sites banked
double wgt_bank; //!< weight of fission sites banked
int n_delayed_bank[MAX_DELAYED_GROUPS]; //!< number of delayed fission
//!< sites banked
// Post-collision physical data
int n_bank; //!< number of fission sites banked
double wgt_bank; //!< weight of fission sites banked
int n_delayed_bank[MAX_DELAYED_GROUPS]; //!< number of delayed fission
//!< sites banked
// Indices for various arrays
int surface; //!< index for surface particle is on
int cell_born; //!< index for cell particle was born in
int material; //!< index for current material
int last_material; //!< index for last material
// Indices for various arrays
int surface; //!< index for surface particle is on
int cell_born; //!< index for cell particle was born in
int material; //!< index for current material
int last_material; //!< index for last material
// Temperature of current cell
double sqrtkT; //!< sqrt(k_Boltzmann * temperature) in eV
double last_sqrtkT; //!< last temperature
// Temperature of current cell
double sqrtkT; //!< sqrt(k_Boltzmann * temperature) in eV
double last_sqrtkT; //!< last temperature
// Statistical data
int n_collision; //!< number of collisions
// Statistical data
int n_collision; //!< number of collisions
// Track output
bool write_track {false};
// Track output
bool write_track {false};
// Secondary particles created
int64_t n_secondary {};
Bank secondary_bank[MAX_SECONDARY];
// Secondary particles created
int64_t n_secondary {};
Bank secondary_bank[MAX_SECONDARY];
//! resets all coordinate levels for the particle
void clear();
//! resets all coordinate levels for the particle
void clear();
//! create a secondary particle
//
//! stores the current phase space attributes of the particle in the
//! secondary bank and increments the number of sites in the secondary bank.
//! \param uvw Direction of the secondary particle
//! \param E Energy of the secondary particle in [eV]
//! \param type Particle type
//! \param run_CE Whether continuous-energy data is being used
void create_secondary(const double* uvw, double E, int type, bool run_CE);
//! create a secondary particle
//
//! stores the current phase space attributes of the particle in the
//! secondary bank and increments the number of sites in the secondary bank.
//! \param uvw Direction of the secondary particle
//! \param E Energy of the secondary particle in [eV]
//! \param type Particle type
//! \param run_CE Whether continuous-energy data is being used
void create_secondary(const double* uvw, double E, int type, bool run_CE);
//! sets default attributes for a particle
void initialize();
//! sets default attributes for a particle
void initialize();
//! initialize from a source site
//
//! initializes a particle from data stored in a source site. The source
//! site may have been produced from an external source, from fission, or
//! simply as a secondary particle.
//! \param src Source site data
void from_source(const Bank* src);
//! initialize from a source site
//
//! initializes a particle from data stored in a source site. The source
//! site may have been produced from an external source, from fission, or
//! simply as a secondary particle.
//! \param src Source site data
void from_source(const Bank* src);
//! Transport a particle from birth to death
void transport();
//! Transport a particle from birth to death
void transport();
//! Cross a surface and handle boundary conditions
void cross_surface();
//! Cross a surface and handle boundary conditions
void cross_surface();
//! mark a particle as lost and create a particle restart file
//! \param message A warning message to display
void mark_as_lost(const char* message);
//! mark a particle as lost and create a particle restart file
//! \param message A warning message to display
void mark_as_lost(const char* message);
void mark_as_lost(const std::string& message)
{mark_as_lost(message.c_str());}
void mark_as_lost(const std::string& message)
{mark_as_lost(message.c_str());}
void mark_as_lost(const std::stringstream& message)
{mark_as_lost(message.str());}
void mark_as_lost(const std::stringstream& message)
{mark_as_lost(message.str());}
//! create a particle restart HDF5 file
void write_restart() const;
};
//============================================================================
// Fortran compatibility functions
//============================================================================
void reset_coord(LocalCoord* c);
void particle_clear(Particle* p);
void particle_create_secondary(Particle* p, const double* uvw, double E,
int type, bool run_CE);
void particle_initialize(Particle* p);
void particle_from_source(Particle* p, const Bank* src);
void particle_mark_as_lost(Particle* p, const char* message);
void particle_write_restart(Particle* p);
} // extern "C"
//! create a particle restart HDF5 file
void write_restart() const;
};
} // namespace openmc

View file

@ -46,28 +46,6 @@ public:
std::string reaction_name(int mt);
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" {
int reaction_mt(Reaction* rx);
double reaction_q_value(Reaction* rx);
bool reaction_scatter_in_cm(Reaction* rx);
bool reaction_redundant(Reaction* rx);
double reaction_product_decay_rate(Reaction* rx, int product);
int reaction_product_emission_mode(Reaction* rx, int product);
int reaction_product_particle(Reaction* rx, int product);
void reaction_product_sample(Reaction* rx, int product, double E_in,
double* E_out, double* mu);
int reaction_products_size(Reaction* rx);
double reaction_product_yield(Reaction* rx, int product, double E);
double reaction_sample_elastic_mu(Reaction* rx, double E);
double reaction_xs(Reaction* xs, int temperature, int energy);
int reaction_xs_size(Reaction* xs, int temperature);
int reaction_xs_threshold(Reaction* xs, int temperature);
}
} // namespace openmc
#endif // OPENMC_REACTION_H

View file

@ -101,7 +101,7 @@ namespace model {
Filter* allocate_filter(const std::string& type);
// Filter-related Fortran functions that will be called from C++
//! Make sure index corresponds to a valid filter
int verify_filter(int32_t index);
} // namespace openmc

View file

@ -7,9 +7,8 @@
namespace openmc {
//TODO: those integer values are not needed when Fortran interop is removed
enum class SphericalHarmonicsCosine {
scatter = 1, particle = 2
scatter, particle
};
//==============================================================================

View file

@ -7,9 +7,8 @@
namespace openmc {
//TODO: those integer values are not needed when Fortran interop is removed
enum class LegendreAxis {
x = 1, y = 2, z = 3
x, y, z
};
//==============================================================================

View file

@ -70,42 +70,4 @@ extern "C" int openmc_fission_bank(Bank** ptr, int64_t* n)
}
}
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" int fission_bank_delayed_group(int64_t i) {
return simulation::fission_bank[i-1].delayed_group;
}
extern "C" double fission_bank_E(int64_t i) {
return simulation::fission_bank[i-1].E;
}
extern "C" double fission_bank_wgt(int64_t i) {
return simulation::fission_bank[i-1].wgt;
}
extern "C" void source_bank_xyz(int64_t i, double* xyz)
{
xyz[0] = simulation::source_bank[i-1].xyz[0];
xyz[1] = simulation::source_bank[i-1].xyz[1];
xyz[2] = simulation::source_bank[i-1].xyz[2];
}
extern "C" double source_bank_E(int64_t i)
{
return simulation::source_bank[i-1].E;
}
extern "C" double source_bank_wgt(int64_t i)
{
return simulation::source_bank[i-1].wgt;
}
extern "C" void source_bank_set_wgt(int64_t i, double wgt)
{
simulation::source_bank[i-1].wgt = wgt;
}
} // namespace openmc

View file

@ -115,13 +115,4 @@ void thick_target_bremsstrahlung(Particle& p, double* E_lost)
}
}
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" void set_log_ttb_e_grid()
{
data::ttb_e_grid = xt::log(data::ttb_e_grid);
}
} // namespace openmc

View file

@ -844,10 +844,6 @@ int32_t next_cell(DAGCell* cur_cell, DAGSurface* surf_xed)
}
#endif
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" int cells_size() { return model::cells.size(); }
} // namespace openmc

View file

@ -652,20 +652,4 @@ void read_eigenvalue_hdf5(hid_t group)
read_dataset(group, "k_abs_tra", simulation::k_abs_tra);
}
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" double entropy_c(int i)
{
return simulation::entropy.at(i - 1);
}
extern "C" void entropy_clear()
{
simulation::entropy.clear();
}
extern "C" void k_sum_reset() { simulation::k_sum.fill(0.0); }
} // namespace openmc

View file

@ -1139,34 +1139,6 @@ openmc_extend_materials(int32_t n, int32_t* index_start, int32_t* index_end)
return 0;
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" {
size_t n_materials() { return model::materials.size(); }
int32_t material_id(int32_t i_mat) {return model::materials[i_mat - 1]->id_;}
int material_nuclide(int32_t i_mat, int idx)
{
return model::materials[i_mat - 1]->nuclide_[idx - 1] + 1;
}
int material_nuclide_size(int32_t i_mat)
{
return model::materials[i_mat - 1]->nuclide_.size();
}
double material_atom_density(int32_t i_mat, int idx)
{
return model::materials[i_mat - 1]->atom_density_(idx - 1);
}
double material_density_gpcc(int32_t i_mat)
{
return model::materials[i_mat - 1]->density_gpcc_;
}
}
extern "C" size_t n_materials() { return model::materials.size(); }
} // namespace openmc

View file

@ -900,50 +900,6 @@ void free_memory_mesh()
model::mesh_map.clear();
}
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" {
int n_meshes() { return model::meshes.size(); }
RegularMesh* mesh_ptr(int i) { return model::meshes.at(i).get(); }
int32_t mesh_id(RegularMesh* m) { return m->id_; }
double mesh_volume_frac(RegularMesh* m) { return m->volume_frac_; }
int mesh_n_dimension(RegularMesh* m) { return m->n_dimension_; }
int mesh_dimension(RegularMesh* m, int i) { return m->shape_(i - 1); }
double mesh_lower_left(RegularMesh* m, int i) { return m->lower_left_(i - 1); }
double mesh_upper_right(RegularMesh* m, int i) { return m->upper_right_(i - 1); }
double mesh_width(RegularMesh* m, int i) { return m->width_(i - 1); }
int mesh_get_bin(RegularMesh* m, const double* xyz)
{
return m->get_bin({xyz});
}
int mesh_get_bin_from_indices(RegularMesh* m, const int* ijk)
{
return m->get_bin_from_indices(ijk);
}
void mesh_get_indices(RegularMesh* m, const double* xyz, int* ijk, bool* in_mesh)
{
m->get_indices({xyz}, ijk, in_mesh);
}
void mesh_get_indices_from_bin(RegularMesh* m, int bin, int* ijk)
{
m->get_indices_from_bin(bin, ijk);
}
}
extern "C" int n_meshes() { return model::meshes.size(); }
} // namespace openmc

View file

@ -968,11 +968,7 @@ void nuclides_clear()
data::nuclide_map.clear();
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" bool multipole_in_range(const Nuclide* nuc, double E)
bool multipole_in_range(const Nuclide* nuc, double E)
{
return nuc->multipole_ && E >= nuc->multipole_->E_min_&&
E <= nuc->multipole_->E_max_;

View file

@ -620,7 +620,7 @@ const std::unordered_map<int, const char*> score_names = {
//! Create an ASCII output file showing all tally results.
extern "C" void
void
write_tallies()
{
if (model::tallies.empty()) return;

View file

@ -703,21 +703,4 @@ Particle::write_restart() const
} // #pragma omp critical
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
void reset_coord(LocalCoord* c) { c->reset(); }
void particle_clear(Particle* p) { p->clear(); }
void particle_initialize(Particle* p) { p->initialize(); }
void particle_from_source(Particle* p, const Bank* src)
{
p->from_source(src);
}
void particle_mark_as_lost(Particle* p, const char* message)
{
p->mark_as_lost(message);
}
void particle_write_restart(Particle* p) { p->write_restart(); }
} // namespace openmc

View file

@ -270,81 +270,4 @@ std::string reaction_name(int mt)
}
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
int reaction_mt(Reaction* rx) { return rx->mt_; }
double reaction_q_value(Reaction* rx) { return rx->q_value_; }
bool reaction_scatter_in_cm(Reaction* rx) { return rx->scatter_in_cm_; }
bool reaction_redundant(Reaction* rx) { return rx->redundant_; }
double reaction_product_decay_rate(Reaction* rx, int product)
{
return rx->products_[product - 1].decay_rate_;
}
int reaction_product_emission_mode(Reaction* rx, int product)
{
switch (rx->products_[product - 1].emission_mode_) {
case ReactionProduct::EmissionMode::prompt:
return 1;
case ReactionProduct::EmissionMode::delayed:
return 2;
case ReactionProduct::EmissionMode::total:
return 3;
}
}
int reaction_product_particle(Reaction* rx, int product)
{
return static_cast<int>(rx->products_[product - 1].particle_);
}
void reaction_product_sample(Reaction* rx, int product, double E_in, double* E_out, double* mu)
{
rx->products_[product - 1].sample(E_in, *E_out, *mu);
}
double reaction_product_yield(Reaction* rx, int product, double E)
{
return (*rx->products_[product - 1].yield_)(E);
}
int reaction_products_size(Reaction* rx) { return rx->products_.size(); }
double reaction_xs(Reaction* rx, int temperature, int energy)
{
return rx->xs_[temperature - 1].value[energy - 1];
}
double reaction_sample_elastic_mu(Reaction* rx, double E)
{
// Get elastic scattering distribution
auto& d = rx->products_[0].distribution_[0];
// Check if it is an uncorrelated angle-energy distribution
auto d_ = dynamic_cast<UncorrelatedAngleEnergy*>(d.get());
if (d_) {
return d_->angle().sample(E);
} else {
return 2.0*prn() - 1.0;
}
}
int reaction_xs_size(Reaction* rx, int temperature)
{
return rx->xs_[temperature - 1].value.size();
}
int reaction_xs_threshold(Reaction* rx, int temperature)
{
return rx->xs_[temperature - 1].threshold;
}
}
} // namespace openmc

View file

@ -788,18 +788,4 @@ void free_memory_settings() {
settings::res_scat_nuclides.clear();
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" {
const char* path_cross_sections_c() {
return settings::path_cross_sections.c_str();
}
const char* path_input_c() {
return settings::path_input.c_str();
}
}
} // namespace openmc

View file

@ -26,13 +26,6 @@
#include <algorithm>
#include <string>
namespace openmc {
// data/functions from Fortran side
extern "C" void write_tallies();
} // namespace openmc
//==============================================================================
// C API functions
//==============================================================================
@ -135,7 +128,7 @@ int openmc_simulation_finalize()
simulation::time_active.stop();
simulation::time_finalize.start();
// Deallocate Fortran variables, set tallies to inactive
// Clear material nuclide mapping
for (auto& mat : model::materials) {
mat->mat_nuclide_index_.clear();
}
@ -580,20 +573,4 @@ void free_memory_simulation()
simulation::entropy.clear();
}
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" double k_generation(int i) { return simulation::k_generation.at(i - 1); }
extern "C" int k_generation_size() { return simulation::k_generation.size(); }
extern "C" void k_generation_clear() { simulation::k_generation.clear(); }
extern "C" void k_generation_reserve(int i) { simulation::k_generation.reserve(i); }
extern "C" int64_t work_index(int rank) { return simulation::work_index[rank]; }
// This function was moved here to get around a bug on macOS whereby an invalid
// pointer is returned for the threadprivate filter_matches
extern "C" FilterMatch* filter_match_pointer(int indx) {
return &simulation::filter_matches[indx];
}
} // namespace openmc

View file

@ -332,10 +332,6 @@ void free_memory_source()
model::external_sources.clear();
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
void fill_source_bank_fixedsource()
{
if (settings::path_source.empty()) {

View file

@ -693,16 +693,4 @@ void zero_flux_derivs()
for (auto& deriv : model::tally_derivs) deriv.flux_deriv = 0.;
}
//==============================================================================
// Fortran interop
//==============================================================================
extern "C" int n_tally_derivs() {return model::tally_derivs.size();}
extern "C" TallyDerivative*
tally_deriv_c(int i)
{
return &model::tally_derivs[i];
}
}// namespace openmc

View file

@ -193,48 +193,4 @@ openmc_new_filter(const char* type, int32_t* index)
return 0;
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" {
// filter_match_point moved to simulation.cpp
int32_t filter_get_id(Filter* filt) {return filt->id_;}
void filter_set_id(Filter* filt, int32_t id) {filt->id_ = id;}
void filter_from_xml(Filter* filt, pugi::xml_node* node)
{filt->from_xml(*node);}
void
filter_get_all_bins(Filter* filt, Particle* p, int estimator,
FilterMatch* match)
{
filt->get_all_bins(p, estimator, *match);
}
void filter_to_statepoint(Filter* filt, hid_t group)
{filt->to_statepoint(group);}
void filter_text_label(Filter* filt, int bin, char* label)
{
std::string label_str = filt->text_label(bin);
int i = 0;
for (; i < label_str.size() && i < MAX_LINE_LEN; i++)
label[i] = label_str[i];
label[i] = '\0';
}
void filter_initialize(Filter* filt) {filt->initialize();}
int filter_n_bins(Filter* filt) {return filt->n_bins_;}
int mesh_filter_get_mesh(MeshFilter* filt) {return filt->mesh();}
int sphharm_filter_get_cosine(SphericalHarmonicsFilter* filt)
{return static_cast<int>(filt->cosine_);}
}
} // namespace openmc

View file

@ -38,11 +38,4 @@ ParticleFilter::text_label(int bin) const
return "Particle " + std::to_string(particles_[bin]);
}
//==============================================================================
// Fortran interoperability
//==============================================================================
extern "C" int particle_filter_particles(ParticleFilter* filt, int i)
{return filt->particles_[i];}
} // namespace openmc

View file

@ -1396,86 +1396,4 @@ openmc_global_tallies(double** ptr)
extern "C" size_t tallies_size() { return model::tallies.size(); }
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" {
Tally* tally_pointer(int indx) {return model::tallies[indx].get();}
int active_tallies_data(int i)
{return model::active_tallies[i-1];}
int active_tallies_size()
{return model::active_tallies.size();}
int active_analog_tallies_size()
{return model::active_analog_tallies.size();}
int active_tracklength_tallies_size()
{return model::active_tracklength_tallies.size();}
int active_collision_tallies_size()
{return model::active_collision_tallies.size();}
int active_meshsurf_tallies_size()
{return model::active_meshsurf_tallies.size();}
int active_surface_tallies_size()
{return model::active_surface_tallies.size();}
void tally_init_from_xml(Tally* tally, pugi::xml_node* node)
{tally->init_from_xml(*node);}
int tally_get_id_c(Tally* tally) {return tally->id_;}
void tally_set_id_c(Tally* tally, int id) {tally->id_ = id;}
int tally_get_type_c(Tally* tally) {return tally->type_;}
void tally_set_type_c(Tally* tally, int type) {tally->type_ = type;}
int tally_get_estimator_c(Tally* tally) {return tally->estimator_;}
void tally_set_estimator_c(Tally* tally, int e) {tally->estimator_ = e;}
bool tally_get_depletion_rx_c(Tally* tally) {return tally->depletion_rx_;}
int tally_get_n_scores_c(Tally* tally) {return tally->scores_.size();}
int tally_get_score_c(Tally* tally, int i) {return tally->scores_[i];}
void tally_set_filters_c(Tally* tally, int n, int32_t filter_indices[])
{tally->set_filters(filter_indices, n);}
int tally_get_n_filters_c(Tally* tally) {return tally->filters().size();}
int32_t tally_get_filter_c(Tally* tally, int i) {return tally->filters(i);}
int32_t tally_get_n_filter_bins_c(Tally* tally)
{return tally->n_filter_bins();}
int tally_get_n_nuclide_bins_c(Tally* tally)
{return tally->nuclides_.size();}
int tally_get_nuclide_bins_c(Tally* tally, int i)
{return tally->nuclides_[i-1];}
int tally_get_energyout_filter_c(Tally* tally)
{return tally->energyout_filter_;}
void tally_set_scores(Tally* tally, pugi::xml_node* node)
{tally->set_scores(*node);}
void tally_set_nuclides(Tally* tally, pugi::xml_node* node)
{tally->set_nuclides(*node);}
// void tally_init_triggers(Tally* tally, int i_tally, pugi::xml_node* node)
// {tally->init_triggers(*node, i_tally);}
int tally_get_deriv_c(Tally* tally) {return tally->deriv_;}
int tally_set_deriv_c(Tally* tally, int deriv) {tally->deriv_ = deriv;}
}
} // namespace openmc

View file

@ -593,30 +593,4 @@ void free_memory_thermal()
data::thermal_scatt_map.clear();
}
//==============================================================================
// Fortran compatibility functions
//==============================================================================
extern "C" ThermalScattering*
sab_from_hdf5(hid_t group, const double* temperature, int n)
{
// Convert temperatures to a vector
std::vector<double> T {temperature, temperature + n};
// Create new object and return it
data::thermal_scatt.push_back(std::make_unique<ThermalScattering>(group, T));
return data::thermal_scatt.back().get();
}
extern "C" bool sab_has_nuclide(int i_sab, const char* name)
{
return data::thermal_scatt[i_sab - 1]->has_nuclide(name);
}
extern "C" double sab_threshold(int i_sab)
{
return data::thermal_scatt[i_sab - 1]->threshold();
}
} // namespace openmc

View file

@ -54,22 +54,6 @@ double Timer::elapsed()
}
}
//==============================================================================
// Fortran compatibility
//==============================================================================
extern "C" double time_active_elapsed() { return simulation::time_active.elapsed(); }
extern "C" double time_bank_elapsed() { return simulation::time_bank.elapsed(); }
extern "C" double time_bank_sample_elapsed() { return simulation::time_bank_sample.elapsed(); }
extern "C" double time_bank_sendrecv_elapsed() { return simulation::time_bank_sendrecv.elapsed(); }
extern "C" double time_finalize_elapsed() { return simulation::time_finalize.elapsed(); }
extern "C" double time_inactive_elapsed() { return simulation::time_inactive.elapsed(); }
extern "C" double time_initialize_elapsed() { return simulation::time_initialize.elapsed(); }
extern "C" double time_read_xs_elapsed() { return simulation::time_read_xs.elapsed(); }
extern "C" double time_tallies_elapsed() { return simulation::time_tallies.elapsed(); }
extern "C" double time_total_elapsed() { return simulation::time_total.elapsed(); }
extern "C" double time_transport_elapsed() { return simulation::time_transport.elapsed(); }
//==============================================================================
// Non-member functions
//==============================================================================