Skip to content

Commit

Permalink
Merge branch 'develop' into pr/nelsonag/3245
Browse files Browse the repository at this point in the history
  • Loading branch information
paulromano committed Jan 14, 2025
2 parents 4bf9a56 + d39a414 commit 03583c7
Show file tree
Hide file tree
Showing 36 changed files with 1,524 additions and 756 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ["3.10"]
python-version: ["3.11"]
mpi: [n, y]
omp: [n, y]
dagmc: [n]
Expand All @@ -35,34 +35,34 @@ jobs:
vectfit: [n]

include:
- python-version: "3.11"
- python-version: "3.12"
omp: n
mpi: n
- python-version: "3.12"
- python-version: "3.13"
omp: n
mpi: n
- dagmc: y
python-version: "3.10"
python-version: "3.11"
mpi: y
omp: y
- ncrystal: y
python-version: "3.10"
python-version: "3.11"
mpi: n
omp: n
- libmesh: y
python-version: "3.10"
python-version: "3.11"
mpi: y
omp: y
- libmesh: y
python-version: "3.10"
python-version: "3.11"
mpi: n
omp: y
- event: y
python-version: "3.10"
python-version: "3.11"
omp: y
mpi: n
- vectfit: y
python-version: "3.10"
python-version: "3.11"
omp: n
mpi: y
name: "Python ${{ matrix.python-version }} (omp=${{ matrix.omp }},
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 2
build:
os: "ubuntu-20.04"
tools:
python: "3.10"
python: "3.12"

sphinx:
configuration: docs/source/conf.py
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ ENV DD_REPO='https://github.com/pshriwise/double-down'
ENV DD_INSTALL_DIR=$HOME/Double_down

# DAGMC variables
ENV DAGMC_BRANCH='v3.2.3'
ENV DAGMC_BRANCH='v3.2.4'
ENV DAGMC_REPO='https://github.com/svalinn/DAGMC'
ENV DAGMC_INSTALL_DIR=$HOME/DAGMC/

Expand Down
2 changes: 1 addition & 1 deletion docs/source/devguide/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Leadership Team
The TC consists of the following individuals:

- `Paul Romano <https://github.com/paulromano>`_
- `Sterling Harper <https://github.com/smharper>`_
- `Patrick Shriwise <https://github.com/pshriwise>`_
- `Adam Nelson <https://github.com/nelsonag>`_
- `Benoit Forget <https://github.com/bforget>`_

Expand Down
34 changes: 27 additions & 7 deletions docs/source/io_formats/geometry.rst
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,33 @@ Each ``<dagmc_universe>`` element can have the following attributes or sub-eleme

*Default*: None

:material_overrides:
This element contains information on material overrides to be applied to the
DAGMC universe. It has the following attributes and sub-elements:

.. note:: A geometry.xml file containing only a DAGMC model for a file named `dagmc.h5m` (no CSG)
looks as follows
:cell:
Material override information for a single cell. It contains the following
attributes and sub-elements:

.. code-block:: xml
:id:
The cell ID in the DAGMC geometry for which the material override will
apply.

<?xml version='1.0' encoding='utf-8'?>
<geometry>
<dagmc_universe filename="dagmc.h5m" id="1" />
</geometry>
:materials:
A list of material IDs that will apply to instances of the cell. If the
list contains only one ID, it will replace the original material
assignment of all instances of the DAGMC cell. If the list contains more
than one material, each material ID of the list will be assigned to the
various instances of the DAGMC cell.

*Default*: None

.. note:: A geometry.xml file containing only a DAGMC model for a file named
`dagmc.h5m` (no CSG) looks as follows:

