94 std::map<int, std::vector<Cell*>* > _neighbors;
97 Surface(
const int id=0,
const char* name=
"");
114 double getMin(
int axis,
int halfspace);
124 double getMax(
int axis,
int halfspace);
131 virtual double getMinX(
int halfspace) = 0;
138 virtual double getMaxX(
int halfspace) = 0;
145 virtual double getMinY(
int halfspace) = 0;
152 virtual double getMaxY(
int halfspace) = 0;
159 virtual double getMinZ(
int halfspace) = 0;
166 virtual double getMaxZ(
int halfspace) = 0;
168 void setName(
const char* name);
238 Plane(
const double A,
const double B,
const double C,
const double D,
239 const int id=0,
const char* name=
"");
271 XPlane(
const double x,
const int id=0,
const char* name=
"");
273 void setX(
const double x);
295 YPlane(
const double y,
const int id=0,
const char* name=
"");
297 void setY(
const double y);
319 ZPlane(
const double z,
const int id=0,
const char* name=
"");
321 void setZ(
const double z);
367 ZCylinder(
const double x,
const double y,
const double radius,
368 const int id=0,
const char* name=
"");
400 Point intersections[2];
403 int num_inters =
intersection(point, azim, polar, intersections);
404 double distance = INFINITY;
411 else if (num_inters == 2) {
432 double x = point->
getX();
433 double y = point->
getY();
434 double z = point->
getZ();
436 return (
_A * x +
_B * y +
_C * z +
_D);
445 return this->_radius;
455 double x = point->
getX();
456 double y = point->
getY();
457 return (
_A * x * x +
_B * y * y +
_C * x +
_D * y + _E);
double getMaxY(int halfspace)
Returns the maximum y value for one of this ZCylinder's halfspaces.
Definition: Surface.cpp:836
int surface_id()
Returns an auto-generated unique surface ID.
Definition: Surface.cpp:16
double _A
Definition: Surface.h:219
double getMaxX(int halfspace)
Returns the maximum x value for one of this XPlane's halfspaces.
Definition: Surface.cpp:556
surfaceType _surface_type
Definition: Surface.h:87
void setName(const char *name)
Sets the name of the Surface.
Definition: Surface.cpp:187
int intersection(Point *point, double azim, double polar, Point *points)
Finds the intersection Point with this Plane from a given Point and trajectory defined by an azim/pol...
Definition: Surface.cpp:450
Represents a Cell inside of a Universe.
Definition: Cell.h:56
double getMinX(int halfspace)
Returns the minimum x value for one of this ZCylinder's halfspaces.
Definition: Surface.cpp:797
double getB()
Returns the B coefficient multiplying y in the surface equation.
Definition: Surface.cpp:418
The LocalCoords represents a set of local coordinates on some level of nested Universes making up the...
Definition: LocalCoords.h:46
int _id
Definition: Surface.h:81
double getX()
Returns the location of the XPlane on the x-axis.
Definition: Surface.cpp:533
int getUid() const
Return the Surface's unique ID.
Definition: Surface.cpp:99
double getMinY(int halfspace)
Returns the minimum y value of -INFINITY.
Definition: Surface.cpp:370
ZCylinder(const double x, const double y, const double radius, const int id=0, const char *name="")
Constructor.
Definition: Surface.cpp:758
virtual double getMaxY(int halfspace)=0
Returns the maximum y value for one of this Surface's halfspaces.
surfaceType getSurfaceType()
Return the type of Surface (ie, XPLANE, ZYCLINDER, etc).
Definition: Surface.cpp:126
double getD()
Returns the D constant coefficient.
Definition: Surface.cpp:436
virtual ~Surface()
Destructor.
Definition: Surface.cpp:80
double getY() const
Returns this Point's y-coordinate.
Definition: Point.h:76
Represents a general Surface in 3D.
Definition: Surface.h:70
void maximize_surface_id(int surface_id)
Maximize the auto-generated unique Surface ID counter.
Definition: Surface.cpp:40
double getZ()
Returns the location of the ZPlane on the z-axis.
Definition: Surface.cpp:696
char * getName() const
Return the user-defined name of the Surface.
Definition: Surface.cpp:117
boundaryType
The types of boundary conditions supported by OpenMOC for Surfaces.
Definition: boundary_type.h:15
Math constants and comparision tolerances.
surfaceType
The types of surfaces supported by OpenMOC.
Definition: Surface.h:40
void setX(const double x)
Set the location of this XPlane on the x-axis.
Definition: Surface.cpp:523
std::string toString()
Converts this ZPlane's attributes to a character array.
Definition: Surface.cpp:735
double getMinY(int halfspace)
Returns the minimum y value for one of this YPlane's halfspaces.
Definition: Surface.cpp:625
double getMaxY(int halfspace)
Returns the maximum y value for one of this YPlane's halfspaces.
Definition: Surface.cpp:638
Represents a Plane perpendicular to the y-axis.
Definition: Surface.h:287
Class to represent a 2D/3D point in space.
Definition: Point.h:24
Represents a Plane perpendicular to the xy-plane.
Definition: Surface.h:214
std::string toString()
Converts this XPlane's attributes to a character array.
Definition: Surface.cpp:572
virtual std::string toString()=0
Converts this Surface's attributes to a character array.
std::string toString()
Converts this YPlane's attributes to a character array.
Definition: Surface.cpp:653
double getA()
Returns the A coefficient multiplying x in the surface equation.
Definition: Surface.cpp:409
virtual double getMaxZ(int halfspace)=0
Returns the maximum z value for one of this Surface's halfspaces.
double evaluate(const Point *point) const
Evaluate a Point using the ZCylinder's quadratic Surface equation.
Definition: Surface.h:454
virtual double getMaxX(int halfspace)=0
Returns the maximum x value for one of this Surface's halfspaces.
double getMaxZ(int halfspace)
Returns the maximum z value for one of this ZPlane's halfspaces.
Definition: Surface.cpp:719
double getMinDistance(Point *point, double azim, double polar)
Finds the minimum distance to a Surface.
Definition: Surface.h:397
double getX() const
Returns this Point's x-coordinate.
Definition: Point.h:67
double evaluate(const Point *point) const
Evaluate a Point using the Plane's quadratic Surface equation.
Definition: Surface.h:431
double getMaxY(int halfspace)
Returns the maximum y value of INFINITY.
Definition: Surface.cpp:380
char * _name
Definition: Surface.h:84
void setZ(const double z)
Set the location of this ZPlane on the z-axis.
Definition: Surface.cpp:686
boundaryType _boundary_type
Definition: Surface.h:91
double _C
Definition: Surface.h:225
double getMinZ(int halfspace)
Returns the minimum z value for one of this ZPlane's halfspaces.
Definition: Surface.cpp:706
int _uid
Definition: Surface.h:78
std::string toString()
Converts this Plane's attributes to a character array.
Definition: Surface.cpp:492
Represents a Cylinder with axis parallel to the z-axis.
Definition: Surface.h:335
double getMaxZ(int halfspace)
Returns the maximum z value of INFINITY.
Definition: Surface.cpp:859
void reset_surface_id()
Resets the auto-generated unique Surface ID counter to 1,000,000.
Definition: Surface.cpp:26
double getC()
Returns the C coefficient multiplying z in the surface equation.
Definition: Surface.cpp:427
double getMinZ(int halfspace)
Returns the minimum z value of -INFINITY.
Definition: Surface.cpp:390
void setY(const double y)
Set the location of this YPlane on the y-axis.
Definition: Surface.cpp:605
double getMinZ(int halfspace)
Returns the minimum z value of -INFINITY.
Definition: Surface.cpp:849
boundaryType getBoundaryType()
Returns the type of boundary conditions for this Surface (REFLECTIVE, VACUUM or BOUNDARY_NONE).
Definition: Surface.cpp:136
double getMaxX(int halfspace)
Returns the maximum x value of INFINITY.
Definition: Surface.cpp:360
ZPlane(const double z, const int id=0, const char *name="")
Constructor for a Plane perpendicular to the z-axis.
Definition: Surface.cpp:674
double _D
Definition: Surface.h:228
Plane(const double A, const double B, const double C, const double D, const int id=0, const char *name="")
Constructor.
Definition: Surface.cpp:333
int getId() const
Return the Surface's user-defined ID.
Definition: Surface.cpp:108
double distanceToPoint(const Point *point)
Compute the distance from this Point to another Point of interest.
Definition: Point.h:157
void setBoundaryType(const boundaryType boundary_type)
Sets the boundary condition type (ie, VACUUM or REFLECTIVE) for this Surface.
Definition: Surface.cpp:207
std::string toString()
Converts this ZCylinder's attributes to a character array.
Definition: Surface.cpp:1100
virtual double getMinY(int halfspace)=0
Returns the minimum y value for one of this Surface's halfspaces.
double getZ() const
Returns this Point's z-coordinate.
Definition: Point.h:85
virtual double getMinZ(int halfspace)=0
Returns the minimum z value for one of this Surface's halfspaces.
virtual double evaluate(const Point *point) const =0
Evaluate a Point using the Surface's potential equation.
XPlane(const double x, const int id=0, const char *name="")
Constructor for a Plane perpendicular to the x-axis.
Definition: Surface.cpp:511
double getY0()
Return the y-coordinate of the ZCylinder's center Point.
Definition: Surface.cpp:787
YPlane(const double y, const int id=0, const char *name="")
Constructor for a Plane perpendicular to the y-axis.
Definition: Surface.cpp:593
virtual double getMinX(int halfspace)=0
Returns the minimum x value for one of this Surface's halfspaces.
double getMinY(int halfspace)
Returns the minimum y value for one of this ZCylinder's halfspaces.
Definition: Surface.cpp:823
Represents a Plane perpendicular to the z-axis.
Definition: Surface.h:311
double getMinX(int halfspace)
Returns the minimum x value of -INFINITY.
Definition: Surface.cpp:350
double getMaxX(int halfspace)
Returns the maximum x value for one of this ZCylinder's halfspaces.
Definition: Surface.cpp:810
virtual int intersection(Point *point, double azim, double polar, Point *points)=0
Finds the intersection Point with this Surface from a given Point and trajectory defined by an angle...
double getX0()
Return the x-coordinate of the ZCylinder's center Point.
Definition: Surface.cpp:778
Represents a Plane perpendicular to the x-axis.
Definition: Surface.h:263
double getMinX(int halfspace)
Returns the minimum x value for one of this XPlane's halfspaces.
Definition: Surface.cpp:543
int intersection(Point *point, double azim, double polar, Point *points)
Finds the intersection Point with this zcylinder from a given Point and trajectory defined by an azim...
Definition: Surface.cpp:873
double getY()
Returns the location of the YPlane on the y-axis.
Definition: Surface.cpp:615
double getMin(int axis, int halfspace)
Returns the minimum coordinate in the axis direction of the space defined by halfspace and this surfa...
Definition: Surface.cpp:148
double getMax(int axis, int halfspace)
Returns the maximum coordinate in the axis direction of the space defined by halfspace and this surfa...
Definition: Surface.cpp:169
bool isCoordOnSurface(LocalCoords *coord)
Return true or false if a LocalCoord is on or off of a Surface.
Definition: Surface.cpp:269
Surface(const int id=0, const char *name="")
Constructor assigns unique ID and user-defined ID for a Surface.
Definition: Surface.cpp:53
bool isPointOnSurface(Point *point)
Return true or false if a Point is on or off of a Surface.
Definition: Surface.cpp:254
void printString()
Prints a string representation of all of the Surface's objects to the console.
Definition: Surface.cpp:319
double _B
Definition: Surface.h:222
static int _n
Definition: Surface.h:75
double getMaxZ(int halfspace)
Returns the maximum z value of INFINITY.
Definition: Surface.cpp:400
void addNeighborCell(int halfspace, Cell *cell)
Adds a neighbor Cell to this Surface's collection of neighbors.
Definition: Surface.cpp:217
double getRadius()
Return the radius of the ZCylinder.
Definition: Surface.h:444