Moving the DAGUniverse into the DAGMC header file.

This commit is contained in:
Patrick Shriwise 2021-03-12 23:42:09 -06:00
parent 6af978efb9
commit 9fca1f690d
7 changed files with 37 additions and 45 deletions

View file

@ -471,15 +471,14 @@ successfully and that the model is `watertight
implementations of DAGMC geometry will support small volume overlaps and
un-merged surfaces.
Cell, Surface, and Material IDs
-------------------------------
Cell and Material IDs
---------------------
By default, DAGMC applies cell IDs defined by the CAD engine that the model
originated in. If these IDs overlap with ID's in the CSG cell ID space, this
will result in an error. However, the ``auto_ids`` property of a DAGMC universe
can be set to set DAGMC cell IDs by appending to the existing CSG cell ID space
in the OpenMC model.
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,
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.
Similar options exist for the material IDs of DAGMC models. If DAGMC material
assignments are based on natively defined OpenMC materials, no further work is

View file

@ -10,7 +10,6 @@
#include <gsl/gsl>
#include "hdf5.h"
#include "pugixml.hpp"
#include "dagmc.h"
#include "openmc/constants.h"
#include "openmc/memory.h" // for unique_ptr
@ -77,29 +76,6 @@ public:
unique_ptr<UniversePartitioner> partitioner_;
};
#ifdef DAGMC
class DAGUniverse : public Universe {
public:
explicit DAGUniverse(pugi::xml_node node);
explicit DAGUniverse(const std::string& filename, bool auto_ids = false);
void initialize(); //!< Sets up the DAGMC instance and OpenMC internals
std::map<int32_t, int32_t> read_uwuw_materials(); //!< Reads UWUW materials and returns an ID map
// Data Members
std::string filename_;
std::shared_ptr<moab::DagMC> dagmc_instance_; //! DAGMC Instance for this universe
int32_t cell_idx_offset_;
int32_t surf_idx_offset_;
bool adjust_ids_;
};
#endif
//==============================================================================
//==============================================================================
@ -372,6 +348,7 @@ void read_cells(pugi::xml_node node);
#ifdef DAGMC
class DAGUniverse;
int32_t next_cell(DAGUniverse* dag_univ, DAGCell* cur_cell, DAGSurface* surf_xed);
#endif

View file

@ -379,6 +379,15 @@ enum class RunMode {
// For non-accelerated regions on coarse mesh overlay
constexpr int CMFD_NOACCEL {-1};
//==============================================================================
// Geometry Constants
enum class GeometryType {
CSG,
DAG
};
} // namespace openmc
#endif // OPENMC_CONSTANTS_H

View file

@ -10,6 +10,7 @@ extern "C" const bool DAGMC_ENABLED;
#include "DagMC.hpp"
#include "openmc/cell.h"
#include "openmc/position.h"
#include "openmc/xml_interface.h"
@ -19,9 +20,24 @@ namespace model {
extern std::shared_ptr<moab::DagMC> DAG;
}
//==============================================================================
// Non-member functions
//==============================================================================
class DAGUniverse : public Universe {
public:
explicit DAGUniverse(pugi::xml_node node);
explicit DAGUniverse(const std::string& filename, bool auto_ids = false);
void initialize(); //!< Sets up the DAGMC instance and OpenMC internals
std::map<int32_t, int32_t> read_uwuw_materials(); //!< Reads UWUW materials and returns an ID map
// Data Members
std::string filename_;
std::shared_ptr<moab::DagMC> dagmc_instance_; //! DAGMC Instance for this universe
int32_t cell_idx_offset_;
int32_t surf_idx_offset_;
bool adjust_ids_;
};
void load_dagmc_geometry();
int32_t create_dagmc_universe(const std::string& filename);

View file

@ -29,15 +29,6 @@ namespace model {
extern vector<unique_ptr<Surface>> surfaces;
} // namespace model
//==============================================================================
// Constants
//==============================================================================
enum class GeometryType {
CSG,
DAG
};
//==============================================================================
//! Coordinates for an axis-aligned cube that bounds a geometric object.
//==============================================================================

View file

@ -22,7 +22,6 @@
#include "openmc/material.h"
#include "openmc/nuclide.h"
#include "openmc/settings.h"
#include "openmc/surface.h"
#include "openmc/xml_interface.h"
namespace openmc {

View file

@ -9,6 +9,7 @@
#include "openmc/capi.h"
#include "openmc/cell.h"
#include "openmc/constants.h"
#include "openmc/dagmc.h"
#include "openmc/error.h"
#include "openmc/geometry.h"
#include "openmc/hdf5_interface.h"