Apply PR suggestions from @paulromano

Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
Patrick Shriwise 2021-06-25 07:45:02 -05:00 committed by GitHub
parent a7dab4e68c
commit fbcaf5acd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 20 additions and 24 deletions

View file

@ -443,7 +443,7 @@ entirely by a DAGMC geometry will contain only the DAGMC universe. Using a
:class:`openmc.DAGMCUniverse` looks like the following::
dag_univ = openmc.DAGMCUniverse(filename='dagmc.h5m')
geometry = openmc.Geometry(root=dag_univ)
geometry = openmc.Geometry(dag_univ)
geometry.export_to_xml()
The resulting ``geometry.xml`` file will be:
@ -475,7 +475,7 @@ Cell, Surface, and Material IDs
-------------------------------
By default, DAGMC applies cell and surface IDs defined by the CAD engine that
the model originated in. If these IDs overlap with ID's in the CSG ID space,
the model originated in. If these IDs overlap with IDs in the CSG ID space,
this will result in an error. However, the ``auto_ids`` property of a DAGMC
universe can be set to set DAGMC cell and surface IDs by appending to the
existing CSG cell ID space in the OpenMC model.
@ -485,7 +485,7 @@ assignments are based on natively defined OpenMC materials, no further work is
required. If DAGMC materials are assigned using the `University of Wisconsin
Unified Workflow`_ (UWUW), however, material IDs in the UWUW material library
may overlap with those used in the CSG geometry. In this case, overlaps in the
UWUW and OpenMC material ID space will cause an error. To automatically resolved
UWUW and OpenMC material ID space will cause an error. To automatically resolve
these ID overlaps, ``auto_ids`` can be set to ``True`` to append the UWUW
material IDs to the OpenMC material ID space.

View file

@ -231,7 +231,7 @@ public:
std::pair<double, int32_t>
distance(Position r, Direction u, int32_t on_surface, Particle* p) const;
void to_hdf5_inner(hid_t group_id) const;
void to_hdf5_inner(hid_t group_id) const override;
BoundingBox bounding_box() const;

View file

@ -19,15 +19,14 @@ class UWUW;
namespace openmc {
class DAGSurface : public Surface
{
class DAGSurface : public Surface {
public:
DAGSurface();
double evaluate(Position r) const;
double distance(Position r, Direction u, bool coincident) const;
Direction normal(Position r) const;
Direction reflect(Position r, Direction u, Particle* p) const;
double evaluate(Position r) const override;
double distance(Position r, Direction u, bool coincident) const override;
Direction normal(Position r) const override;
Direction reflect(Position r, Direction u, Particle* p) const override;
inline void to_hdf5_inner(hid_t group_id) const override {};
@ -39,14 +38,14 @@ class DAGCell : public Cell {
public:
DAGCell();
bool contains(Position r, Direction u, int32_t on_surface) const;
bool contains(Position r, Direction u, int32_t on_surface) const override;
std::pair<double, int32_t>
distance(Position r, Direction u, int32_t on_surface, Particle* p) const;
distance(Position r, Direction u, int32_t on_surface, Particle* p) const override;
BoundingBox bounding_box() const;
BoundingBox bounding_box() const override;
void to_hdf5_inner(hid_t group_id) const;
void to_hdf5_inner(hid_t group_id) const override;
std::shared_ptr<moab::DagMC> dagmc_ptr_; //!< Pointer to DagMC instance
int32_t dag_index_; //!< DagMC index of cell
@ -98,7 +97,7 @@ public:
//! \return A string of the ID ranges for entities of dimension \p dim
std::string dagmc_ids_for_dim(int dim) const;
virtual bool find_cell(Particle &p) const override;
bool find_cell(Particle &p) const override;
// Data Members
std::string filename_; //!< Name of the DAGMC file used to create this universe

View file

@ -677,10 +677,9 @@ class DAGMCUniverse(UniverseBase):
self.auto_mat_ids = auto_mat_ids
def __repr__(self):
fmt_str = '{: <16}=\t{}\n'
string = super().__repr__()
string += fmt_str.format('\tGeom', 'DAGMC')
string += fmt_str.format('\tFile', self.filename)
string += '{: <16}=\t{}\n'.format('\tGeom', 'DAGMC')
string += '{: <16}=\t{}\n'.format('\tFile', self.filename)
return string
@property

View file

@ -386,7 +386,6 @@ Particle::cross_surface()
if (surf->geom_type_ != GeometryType::DAG) history().reset();
#endif
// Handle any applicable boundary conditions.
if (surf->bc_ && settings::run_mode != RunMode::PLOTTING) {
surf->bc_->handle_particle(*this, *surf);

View file

@ -204,8 +204,7 @@ Surface::to_hdf5(hid_t group_id) const
if (geom_type_ == GeometryType::DAG) {
write_string(surf_group, "geom_type", "dagmc", false);
}
else if (geom_type_ == GeometryType::CSG) {
} else if (geom_type_ == GeometryType::CSG) {
write_string(surf_group, "geom_type", "csg", false);
if (bc_) {

View file

@ -28,7 +28,7 @@ def model():
# geometry
dag_univ = openmc.DAGMCUniverse("dagmc.h5m")
model.geometry = openmc.Geometry(root=dag_univ)
model.geometry = openmc.Geometry(dag_univ)
# tally
tally = openmc.Tally()

View file

@ -29,7 +29,7 @@ class UWUWTest(PyAPITestHarness):
# geometry
dag_univ = openmc.DAGMCUniverse("dagmc.h5m", auto_geom_ids=True)
model.geometry = openmc.Geometry(root=dag_univ)
model.geometry = openmc.Geometry(dag_univ)
# tally
tally = openmc.Tally()

View file

@ -55,7 +55,7 @@ class DAGMCUniverseTest(PyAPITestHarness):
bounding_cell = openmc.Cell(fill=pincell_univ, region=box)
model.geometry = openmc.Geometry(root=[bounding_cell])
model.geometry = openmc.Geometry([bounding_cell])
# settings
model.settings.particles = 100