mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 21:25:36 -04:00
Implementing a couple more methods for CAD surfaces.
This commit is contained in:
parent
28f04592a3
commit
da2a99b475
2 changed files with 20 additions and 4 deletions
|
|
@ -45,6 +45,14 @@ extern std::map<int, int> surface_map;
|
|||
|
||||
struct BoundingBox
|
||||
{
|
||||
|
||||
BoundingBox(double x_min, double x_max,
|
||||
double y_min, double y_max,
|
||||
double z_min, double z_max) :
|
||||
xmin(x_min), xmax(x_max),
|
||||
ymin(y_min), ymax(y_max),
|
||||
zmin(z_min), zmax(z_max) {}
|
||||
|
||||
double xmin;
|
||||
double xmax;
|
||||
double ymin;
|
||||
|
|
|
|||
|
|
@ -257,19 +257,27 @@ double CADSurface::evaluate(Position r) const
|
|||
}
|
||||
|
||||
double CADSurface::distance(Position p, Direction u, bool coincident) const {
|
||||
return 0.0;
|
||||
moab::EntityHandle surf = dagmc_ptr->entity_by_id(2, id);
|
||||
moab::EntityHandle hit_surf;
|
||||
double dist;
|
||||
dagmc_ptr->ray_fire(surf, p.xyz, u.xyz, hit_surf, dist, NULL, 0, 0);
|
||||
if (dist < 0.0) dist = INFTY;
|
||||
return dist;
|
||||
}
|
||||
|
||||
Direction CADSurface::normal(Position p) const {
|
||||
|
||||
Direction u;
|
||||
moab::EntityHandle surf = dagmc_ptr->entity_by_id(2, id);
|
||||
dagmc_ptr->get_angle(surf, p.xyz, u.xyz);
|
||||
return u;
|
||||
|
||||
}
|
||||
|
||||
BoundingBox CADSurface::bounding_box() const { return BoundingBox(); }
|
||||
BoundingBox CADSurface::bounding_box() const {
|
||||
moab::EntityHandle surf = dagmc_ptr->entity_by_id(2, id);
|
||||
double min[3], max[3];
|
||||
dagmc_ptr->getobb(surf, min, max);
|
||||
return BoundingBox(min[0], max[0], min[1], max[1], min[2], max[2]);
|
||||
}
|
||||
#endif
|
||||
//==============================================================================
|
||||
// PeriodicSurface implementation
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue