Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,8 @@ list(APPEND libopenmc_SOURCES
src/event.cpp
src/file_utils.cpp
src/finalize.cpp
src/gendf.cpp
src/gendf_parser.cpp
src/geometry.cpp
src/geometry_aux.cpp
src/hdf5_interface.cpp
Expand Down
Binary file added bin/openmc
Binary file not shown.
65 changes: 65 additions & 0 deletions geometry.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?xml version='1.0' encoding='UTF-8'?>
<geometry>
<cell id="1" material="void" universe="2"/>
<cell id="2" material="void" universe="3"/>
<cell id="3" material="void" universe="4"/>
<cell id="4" material="void" universe="5"/>
<cell id="5" material="void" universe="6"/>
<cell id="6" material="void" universe="7"/>
<cell id="7" material="void" universe="8"/>
<cell id="8" material="void" universe="9"/>
<cell id="9" material="void" universe="10"/>
<cell id="10" material="void" universe="11"/>
<cell id="11" material="void" universe="12"/>
<cell id="12" material="void" universe="13"/>
<cell id="13" material="void" universe="14"/>
<cell id="14" material="void" universe="15"/>
<cell id="15" material="void" universe="16"/>
<cell id="16" material="void" universe="17"/>
<cell id="17" material="void" universe="18"/>
<cell id="18" material="void" universe="19"/>
<cell id="19" material="void" universe="20"/>
<cell id="20" fill="1" universe="21"/>
<cell id="21" material="void" universe="22"/>
<cell id="22" material="void" universe="23"/>
<cell id="23" material="void" universe="24"/>
<cell id="24" material="void" universe="25"/>
<cell id="25" material="void" universe="26"/>
<cell id="26" material="void" universe="27"/>
<cell id="27" material="void" universe="28"/>
<cell id="28" material="void" universe="29"/>
<cell id="29" material="void" universe="30"/>
<cell id="30" material="void" universe="31"/>
<cell id="31" material="void" universe="32"/>
<cell id="32" material="void" universe="33"/>
<cell id="33" material="void" universe="34"/>
<cell id="34" material="void" universe="35"/>
<cell id="35" material="void" universe="36"/>
<cell id="36" material="void" universe="37"/>
<cell id="37" material="void" universe="38"/>
<cell id="38" material="void" universe="39"/>
<cell id="39" material="void" universe="40"/>
<hex_lattice id="1" n_rings="3" n_axial="2">
<pitch>1.0 1.0</pitch>
<center>0.0 0.0 0.0</center>
<universes>
9
20 10
19 3 11
8 4
18 2 12
7 5
17 6 13
16 14
15
29
40 30
39 23 31
28 24
38 22 32
27 25
37 26 33
36 34
35</universes>
</hex_lattice>
</geometry>
73 changes: 73 additions & 0 deletions include/openmc/capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,79 @@ int openmc_properties_export(const char* filename);
// \return Error code
int openmc_properties_import(const char* filename);

//==============================================================================
// GENDF Library Functions
//==============================================================================

//! Create GENDF library instance
//! \param[in] library_path Path to GENDF library directory
//! \param[in] n_energy_bounds Number of energy boundaries
//! \param[in] energy_bounds Energy group boundaries in eV
//! \param[in] energy_structure_name Energy structure name (e.g., "CCFE-709")
//! \param[out] lib_id Library instance ID
//! \return Error code
int openmc_gendf_library_create(const char* library_path, int n_energy_bounds,
const double* energy_bounds, const char* energy_structure_name,
int32_t* lib_id);

//! Free GENDF library instance
//! \param[in] lib_id Library ID
//! \return Error code
int openmc_gendf_library_free(int32_t lib_id);

//! Get number of energy groups in GENDF library
//! \param[in] lib_id Library ID
//! \param[out] n_groups Number of groups
//! \return Error code
int openmc_gendf_library_get_n_groups(int32_t lib_id, int* n_groups);

//! Get energy group boundaries from GENDF library
//! \param[in] lib_id Library ID
//! \param[out] bounds Pointer to energy bounds array
//! \param[out] n Number of boundaries
//! \return Error code
int openmc_gendf_library_get_energy_bounds(
int32_t lib_id, const double** bounds, int* n);

//! Check if nuclide is available in GENDF library
//! \param[in] lib_id Library ID
//! \param[in] nuclide Nuclide name
//! \param[out] has Whether nuclide is available
//! \return Error code
int openmc_gendf_library_has_nuclide(
int32_t lib_id, const char* nuclide, bool* has);

//! Get list of available nuclides in GENDF library
//! \param[in] lib_id Library ID
//! \param[out] nuclides Array of nuclide name strings (caller must free)
//! \param[out] n Number of nuclides
//! \return Error code
int openmc_gendf_library_available_nuclides(
int32_t lib_id, char*** nuclides, int* n);

//! Get cross-section data for nuclide and reaction
//! \param[in] lib_id Library ID
//! \param[in] nuclide Nuclide name
//! \param[in] mt ENDF MT reaction number
//! \param[in] n_energy_bounds Number of energy boundaries
//! \param[in] energy_bounds Energy boundaries for validation
//! \param[out] xs_data Cross-section array (caller must free with
//! openmc_gendf_free_xs) \param[out] n_groups Number of groups returned
//! \return Error code
int openmc_gendf_get_xs(int32_t lib_id, const char* nuclide, int32_t mt,
int n_energy_bounds, const double* energy_bounds, double** xs_data,
int* n_groups);

//! Free cross-section array allocated by openmc_gendf_get_xs
//! \param[in] xs_data Array to free
void openmc_gendf_free_xs(double* xs_data);

//! Free nuclide array allocated by openmc_gendf_library_available_nuclides
//! \param[in] nuclides Array of nuclide names to free (may be NULL)
//! \param[in] n Number of nuclides in array
//! \note Safe to call with NULL pointer or n=0
void openmc_gendf_free_nuclides(char** nuclides, int n);

// Error codes
extern int OPENMC_E_UNASSIGNED;
extern int OPENMC_E_ALLOCATE;
Expand Down
Loading