diff --git a/docs/source/usersguide/geometry.rst b/docs/source/usersguide/geometry.rst index 4df3681a5..2b6a6fef2 100644 --- a/docs/source/usersguide/geometry.rst +++ b/docs/source/usersguide/geometry.rst @@ -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. diff --git a/include/openmc/cell.h b/include/openmc/cell.h index ad17b6f78..f04f9f6b7 100644 --- a/include/openmc/cell.h +++ b/include/openmc/cell.h @@ -231,7 +231,7 @@ public: std::pair 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; diff --git a/include/openmc/dagmc.h b/include/openmc/dagmc.h index 6e292488a..1369424e7 100644 --- a/include/openmc/dagmc.h +++ b/include/openmc/dagmc.h @@ -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 - 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 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 diff --git a/openmc/universe.py b/openmc/universe.py index 8a12d1160..d5d015eba 100644 --- a/openmc/universe.py +++ b/openmc/universe.py @@ -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 diff --git a/src/particle.cpp b/src/particle.cpp index 8abe2d9c6..6acd989fa 100644 --- a/src/particle.cpp +++ b/src/particle.cpp @@ -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); diff --git a/src/surface.cpp b/src/surface.cpp index 20aadc6e8..1de606198 100644 --- a/src/surface.cpp +++ b/src/surface.cpp @@ -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_) { diff --git a/tests/regression_tests/dagmc/legacy/test.py b/tests/regression_tests/dagmc/legacy/test.py index 76b76fbda..e0fccb934 100644 --- a/tests/regression_tests/dagmc/legacy/test.py +++ b/tests/regression_tests/dagmc/legacy/test.py @@ -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() diff --git a/tests/regression_tests/dagmc/refl/test.py b/tests/regression_tests/dagmc/refl/test.py index 2f4162b16..3fe41345c 100644 --- a/tests/regression_tests/dagmc/refl/test.py +++ b/tests/regression_tests/dagmc/refl/test.py @@ -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() diff --git a/tests/regression_tests/dagmc/universes/test.py b/tests/regression_tests/dagmc/universes/test.py index cc407aa5e..1458462c4 100644 --- a/tests/regression_tests/dagmc/universes/test.py +++ b/tests/regression_tests/dagmc/universes/test.py @@ -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