2018-08-20 14:40:32 -05:00
|
|
|
#ifndef OPENMC_CAPI_H
|
|
|
|
|
#define OPENMC_CAPI_H
|
2017-12-29 17:20:02 -06:00
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
2018-10-11 09:35:51 -05:00
|
|
|
#include <stddef.h>
|
2017-12-29 17:20:02 -06:00
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
2018-11-15 08:13:14 -06:00
|
|
|
#endif
|
|
|
|
|
|
2026-07-17 10:47:40 -05:00
|
|
|
//! Run a stochastic volume calculation
|
|
|
|
|
//
|
|
|
|
|
//! \return Status (negative if an error occurred)
|
2018-04-25 15:07:40 -05:00
|
|
|
int openmc_calculate_volumes();
|
2026-07-17 10:47:40 -05:00
|
|
|
|
2019-07-08 08:07:20 -05:00
|
|
|
int openmc_cell_filter_get_bins(
|
|
|
|
|
int32_t index, const int32_t** cells, int32_t* n);
|
2026-07-17 10:47:40 -05:00
|
|
|
|
|
|
|
|
//! Get the fill for a cell
|
|
|
|
|
//
|
|
|
|
|
//! \param index Index in the cells array
|
|
|
|
|
//! \param type Type of the fill
|
|
|
|
|
//! \param indices Array of material indices for cell
|
|
|
|
|
//! \param n Length of indices array
|
|
|
|
|
//! \return Status (negative if an error occurred)
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_cell_get_fill(
|
|
|
|
|
int32_t index, int* type, int32_t** indices, int32_t* n);
|
2026-07-17 10:47:40 -05:00
|
|
|
|
|
|
|
|
//! Get the ID of a cell
|
|
|
|
|
//
|
|
|
|
|
//! \param index Index in the cells array
|
|
|
|
|
//! \param id ID of the cell
|
|
|
|
|
//! \return Status (negative if an error occurred)
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_cell_get_id(int32_t index, int32_t* id);
|
2026-07-17 10:47:40 -05:00
|
|
|
|
|
|
|
|
//! Get the temperature of a cell
|
|
|
|
|
//
|
|
|
|
|
//! \param index Index in the cells array
|
|
|
|
|
//! \param instance Which instance of the cell. If a null pointer is
|
|
|
|
|
//! passed, the temperature of the first instance is returned.
|
|
|
|
|
//! \param T temperature of the cell
|
|
|
|
|
//!\return Status (negative if an error occurred)
|
2019-04-29 15:40:57 -07:00
|
|
|
int openmc_cell_get_temperature(
|
|
|
|
|
int32_t index, const int32_t* instance, double* T);
|
2026-07-17 10:47:40 -05:00
|
|
|
|
2025-09-18 23:11:06 -05:00
|
|
|
int openmc_cell_get_density(
|
|
|
|
|
int32_t index, const int32_t* instance, double* rho);
|
2021-07-27 18:30:48 -05:00
|
|
|
int openmc_cell_get_translation(int32_t index, double xyz[]);
|
2021-07-28 05:37:13 -05:00
|
|
|
int openmc_cell_get_rotation(int32_t index, double rot[], size_t* n);
|
2019-07-18 18:14:57 -05:00
|
|
|
int openmc_cell_get_name(int32_t index, const char** name);
|
2021-06-23 10:23:05 +07:00
|
|
|
int openmc_cell_get_num_instances(int32_t index, int32_t* num_instances);
|
2019-07-10 07:53:44 -05:00
|
|
|
int openmc_cell_set_name(int32_t index, const char* name);
|
2018-01-08 08:04:57 -06:00
|
|
|
int openmc_cell_set_fill(
|
|
|
|
|
int32_t index, int type, int32_t n, const int32_t* indices);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_cell_set_id(int32_t index, int32_t id);
|
2021-02-04 15:50:02 -06:00
|
|
|
int openmc_cell_set_temperature(
|
|
|
|
|
int32_t index, double T, const int32_t* instance, bool set_contained = false);
|
2025-09-18 23:11:06 -05:00
|
|
|
int openmc_cell_set_density(int32_t index, double rho, const int32_t* instance,
|
|
|
|
|
bool set_contained = false);
|
2021-07-27 18:30:48 -05:00
|
|
|
int openmc_cell_set_translation(int32_t index, const double xyz[]);
|
2021-07-30 11:42:27 -05:00
|
|
|
int openmc_cell_set_rotation(int32_t index, const double rot[], size_t rot_len);
|
2025-01-07 22:50:02 +01:00
|
|
|
int openmc_dagmc_universe_get_cell_ids(
|
|
|
|
|
int32_t univ_id, int32_t* ids, size_t* n);
|
|
|
|
|
int openmc_dagmc_universe_get_num_cells(int32_t univ_id, size_t* n);
|
2019-07-08 08:07:20 -05:00
|
|
|
int openmc_energy_filter_get_bins(
|
|
|
|
|
int32_t index, const double** energies, size_t* n);
|
2019-06-28 14:43:17 -05:00
|
|
|
int openmc_energy_filter_set_bins(
|
|
|
|
|
int32_t index, size_t n, const double* energies);
|
2019-07-25 15:49:14 -05:00
|
|
|
int openmc_energyfunc_filter_get_energy(
|
|
|
|
|
int32_t index, size_t* n, const double** energy);
|
|
|
|
|
int openmc_energyfunc_filter_get_y(int32_t index, size_t* n, const double** y);
|
|
|
|
|
int openmc_energyfunc_filter_set_data(
|
|
|
|
|
int32_t index, size_t n, const double* energies, const double* y);
|
2022-10-18 11:58:24 -05:00
|
|
|
int openmc_energyfunc_filter_set_interpolation(
|
|
|
|
|
int32_t index, const char* interp);
|
|
|
|
|
int openmc_energyfunc_filter_get_interpolation(int32_t index, int* interp);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_extend_cells(int32_t n, int32_t* index_start, int32_t* index_end);
|
|
|
|
|
int openmc_extend_filters(int32_t n, int32_t* index_start, int32_t* index_end);
|
|
|
|
|
int openmc_extend_materials(
|
|
|
|
|
int32_t n, int32_t* index_start, int32_t* index_end);
|
2021-02-08 22:25:17 -05:00
|
|
|
int openmc_extend_meshes(
|
|
|
|
|
int32_t n, const char* type, int32_t* index_start, int32_t* index_end);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_extend_tallies(int32_t n, int32_t* index_start, int32_t* index_end);
|
|
|
|
|
int openmc_filter_get_id(int32_t index, int32_t* id);
|
2019-02-21 14:45:59 -06:00
|
|
|
int openmc_filter_get_type(int32_t index, char* type);
|
2023-06-09 10:47:27 -05:00
|
|
|
int openmc_filter_get_num_bins(int32_t index, int* n_bins);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_filter_set_id(int32_t index, int32_t id);
|
2018-04-25 15:07:40 -05:00
|
|
|
int openmc_finalize();
|
2019-02-21 08:32:32 -06:00
|
|
|
int openmc_find_cell(const double* xyz, int32_t* index, int32_t* instance);
|
2019-07-24 13:10:03 -05:00
|
|
|
int openmc_cell_bounding_box(const int32_t index, double* llc, double* urc);
|
2019-07-09 16:23:24 -05:00
|
|
|
int openmc_global_bounding_box(double* llc, double* urc);
|
2019-03-01 14:46:21 -06:00
|
|
|
int openmc_fission_bank(void** ptr, int64_t* n);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_get_cell_index(int32_t id, int32_t* index);
|
|
|
|
|
int openmc_get_filter_index(int32_t id, int32_t* index);
|
|
|
|
|
void openmc_get_filter_next_id(int32_t* id);
|
|
|
|
|
int openmc_get_keff(double k_combined[]);
|
|
|
|
|
int openmc_get_material_index(int32_t id, int32_t* index);
|
2018-04-17 14:16:43 -05:00
|
|
|
int openmc_get_mesh_index(int32_t id, int32_t* index);
|
2020-06-01 21:19:06 -04:00
|
|
|
int openmc_get_n_batches(int* n_batches, bool get_max_batches);
|
2018-03-30 13:21:15 -05:00
|
|
|
int openmc_get_nuclide_index(const char name[], int* index);
|
2020-01-13 11:34:15 -06:00
|
|
|
int openmc_add_unstructured_mesh(
|
|
|
|
|
const char filename[], const char library[], int* id);
|
2018-04-17 14:16:43 -05:00
|
|
|
int64_t openmc_get_seed();
|
2025-03-05 08:26:38 +09:00
|
|
|
uint64_t openmc_get_stride();
|
2018-01-08 08:04:57 -06:00
|
|
|
int openmc_get_tally_index(int32_t id, int32_t* index);
|
2018-08-16 21:45:47 -04:00
|
|
|
void openmc_get_tally_next_id(int32_t* id);
|
2018-04-26 22:26:29 -05:00
|
|
|
int openmc_global_tallies(double** ptr);
|
2018-04-25 15:07:40 -05:00
|
|
|
int openmc_hard_reset();
|
2018-04-25 12:51:45 -05:00
|
|
|
int openmc_init(int argc, char* argv[], const void* intracomm);
|
2019-03-12 01:54:30 -04:00
|
|
|
bool openmc_is_statepoint_batch();
|
2018-03-30 13:21:15 -05:00
|
|
|
int openmc_legendre_filter_get_order(int32_t index, int* order);
|
|
|
|
|
int openmc_legendre_filter_set_order(int32_t index, int order);
|
2020-06-17 16:38:05 -05:00
|
|
|
int openmc_load_nuclide(const char* name, const double* temps, int n);
|
2018-01-08 08:04:57 -06:00
|
|
|
int openmc_material_add_nuclide(
|
|
|
|
|
int32_t index, const char name[], double density);
|
2019-07-05 08:00:12 -05:00
|
|
|
int openmc_material_get_densities(
|
|
|
|
|
int32_t index, const int** nuclides, const double** densities, int* n);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_material_get_id(int32_t index, int32_t* id);
|
2018-07-17 06:43:35 -05:00
|
|
|
int openmc_material_get_fissionable(int32_t index, bool* fissionable);
|
2019-06-09 16:55:31 -07:00
|
|
|
int openmc_material_get_density(int32_t index, double* density);
|
2018-07-23 09:50:18 -05:00
|
|
|
int openmc_material_get_volume(int32_t index, double* volume);
|
2018-11-02 11:25:08 -05:00
|
|
|
int openmc_material_set_density(
|
|
|
|
|
int32_t index, double density, const char* units);
|
2018-01-08 08:04:57 -06:00
|
|
|
int openmc_material_set_densities(
|
|
|
|
|
int32_t index, int n, const char** name, const double* density);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_material_set_id(int32_t index, int32_t id);
|
2019-07-18 18:14:57 -05:00
|
|
|
int openmc_material_get_name(int32_t index, const char** name);
|
2019-07-10 07:53:44 -05:00
|
|
|
int openmc_material_set_name(int32_t index, const char* name);
|
2018-07-23 09:50:18 -05:00
|
|
|
int openmc_material_set_volume(int32_t index, double volume);
|
2024-01-17 14:46:37 -06:00
|
|
|
int openmc_material_get_depletable(int32_t index, bool* depletable);
|
|
|
|
|
int openmc_material_set_depletable(int32_t index, bool depletable);
|
2019-07-08 08:07:20 -05:00
|
|
|
int openmc_material_filter_get_bins(
|
|
|
|
|
int32_t index, const int32_t** bins, size_t* n);
|
2019-06-28 14:43:17 -05:00
|
|
|
int openmc_material_filter_set_bins(
|
|
|
|
|
int32_t index, size_t n, const int32_t* bins);
|
2018-04-01 07:50:14 -05:00
|
|
|
int openmc_mesh_filter_get_mesh(int32_t index, int32_t* index_mesh);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_mesh_filter_set_mesh(int32_t index, int32_t index_mesh);
|
2021-02-16 21:32:57 -06:00
|
|
|
int openmc_mesh_filter_get_translation(int32_t index, double translation[3]);
|
|
|
|
|
int openmc_mesh_filter_set_translation(int32_t index, double translation[3]);
|
2018-04-01 07:50:14 -05:00
|
|
|
int openmc_mesh_get_id(int32_t index, int32_t* id);
|
|
|
|
|
int openmc_mesh_set_id(int32_t index, int32_t id);
|
2024-01-19 09:01:18 -06:00
|
|
|
int openmc_mesh_get_n_elements(int32_t index, size_t* n);
|
2024-02-13 06:44:05 -06:00
|
|
|
int openmc_mesh_get_volumes(int32_t index, double* volumes);
|
2025-02-26 08:14:53 -06:00
|
|
|
int openmc_mesh_material_volumes(int32_t index, int nx, int ny, int nz,
|
2026-01-29 01:20:48 -06:00
|
|
|
int max_mats, int32_t* materials, double* volumes, double* bboxes);
|
2018-04-01 07:50:14 -05:00
|
|
|
int openmc_meshsurface_filter_get_mesh(int32_t index, int32_t* index_mesh);
|
2018-03-15 22:08:44 -05:00
|
|
|
int openmc_meshsurface_filter_set_mesh(int32_t index, int32_t index_mesh);
|
2019-02-21 00:05:34 -06:00
|
|
|
int openmc_new_filter(const char* type, int32_t* index);
|
2018-04-05 16:07:51 -05:00
|
|
|
int openmc_next_batch(int* status);
|
2019-02-13 23:57:13 -06:00
|
|
|
int openmc_nuclide_name(int index, const char** name);
|
2018-04-25 15:07:40 -05:00
|
|
|
int openmc_plot_geometry();
|
2026-06-08 16:08:08 -05:00
|
|
|
// Deprecated; use openmc_slice_data.
|
2019-03-18 10:09:28 -05:00
|
|
|
int openmc_id_map(const void* slice, int32_t* data_out);
|
2026-06-08 16:08:08 -05:00
|
|
|
// Deprecated; use openmc_slice_data.
|
2019-03-18 10:09:28 -05:00
|
|
|
int openmc_property_map(const void* slice, double* data_out);
|
2026-06-08 16:08:08 -05:00
|
|
|
int openmc_slice_data(const double origin[3], const double u_span[3],
|
|
|
|
|
const double v_span[3], const size_t pixels[2], bool show_overlaps, int level,
|
|
|
|
|
int32_t filter_index, int32_t* geom_data, double* property_data);
|
2026-02-12 23:54:27 -06:00
|
|
|
int openmc_get_plot_index(int32_t id, int32_t* index);
|
|
|
|
|
int openmc_plot_get_id(int32_t index, int32_t* id);
|
|
|
|
|
int openmc_plot_set_id(int32_t index, int32_t id);
|
|
|
|
|
int openmc_solidraytrace_plot_create(int32_t* index);
|
|
|
|
|
int openmc_solidraytrace_plot_get_pixels(
|
|
|
|
|
int32_t index, int32_t* width, int32_t* height);
|
|
|
|
|
int openmc_solidraytrace_plot_set_pixels(
|
|
|
|
|
int32_t index, int32_t width, int32_t height);
|
|
|
|
|
int openmc_solidraytrace_plot_get_color_by(int32_t index, int32_t* color_by);
|
|
|
|
|
int openmc_solidraytrace_plot_set_color_by(int32_t index, int32_t color_by);
|
|
|
|
|
int openmc_solidraytrace_plot_set_default_colors(int32_t index);
|
|
|
|
|
int openmc_solidraytrace_plot_set_all_opaque(int32_t index);
|
|
|
|
|
int openmc_solidraytrace_plot_set_opaque(
|
|
|
|
|
int32_t index, int32_t id, bool visible);
|
|
|
|
|
int openmc_solidraytrace_plot_set_color(
|
|
|
|
|
int32_t index, int32_t id, uint8_t r, uint8_t g, uint8_t b);
|
|
|
|
|
int openmc_solidraytrace_plot_get_camera_position(
|
|
|
|
|
int32_t index, double* x, double* y, double* z);
|
|
|
|
|
int openmc_solidraytrace_plot_set_camera_position(
|
|
|
|
|
int32_t index, double x, double y, double z);
|
|
|
|
|
int openmc_solidraytrace_plot_get_look_at(
|
|
|
|
|
int32_t index, double* x, double* y, double* z);
|
|
|
|
|
int openmc_solidraytrace_plot_set_look_at(
|
|
|
|
|
int32_t index, double x, double y, double z);
|
|
|
|
|
int openmc_solidraytrace_plot_get_up(
|
|
|
|
|
int32_t index, double* x, double* y, double* z);
|
|
|
|
|
int openmc_solidraytrace_plot_set_up(
|
|
|
|
|
int32_t index, double x, double y, double z);
|
|
|
|
|
int openmc_solidraytrace_plot_get_light_position(
|
|
|
|
|
int32_t index, double* x, double* y, double* z);
|
|
|
|
|
int openmc_solidraytrace_plot_set_light_position(
|
|
|
|
|
int32_t index, double x, double y, double z);
|
|
|
|
|
int openmc_solidraytrace_plot_get_fov(int32_t index, double* fov);
|
|
|
|
|
int openmc_solidraytrace_plot_set_fov(int32_t index, double fov);
|
|
|
|
|
int openmc_solidraytrace_plot_update_view(int32_t index);
|
|
|
|
|
int openmc_solidraytrace_plot_create_image(
|
|
|
|
|
int32_t index, uint8_t* data_out, int32_t width, int32_t height);
|
|
|
|
|
int openmc_solidraytrace_plot_get_color(
|
|
|
|
|
int32_t index, int32_t id, uint8_t* r, uint8_t* g, uint8_t* b);
|
|
|
|
|
int openmc_solidraytrace_plot_get_diffuse_fraction(
|
|
|
|
|
int32_t index, double* diffuse_fraction);
|
|
|
|
|
int openmc_solidraytrace_plot_set_diffuse_fraction(
|
|
|
|
|
int32_t index, double diffuse_fraction);
|
2021-02-08 22:25:17 -05:00
|
|
|
int openmc_rectilinear_mesh_get_grid(int32_t index, double** grid_x, int* nx,
|
2021-03-08 20:17:44 -05:00
|
|
|
double** grid_y, int* ny, double** grid_z, int* nz);
|
2021-02-08 22:25:17 -05:00
|
|
|
int openmc_rectilinear_mesh_set_grid(int32_t index, const double* grid_x,
|
|
|
|
|
const int nx, const double* grid_y, const int ny, const double* grid_z,
|
|
|
|
|
const int nz);
|
|
|
|
|
int openmc_regular_mesh_get_dimension(int32_t index, int** id, int* n);
|
|
|
|
|
int openmc_regular_mesh_get_params(
|
|
|
|
|
int32_t index, double** ll, double** ur, double** width, int* n);
|
|
|
|
|
int openmc_regular_mesh_set_dimension(int32_t index, int n, const int* dims);
|
|
|
|
|
int openmc_regular_mesh_set_params(int32_t index, int n, const double* ll,
|
|
|
|
|
const double* ur, const double* width);
|
2022-08-15 13:33:49 -05:00
|
|
|
int openmc_remove_tally(int32_t index);
|
2018-04-25 15:07:40 -05:00
|
|
|
int openmc_reset();
|
2020-04-01 17:06:44 -04:00
|
|
|
int openmc_reset_timers();
|
2018-04-05 16:07:51 -05:00
|
|
|
int openmc_run();
|
2026-02-06 10:42:32 -06:00
|
|
|
void openmc_run_random_ray();
|
2022-07-15 13:23:07 -05:00
|
|
|
int openmc_sample_external_source(size_t n, uint64_t* seed, void* sites);
|
2018-04-17 14:16:43 -05:00
|
|
|
void openmc_set_seed(int64_t new_seed);
|
2025-03-05 08:26:38 +09:00
|
|
|
void openmc_set_stride(uint64_t new_stride);
|
2020-06-01 21:19:06 -04:00
|
|
|
int openmc_set_n_batches(
|
|
|
|
|
int32_t n_batches, bool set_max_batches, bool add_statepoint_batch);
|
2018-04-25 15:07:40 -05:00
|
|
|
int openmc_simulation_finalize();
|
|
|
|
|
int openmc_simulation_init();
|
2019-03-01 14:46:21 -06:00
|
|
|
int openmc_source_bank(void** ptr, int64_t* n);
|
2018-03-30 13:21:15 -05:00
|
|
|
int openmc_spatial_legendre_filter_get_order(int32_t index, int* order);
|
|
|
|
|
int openmc_spatial_legendre_filter_get_params(
|
|
|
|
|
int32_t index, int* axis, double* min, double* max);
|
|
|
|
|
int openmc_spatial_legendre_filter_set_order(int32_t index, int order);
|
|
|
|
|
int openmc_spatial_legendre_filter_set_params(
|
|
|
|
|
int32_t index, const int* axis, const double* min, const double* max);
|
|
|
|
|
int openmc_sphharm_filter_get_order(int32_t index, int* order);
|
|
|
|
|
int openmc_sphharm_filter_get_cosine(int32_t index, char cosine[]);
|
|
|
|
|
int openmc_sphharm_filter_set_order(int32_t index, int order);
|
|
|
|
|
int openmc_sphharm_filter_set_cosine(int32_t index, const char cosine[]);
|
2019-02-05 15:55:17 -06:00
|
|
|
int openmc_statepoint_write(const char* filename, bool* write_source);
|
2024-04-24 17:09:56 -05:00
|
|
|
int openmc_statepoint_load(const char* filename);
|
2018-08-17 13:08:35 -04:00
|
|
|
int openmc_tally_allocate(int32_t index, const char* type);
|
2018-04-18 15:54:04 -05:00
|
|
|
int openmc_tally_get_active(int32_t index, bool* active);
|
2019-02-21 08:32:32 -06:00
|
|
|
int openmc_tally_get_estimator(int32_t index, int* estimator);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_tally_get_id(int32_t index, int32_t* id);
|
2019-07-01 22:08:42 -05:00
|
|
|
int openmc_tally_get_filters(int32_t index, const int32_t** indices, size_t* n);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_tally_get_n_realizations(int32_t index, int32_t* n);
|
2018-01-08 08:04:57 -06:00
|
|
|
int openmc_tally_get_nuclides(int32_t index, int** nuclides, int* n);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_tally_get_scores(int32_t index, int** scores, int* n);
|
2018-08-16 21:45:47 -04:00
|
|
|
int openmc_tally_get_type(int32_t index, int32_t* type);
|
2019-09-26 20:34:11 -04:00
|
|
|
int openmc_tally_get_writable(int32_t index, bool* writable);
|
2018-07-25 14:58:55 -05:00
|
|
|
int openmc_tally_reset(int32_t index);
|
2018-10-11 09:35:51 -05:00
|
|
|
int openmc_tally_results(int32_t index, double** ptr, size_t shape_[3]);
|
2018-04-18 15:54:04 -05:00
|
|
|
int openmc_tally_set_active(int32_t index, bool active);
|
2018-08-16 21:45:47 -04:00
|
|
|
int openmc_tally_set_estimator(int32_t index, const char* estimator);
|
2019-07-01 22:08:42 -05:00
|
|
|
int openmc_tally_set_filters(int32_t index, size_t n, const int32_t* indices);
|
2017-12-29 17:20:02 -06:00
|
|
|
int openmc_tally_set_id(int32_t index, int32_t id);
|
2018-01-08 08:04:57 -06:00
|
|
|
int openmc_tally_set_nuclides(int32_t index, int n, const char** nuclides);
|
2018-04-04 14:28:10 -05:00
|
|
|
int openmc_tally_set_scores(int32_t index, int n, const char** scores);
|
|
|
|
|
int openmc_tally_set_type(int32_t index, const char* type);
|
2019-09-26 20:34:11 -04:00
|
|
|
int openmc_tally_set_writable(int32_t index, bool writable);
|
2023-06-09 10:47:27 -05:00
|
|
|
int openmc_get_weight_windows_index(int32_t id, int32_t* idx);
|
|
|
|
|
int openmc_weight_windows_get_id(int32_t index, int32_t* id);
|
|
|
|
|
int openmc_weight_windows_set_id(int32_t index, int32_t id);
|
|
|
|
|
|
|
|
|
|
//! Updates weight window values using the specified tally
|
|
|
|
|
//! \param[in] ww_idx Index of the weight window object
|
|
|
|
|
//! \param[in] tally_idx Index of the tally to use for the update
|
|
|
|
|
//! \param[in] value Tally value to use for the update (one of 'mean',
|
|
|
|
|
//! 'rel_err') \param[in] threshold Relative error threshold for applied results
|
|
|
|
|
//! \param[in] ratio Upper to lower weight window bound ratio
|
|
|
|
|
int openmc_weight_windows_update_magic(int32_t ww_idx, int32_t tally_idx,
|
|
|
|
|
const char* value, double threshold, double ratio);
|
|
|
|
|
|
|
|
|
|
int openmc_extend_weight_windows(
|
|
|
|
|
int32_t n, int32_t* index_start, int32_t* index_end);
|
|
|
|
|
int openmc_weight_windows_get_mesh(int32_t index, int32_t* mesh_idx);
|
|
|
|
|
int openmc_weight_windows_set_mesh(int32_t index, int32_t mesh_idx);
|
|
|
|
|
int openmc_weight_windows_set_energy_bounds(
|
|
|
|
|
int32_t index, double* e_bounds, size_t e_bounds_size);
|
|
|
|
|
int openmc_weight_windows_get_energy_bounds(
|
|
|
|
|
int32_t index, const double** e_bounds, size_t* e_bounds_size);
|
2026-02-03 01:23:24 -06:00
|
|
|
int openmc_weight_windows_set_particle(int32_t index, int32_t particle);
|
|
|
|
|
int openmc_weight_windows_get_particle(int32_t index, int32_t* particle);
|
2023-06-09 10:47:27 -05:00
|
|
|
int openmc_weight_windows_get_bounds(int32_t index, const double** lower_bounds,
|
|
|
|
|
const double** upper_bounds, size_t* size);
|
|
|
|
|
int openmc_weight_windows_set_bounds(int32_t index, const double* lower_bounds,
|
|
|
|
|
const double* upper_bounds, size_t size);
|
2023-07-22 15:18:46 -05:00
|
|
|
int openmc_weight_windows_get_survival_ratio(int32_t index, double* ratio);
|
|
|
|
|
int openmc_weight_windows_set_survival_ratio(int32_t index, double ratio);
|
|
|
|
|
int openmc_weight_windows_get_max_lower_bound_ratio(
|
|
|
|
|
int32_t index, double* lb_ratio);
|
|
|
|
|
int openmc_weight_windows_set_max_lower_bound_ratio(
|
|
|
|
|
int32_t index, double lb_ratio);
|
|
|
|
|
int openmc_weight_windows_get_weight_cutoff(int32_t index, double* cutoff);
|
|
|
|
|
int openmc_weight_windows_set_weight_cutoff(int32_t index, double cutoff);
|
|
|
|
|
int openmc_weight_windows_get_max_split(int32_t index, int* max_split);
|
|
|
|
|
int openmc_weight_windows_set_max_split(int32_t index, int max_split);
|
2023-06-09 10:47:27 -05:00
|
|
|
size_t openmc_weight_windows_size();
|
2026-02-12 23:54:27 -06:00
|
|
|
size_t openmc_plots_size();
|
2023-06-09 10:47:27 -05:00
|
|
|
int openmc_weight_windows_export(const char* filename = nullptr);
|
|
|
|
|
int openmc_weight_windows_import(const char* filename = nullptr);
|
2018-03-30 13:21:15 -05:00
|
|
|
int openmc_zernike_filter_get_order(int32_t index, int* order);
|
|
|
|
|
int openmc_zernike_filter_get_params(
|
|
|
|
|
int32_t index, double* x, double* y, double* r);
|
|
|
|
|
int openmc_zernike_filter_set_order(int32_t index, int order);
|
|
|
|
|
int openmc_zernike_filter_set_params(
|
|
|
|
|
int32_t index, const double* x, const double* y, const double* r);
|
2017-12-29 17:20:02 -06:00
|
|
|
|
2026-02-03 01:23:24 -06:00
|
|
|
int openmc_particle_filter_get_bins(int32_t idx, int32_t bins[]);
|
2023-06-09 10:47:27 -05:00
|
|
|
|
2020-11-24 22:56:31 -05:00
|
|
|
//! Sets the mesh and energy grid for CMFD reweight
|
2026-07-17 10:47:40 -05:00
|
|
|
//! \param[in] meshtally_id id of CMFD Mesh Tally
|
2020-12-03 10:37:13 -05:00
|
|
|
//! \param[in] cmfd_indices indices storing spatial and energy dimensions of
|
|
|
|
|
//! CMFD problem \param[in] norm CMFD normalization factor
|
2021-06-23 14:52:04 +07:00
|
|
|
void openmc_initialize_mesh_egrid(
|
|
|
|
|
const int meshtally_id, const int* cmfd_indices, const double norm);
|
2020-11-24 22:56:31 -05:00
|
|
|
|
|
|
|
|
//! Sets the mesh and energy grid for CMFD reweight
|
2020-12-03 10:37:13 -05:00
|
|
|
//! \param[in] feedback whether or not to run CMFD feedback
|
|
|
|
|
//! \param[in] cmfd_src computed CMFD source
|
2021-06-23 14:52:04 +07:00
|
|
|
void openmc_cmfd_reweight(const bool feedback, const double* cmfd_src);
|
2020-11-24 22:56:31 -05:00
|
|
|
|
2018-12-11 18:00:06 -05:00
|
|
|
//! Sets the fixed variables that are used for CMFD linear solver
|
2020-12-03 10:37:13 -05:00
|
|
|
//! \param[in] indptr CSR format index pointer array of loss matrix
|
|
|
|
|
//! \param[in] len_indptr length of indptr
|
|
|
|
|
//! \param[in] indices CSR format index array of loss matrix
|
|
|
|
|
//! \param[in] n_elements number of non-zero elements in CMFD loss matrix
|
|
|
|
|
//! \param[in] dim dimension n of nxn CMFD loss matrix
|
|
|
|
|
//! \param[in] spectral spectral radius of CMFD matrices and tolerances
|
|
|
|
|
//! \param[in] map coremap for problem, storing accelerated regions
|
|
|
|
|
//! \param[in] use_all_threads whether to use all threads when running CMFD
|
|
|
|
|
//! solver
|
2021-06-23 14:52:04 +07:00
|
|
|
void openmc_initialize_linsolver(const int* indptr, int len_indptr,
|
|
|
|
|
const int* indices, int n_elements, int dim, double spectral, const int* map,
|
|
|
|
|
bool use_all_threads);
|
2018-12-11 18:00:06 -05:00
|
|
|
|
|
|
|
|
//! Runs a Gauss Seidel linear solver to solve CMFD matrix equations
|
|
|
|
|
//! linear solver
|
2020-12-03 10:37:13 -05:00
|
|
|
//! \param[in] A_data CSR format data array of coefficient matrix
|
|
|
|
|
//! \param[in] b right hand side vector
|
|
|
|
|
//! \param[out] x unknown vector
|
|
|
|
|
//! \param[in] tol tolerance on final error
|
2018-12-11 18:00:06 -05:00
|
|
|
//! \return number of inner iterations required to reach convergence
|
2021-06-23 14:52:04 +07:00
|
|
|
int openmc_run_linsolver(
|
|
|
|
|
const double* A_data, const double* b, double* x, double tol);
|
2018-12-11 18:00:06 -05:00
|
|
|
|
2021-06-23 14:52:04 +07:00
|
|
|
//! Export physical properties for model
|
|
|
|
|
//! \param[in] filename Filename to write to
|
|
|
|
|
//! \return Error code
|
|
|
|
|
int openmc_properties_export(const char* filename);
|
|
|
|
|
|
|
|
|
|
//! Import physical properties for model
|
|
|
|
|
//! \param[in] filename Filename to read from
|
|
|
|
|
// \return Error code
|
|
|
|
|
int openmc_properties_import(const char* filename);
|
|
|
|
|
|
2017-12-29 17:20:02 -06:00
|
|
|
// Error codes
|
2018-04-05 16:07:51 -05:00
|
|
|
extern int OPENMC_E_UNASSIGNED;
|
|
|
|
|
extern int OPENMC_E_ALLOCATE;
|
|
|
|
|
extern int OPENMC_E_OUT_OF_BOUNDS;
|
|
|
|
|
extern int OPENMC_E_INVALID_SIZE;
|
|
|
|
|
extern int OPENMC_E_INVALID_ARGUMENT;
|
|
|
|
|
extern int OPENMC_E_INVALID_TYPE;
|
|
|
|
|
extern int OPENMC_E_INVALID_ID;
|
|
|
|
|
extern int OPENMC_E_GEOMETRY;
|
|
|
|
|
extern int OPENMC_E_DATA;
|
|
|
|
|
extern int OPENMC_E_PHYSICS;
|
|
|
|
|
extern int OPENMC_E_WARNING;
|
2017-12-29 17:20:02 -06:00
|
|
|
|
|
|
|
|
// Global variables
|
|
|
|
|
extern char openmc_err_msg[256];
|
2018-04-20 11:03:40 -05:00
|
|
|
|
2017-12-29 17:20:02 -06:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2018-08-20 14:40:32 -05:00
|
|
|
#endif // OPENMC_CAPI_H
|