.. code-block:: xml
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<dagmc_universe filename="dagmc.h5m" id="1" />
</geometry>
2 changes: 1 addition & 1 deletion docs/source/io_formats/statepoint.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ The current version of the statepoint file format is 18.1.
**/tallies/meshes/mesh <uid>/**

:Attributes: - **id** (*int*) -- ID of the mesh
- **type** (*char[]*) -- Type of mesh.

:Datasets: - **name** (*char[]*) -- Name of the mesh.
- **type** (*char[]*) -- Type of mesh.
- **dimension** (*int*) -- Number of mesh cells in each dimension.
- **Regular Mesh Only:**
- **lower_left** (*double[]*) -- Coordinates of lower-left corner of
Expand Down
2 changes: 1 addition & 1 deletion docs/source/methods/cross_sections.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ scattering information in the water while the fuel can be simulated with linear
or even isotropic scattering.

.. _logarithmic mapping technique:
https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-14-24530.pdf
https://mcnp.lanl.gov/pdf_files/TechReport_2014_LANL_LA-UR-14-24530_Brown.pdf
.. _Hwang: https://doi.org/10.13182/NSE87-A16381
.. _Josey: https://doi.org/10.1016/j.jcp.2015.08.013
.. _WMP Library: https://github.com/mit-crpg/WMP_Library
Expand Down
1 change: 1 addition & 0 deletions docs/source/pythonapi/capi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Functions
finalize
find_cell
find_material
dagmc_universe_cell_ids
global_bounding_box
global_tallies
hard_reset
Expand Down
3 changes: 3 additions & 0 deletions include/openmc/capi.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ int openmc_cell_set_temperature(
int32_t index, double T, const int32_t* instance, bool set_contained = false);
int openmc_cell_set_translation(int32_t index, const double xyz[]);
int openmc_cell_set_rotation(int32_t index, const double rot[], size_t rot_len);
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);
int openmc_energy_filter_get_bins(
int32_t index, const double** energies, size_t* n);
int openmc_energy_filter_set_bins(
Expand Down
8 changes: 7 additions & 1 deletion include/openmc/cell.h
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ class Cell {
int32_t universe_; //!< Universe # this cell is in
int32_t fill_; //!< Universe # filling this cell
int32_t n_instances_ {0}; //!< Number of instances of this cell
GeometryType geom_type_; //!< Geometric representation type (CSG, DAGMC)

//! \brief Index corresponding to this cell in distribcell arrays
int distribcell_index_ {C_NONE};
Expand Down Expand Up @@ -350,6 +349,13 @@ class Cell {
vector<double> rotation_;

vector<int32_t> offset_; //!< Distribcell offset table

// Accessors
const GeometryType& geom_type() const { return geom_type_; }
GeometryType& geom_type() { return geom_type_; }

private:
GeometryType geom_type_; //!< Geometric representation type (CSG, DAGMC)
};

struct CellInstanceItem {
Expand Down
15 changes: 15 additions & 0 deletions include/openmc/dagmc.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ void check_dagmc_root_univ();
#include "openmc/particle.h"
#include "openmc/position.h"
#include "openmc/surface.h"
#include "openmc/vector.h"

#include <memory> // for shared_ptr, unique_ptr
#include <string>
#include <unordered_map>
#include <utility> // for pair

class UWUW;

Expand Down Expand Up @@ -133,6 +139,10 @@ class DAGUniverse : public Universe {
void legacy_assign_material(
std::string mat_string, std::unique_ptr<DAGCell>& c) const;

//! Assign a material overriding normal assignement to a cell
//! \param[in] c The OpenMC cell to which the material is assigned
void override_assign_material(std::unique_ptr<DAGCell>& c) const;

//! Return the index into the model cells vector for a given DAGMC volume
//! handle in the universe
//! \param[in] vol MOAB handle to the DAGMC volume set
Expand Down Expand Up @@ -184,6 +194,11 @@ class DAGUniverse : public Universe {
//!< generate new material IDs for the universe
bool has_graveyard_; //!< Indicates if the DAGMC geometry has a "graveyard"
//!< volume
std::unordered_map<int32_t, vector<int32_t>>
material_overrides_; //!< Map of material overrides
//!< keys correspond to the DAGMCCell id
//!< values are a list of material ids used
//!< for the override
};

//==============================================================================
Expand Down
8 changes: 7 additions & 1 deletion include/openmc/surface.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class Surface {
int id_; //!< Unique ID
std::string name_; //!< User-defined name
unique_ptr<BoundaryCondition> bc_; //!< Boundary condition
GeometryType geom_type_; //!< Geometry type indicator (CSG or DAGMC)
bool surf_source_ {false}; //!< Activate source banking for the surface?

explicit Surface(pugi::xml_node surf_node);
Expand Down Expand Up @@ -91,6 +90,13 @@ class Surface {
//! Get the BoundingBox for this surface.
virtual BoundingBox bounding_box(bool /*pos_side*/) const { return {}; }

// Accessors
const GeometryType& geom_type() const { return geom_type_; }
GeometryType& geom_type() { return geom_type_; }

private:
GeometryType geom_type_; //!< Geometry type indicator (CSG or DAGMC)

protected:
virtual void to_hdf5_inner(hid_t group_id) const = 0;
};
Expand Down
1 change: 1 addition & 0 deletions openmc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from openmc.weight_windows import *
from openmc.surface import *
from openmc.universe import *
from openmc.dagmc import *
from openmc.source import *
from openmc.settings import *
from openmc.lattice import *
Expand Down
Loading

0 comments on commit 03583c7

Please sign in to comment.