An open source method of characteristics neutron transport code.
Surface Class Referenceabstract

Represents a general Surface in 3D. More...

#include "src/Surface.h"

Public Member Functions

 Surface (const int id=0, const char *name="")
 Constructor assigns unique ID and user-defined ID for a Surface. More...
 
virtual ~Surface ()
 Destructor.
 
int getUid () const
 Return the Surface's unique ID. More...
 
int getId () const
 Return the Surface's user-defined ID. More...
 
char * getName () const
 Return the user-defined name of the Surface. More...
 
surfaceType getSurfaceType ()
 Return the type of Surface (ie, XPLANE, ZYCLINDER, etc). More...
 
boundaryType getBoundaryType ()
 Returns the type of boundary conditions for this Surface (REFLECTIVE, VACUUM or BOUNDARY_NONE). More...
 
double getMin (int axis, int halfspace)
 Returns the minimum coordinate in the axis direction of the space defined by halfspace and this surface. More...
 
double getMax (int axis, int halfspace)
 Returns the maximum coordinate in the axis direction of the space defined by halfspace and this surface. More...
 
virtual double getMinX (int halfspace)=0
 Returns the minimum x value for one of this Surface's halfspaces. More...
 
virtual double getMaxX (int halfspace)=0
 Returns the maximum x value for one of this Surface's halfspaces. More...
 
virtual double getMinY (int halfspace)=0
 Returns the minimum y value for one of this Surface's halfspaces. More...
 
virtual double getMaxY (int halfspace)=0
 Returns the maximum y value for one of this Surface's halfspaces. More...
 
virtual double getMinZ (int halfspace)=0
 Returns the minimum z value for one of this Surface's halfspaces. More...
 
virtual double getMaxZ (int halfspace)=0
 Returns the maximum z value for one of this Surface's halfspaces. More...
 
void setName (const char *name)
 Sets the name of the Surface. More...
 
void setBoundaryType (const boundaryType boundary_type)
 Sets the boundary condition type (ie, VACUUM or REFLECTIVE) for this Surface. More...
 
void addNeighborCell (int halfspace, Cell *cell)
 Adds a neighbor Cell to this Surface's collection of neighbors. More...
 
virtual double evaluate (const Point *point) const =0
 Evaluate a Point using the Surface's potential equation. More...
 
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. More...
 
bool isPointOnSurface (Point *point)
 Return true or false if a Point is on or off of a Surface. More...
 
bool isCoordOnSurface (LocalCoords *coord)
 Return true or false if a LocalCoord is on or off of a Surface. More...
 
double getMinDistance (Point *point, double azim, double polar)
 Finds the minimum distance to a Surface. More...
 
double getMinDistance (LocalCoords *coord)
 Finds the minimum distance to a Surface. More...
 
virtual std::string toString ()=0
 Converts this Surface's attributes to a character array. More...
 
void printString ()
 Prints a string representation of all of the Surface's objects to the console.
 

Protected Attributes

int _uid
 
int _id
 
char * _name
 
surfaceType _surface_type
 
boundaryType _boundary_type
 
std::map< int, std::vector< Cell * > *> _neighbors
 

Static Protected Attributes

static int _n = 0
 

Detailed Description

Represents a general Surface in 3D.

The Surface class and its subclasses are used to define the geometry for an OpenMOC simulation using a constructive solid geometry (CSG) formalism. Surfaces are used during ray tracing of charateristic tracks across the geometry.

Constructor & Destructor Documentation

◆ Surface()

Surface::Surface ( const int  id = 0,
const char *  name = "" 
)

Constructor assigns unique ID and user-defined ID for a Surface.

Assigns a default boundary condition for this Surface to BOUNDARY_NONE.

Parameters
idan optional user-defined Surface ID
namean optional user-defined Surface name

Member Function Documentation

◆ addNeighborCell()

void Surface::addNeighborCell ( int  halfspace,
Cell cell 
)

Adds a neighbor Cell to this Surface's collection of neighbors.

Parameters
halfspacethe +/-1 halfspace for the neighboring Cell
cella pointer to the neighboring Cell

◆ evaluate()

virtual double Surface::evaluate ( const Point point) const
pure virtual

Evaluate a Point using the Surface's potential equation.

This method returns the values $ f(x,y) $ for the potential function $f$ representing this Surface.

Parameters
pointa pointer to the Point of interest
Returns
the value of Point in the Plane's potential equation.

Implemented in ZCylinder, and Plane.

◆ getBoundaryType()

boundaryType Surface::getBoundaryType ( )

Returns the type of boundary conditions for this Surface (REFLECTIVE, VACUUM or BOUNDARY_NONE).

Returns
the boundary condition type for this Surface

◆ getId()

int Surface::getId ( ) const

Return the Surface's user-defined ID.

Returns
the Surface's user-defined ID

◆ getMax()

double Surface::getMax ( int  axis,
int  halfspace 
)

Returns the maximum coordinate in the axis direction of the space defined by halfspace and this surface.

Returns the maximum coordinate in the axis direction of the surface.

Parameters
axisThe axis of interest (0 = x, 1 = y, 2 = z)
halfspacethe halfspace to consider
Returns
the maximum coordinate in the axis direction

◆ getMaxX()

virtual double Surface::getMaxX ( int  halfspace)
pure virtual

Returns the maximum x value for one of this Surface's halfspaces.

Parameters
halfspacethe halfspace of the Surface to consider
Returns
the maximum x value

Implemented in ZCylinder, XPlane, and Plane.

◆ getMaxY()

virtual double Surface::getMaxY ( int  halfspace)
pure virtual

