mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 05:05:30 -04:00
Updating CAD cell/surface methods to use new Position and Direction structs.
This commit is contained in:
parent
76660f7459
commit
2e4809c8d5
4 changed files with 21 additions and 14 deletions
|
|
@ -132,10 +132,10 @@ public:
|
|||
//! known to be on. This index takes precedence over surface sense
|
||||
//! calculations.
|
||||
virtual bool
|
||||
contains(const double xyz[3], const double uvw[3], int32_t on_surface) const = 0;
|
||||
contains(Position p, Direction u, int32_t on_surface) const = 0;
|
||||
|
||||
virtual std::pair<double, int32_t>
|
||||
distance(const double xyz[3], const double uvw[3], int32_t on_surface) const = 0;
|
||||
distance(Position p, Direction u, int32_t on_surface) const = 0;
|
||||
|
||||
//! Write all information needed to reconstruct the cell to an HDF5 group.
|
||||
//! @param group_id An HDF5 group id.
|
||||
|
|
@ -182,7 +182,6 @@ public:
|
|||
//! \param group_id An HDF5 group id.
|
||||
void to_hdf5(hid_t group_id) const;
|
||||
|
||||
|
||||
protected:
|
||||
bool contains_simple(Position r, Direction u, int32_t on_surface) const;
|
||||
bool contains_complex(Position r, Direction u, int32_t on_surface) const;
|
||||
|
|
@ -195,8 +194,8 @@ class CADCell : public Cell
|
|||
moab::DagMC *dagmc_ptr;
|
||||
explicit CADCell();
|
||||
|
||||
std::pair<double, int32_t> distance(const double xyz[3], const double uvw[3], int32_t on_surface) const;
|
||||
bool contains(const double xyz[3], const double uvw[3], int32_t on_surface) const;
|
||||
std::pair<double, int32_t> distance(Position p, Direction u, int32_t on_surface) const;
|
||||
bool contains(Position p, Direction u, int32_t on_surface) const;
|
||||
|
||||
void to_hdf5(hid_t group_id) const;
|
||||
|
||||
|
|
|
|||
|
|
@ -132,10 +132,10 @@ class CADSurface : public Surface
|
|||
public:
|
||||
moab::DagMC* dagmc_ptr;
|
||||
explicit CADSurface();
|
||||
double evaluate(const double xyz[3]) const;
|
||||
double distance(const double xyz[3], const double uvw[3],
|
||||
double evaluate(Position p) const;
|
||||
double distance(Position p, Direction u,
|
||||
bool coincident) const;
|
||||
void normal(const double xyz[3], double uvw[3]) const;
|
||||
Direction normal(Position p) const;
|
||||
//! Get the bounding box of this surface.
|
||||
BoundingBox bounding_box() const;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -597,8 +597,10 @@ CSGCell::contains_complex(Position r, Direction u, int32_t on_surface) const
|
|||
#ifdef CAD
|
||||
CADCell::CADCell() : Cell{} {};
|
||||
|
||||
std::pair<double, int32_t> CADCell::distance(const double xyz[3], const double uvw[3], int32_t on_surface) const {
|
||||
std::pair<double, int32_t> CADCell::distance(Position p, Direction u, int32_t on_surface) const {
|
||||
|
||||
double xyz[3] = {p.x, p.y, p.z};
|
||||
double uvw[3] = {u.x, u.y, u.z};
|
||||
moab::EntityHandle vol = dagmc_ptr->entity_by_id(3, id);
|
||||
moab::EntityHandle hit_surf;
|
||||
double dist;
|
||||
|
|
@ -611,7 +613,10 @@ std::pair<double, int32_t> CADCell::distance(const double xyz[3], const double u
|
|||
return result;
|
||||
}
|
||||
|
||||
bool CADCell::contains(const double xyz[3], const double uvw[3], int32_t on_surface) const {
|
||||
bool CADCell::contains(Position p, Direction u, int32_t on_surface) const {
|
||||
|
||||
double xyz[3] = {p.x, p.y, p.z};
|
||||
double uvw[3] = {u.x, u.y, u.z};
|
||||
moab::EntityHandle vol = dagmc_ptr->entity_by_id(3, id);
|
||||
|
||||
int result = 0;
|
||||
|
|
|
|||
|
|
@ -251,20 +251,23 @@ CSGSurface::to_hdf5(hid_t group_id) const
|
|||
#ifdef CAD
|
||||
CADSurface::CADSurface() :Surface{} {} // empty constructor
|
||||
|
||||
double CADSurface::evaluate(const double xyz[3]) const
|
||||
double CADSurface::evaluate(Position r) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
double CADSurface::distance(const double xyz[3], const double uvw[3], bool coincident) const {
|
||||
double CADSurface::distance(Position p, Direction u, bool coincident) const {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
void CADSurface::normal(const double xyz[3], double uvw[3]) const {
|
||||
Direction CADSurface::normal(Position p) const {
|
||||
|
||||
double xyz[3] = {p.x, p.y, p.z};
|
||||
double uvw[3];
|
||||
moab::EntityHandle surf = dagmc_ptr->entity_by_id(2, id);
|
||||
dagmc_ptr->get_angle(surf, xyz, uvw);
|
||||
return;
|
||||
Direction u = {uvw};
|
||||
return u;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue