Corrections after rebasing.

This commit is contained in:
Patrick Shriwise 2021-02-17 23:08:51 -06:00
parent c732e2ae88
commit 70cb36b474
3 changed files with 12 additions and 11 deletions

View file

@ -97,6 +97,7 @@ public:
int id_; //!< Unique ID
std::string name_; //!< User-defined name
std::shared_ptr<BoundaryCondition> bc_ {nullptr}; //!< 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);
@ -143,13 +144,13 @@ public:
//! Write all information needed to reconstruct the surface to an HDF5 group.
//! \param group_id An HDF5 group id.
virtual void to_hdf5(hid_t group_id) const = 0;
void to_hdf5(hid_t group_id) const;
//! Get the BoundingBox for this surface.
virtual BoundingBox bounding_box(bool /*pos_side*/) const { return {}; }
protected:
virtual void to_hdf5_inner(hid_t group_id) const = 0;
virtual void to_hdf5_inner(hid_t group_id) const = 0;
};
class CSGSurface : public Surface
@ -158,7 +159,8 @@ public:
explicit CSGSurface(pugi::xml_node surf_node);
CSGSurface();
void to_hdf5(hid_t group_id) const;
protected:
virtual void to_hdf5_inner(hid_t group_id) const = 0;
};
//==============================================================================

View file

@ -154,7 +154,7 @@ void read_dagmc_materials() {
std::stringstream ss;
ss << "<?xml version=\"1.0\"?>\n";
ss << "<materials>\n";
for (auto mat : mat_lib) { ss << mat.second.openmc("atom"); }
for (auto mat : mat_lib) { ss << mat.second->openmc("atom"); }
ss << "</materials>";
std::string mat_xml_string = ss.str();
@ -389,7 +389,7 @@ void DAGUniverse::initialize() {
std::string uwuw_mat = DMD.volume_material_property_data_eh[vol_handle];
if (uwuw.material_library.count(uwuw_mat) != 0) {
// Note: material numbers are set by UWUW
int mat_number = uwuw.material_library[uwuw_mat].metadata["mat_number"].asInt();
int mat_number = uwuw.material_library.get_material(uwuw_mat).metadata["mat_number"].asInt();
c->material_.push_back(mat_number);
} else {
fatal_error(fmt::format("Material with value {} not found in the "
@ -448,12 +448,11 @@ void DAGUniverse::initialize() {
std::string bc_value = DMD.get_surface_property("boundary", surf_handle);
to_lower(bc_value);
if (bc_value.empty() || bc_value == "transmit" || bc_value == "transmission") {
// set to transmission by default
s->bc_ = Surface::BoundaryType::TRANSMIT;
// set to transmission by default (nullptr)
} else if (bc_value == "vacuum") {
s->bc_ = Surface::BoundaryType::VACUUM;
s->bc_ = std::make_shared<VacuumBC>();
} else if (bc_value == "reflective" || bc_value == "reflect" || bc_value == "reflecting") {
s->bc_ = Surface::BoundaryType::REFLECT;
s->bc_ = std::make_shared<ReflectiveBC>();
} else if (bc_value == "periodic") {
fatal_error("Periodic boundary condition not supported in DAGMC.");
} else {
@ -469,7 +468,7 @@ void DAGUniverse::initialize() {
// if this surface belongs to the graveyard
if (graveyard && parent_vols.find(graveyard) != parent_vols.end()) {
// set graveyard surface BC's to vacuum
s->bc_ = Surface::BoundaryType::VACUUM;
s->bc_ = std::make_shared<VacuumBC>();
}
// add to global array and map

View file

@ -505,7 +505,7 @@ Particle::cross_reflective_bc(const Surface& surf, Direction new_u)
surface() = -surface();
#ifdef DAGMC
if (surf->geom_type_ != GeometryType::DAGMC) history_.reset();
if (surf.geom_type_ != GeometryType::DAG) history_.reset();
#endif
// If a reflective surface is coincident with a lattice or universe