Returns the maximum y value for one of this Surface's halfspaces.

Parameters
halfspacethe halfspace of the Surface to consider
Returns
the maximum y value

Implemented in ZCylinder, YPlane, and Plane.

◆ getMaxZ()

virtual double Surface::getMaxZ ( int  halfspace)
pure virtual

Returns the maximum z value for one of this Surface's halfspaces.

Parameters
halfspacethe halfspace of the Surface to consider
Returns
the maximum z value

Implemented in ZCylinder, ZPlane, and Plane.

◆ getMin()

double Surface::getMin ( int  axis,
int  halfspace 
)

Returns the minimum coordinate in the axis direction of the space defined by halfspace and this surface.

Returns the minimum coordinate in the axis direction of the surface.

Parameters
axisThe axis of interest (0 = x, 1 = y, 2 = z)
halfspacethe halfspace to consider
Returns
the minimum coordinate in the axis direction

◆ getMinDistance() [1/2]

double Surface::getMinDistance ( Point point,
double  azim,
double  polar 
)
inline

Finds the minimum distance to a Surface.

Finds the minimum distance to a Surface from a Point with a given trajectory defined by an azim/polar to this Surface. If the trajectory will not intersect the Surface, returns INFINITY.

Parameters
pointa pointer to the Point of interest
azimthe azimuthal angle defining the trajectory in radians
polarthe polar angle defining the trajectory in radians
Returns
the minimum distance to the Surface

◆ getMinDistance() [2/2]

double Surface::getMinDistance ( LocalCoords coords)

Finds the minimum distance to a Surface.

Finds the miniumum distance to a Surface from a LocalCoords with a trajectory defined by an angle to this Surface. If the trajectory will not intersect the Surface, returns INFINITY.

Parameters
coordsa pointer to a localcoords object
Returns
the minimum distance to the Surface

◆ getMinX()

virtual double Surface::getMinX ( int  halfspace)
pure virtual

Returns the minimum x value for one of this Surface's halfspaces.

Parameters
halfspacethe halfspace of the Surface to consider
Returns
the minimum x value

Implemented in ZCylinder, XPlane, and Plane.

◆ getMinY()

virtual double Surface::getMinY ( int  halfspace)
pure virtual

Returns the minimum y value for one of this Surface's halfspaces.

Parameters
halfspacethe halfspace of the Surface to consider
Returns
the minimum y value

Implemented in ZCylinder, YPlane, and Plane.

◆ getMinZ()

virtual double Surface::getMinZ ( int  halfspace)
pure virtual

Returns the minimum z value for one of this Surface's halfspaces.

Parameters
halfspacethe halfspace of the Surface to consider
Returns
the minimum z value

Implemented in ZCylinder, ZPlane, and Plane.

◆ getName()

char * Surface::getName ( ) const

Return the user-defined name of the Surface.

Returns
the Surface name

◆ getSurfaceType()

surfaceType Surface::getSurfaceType ( )

Return the type of Surface (ie, XPLANE, ZYCLINDER, etc).

Returns
the Surface type

◆ getUid()

int Surface::getUid ( ) const

Return the Surface's unique ID.

Returns
the Surface's unique ID

◆ intersection()

virtual int Surface::intersection ( Point point,
double  azim,
double  polar,
Point points 
)
pure virtual

Finds the intersection Point with this Surface from a given Point and trajectory defined by an angle.

Parameters
pointpointer to the Point of interest
azimthe azimuthal angle (in radians)
polarthe polar angle (in radians)
pointsarray of Points to store the intersection locations
Returns
the number of intersection Points (0 or 1)

Implemented in ZCylinder, and Plane.

◆ isCoordOnSurface()

bool Surface::isCoordOnSurface ( LocalCoords coord)

Return true or false if a LocalCoord is on or off of a Surface.

Parameters
coordpointer to the LocalCoord of interest
Returns
on (true) or off (false) the Surface

◆ isPointOnSurface()

bool Surface::isPointOnSurface ( Point point)

Return true or false if a Point is on or off of a Surface.

Parameters
pointpointer to the Point of interest
Returns
on (true) or off (false) the Surface

◆ setBoundaryType()

void Surface::setBoundaryType ( const boundaryType  boundary_type)

Sets the boundary condition type (ie, VACUUM or REFLECTIVE) for this Surface.

Parameters
boundary_typethe boundary condition type for this Surface

◆ setName()

void Surface::setName ( const char *  name)

Sets the name of the Surface.

Parameters
namethe Surface name string

◆ toString()

virtual std::string Surface::toString ( )
pure virtual

Converts this Surface's attributes to a character array.

The character array returned conatins the type of Surface (ie, PLANE) and the coefficients in the potential equation.

Returns
a character array of this Surface's attributes

Implemented in ZCylinder, ZPlane, YPlane, XPlane, and Plane.

Member Data Documentation

◆ _boundary_type

boundaryType Surface::_boundary_type
protected

The type of boundary condition to be used for this Surface (ie, VACUUM or REFLECTIVE)

◆ _id

int Surface::_id
protected

A user-defined id for each Surface created

◆ _n

int Surface::_n = 0
staticprotected

A static counter for the number of Surfaces in a simulation

◆ _name

char* Surface::_name
protected

A user-defined name for the Surface

◆ _surface_type

surfaceType Surface::_surface_type
protected

The type of Surface (ie, XPLANE, ZCYLINDER, etc)

◆ _uid

int Surface::_uid
protected

A monotonically increasing unique ID for each Surface created


The documentation for this class was generated from the following files: