18 #define PI_OVER_TWO 1.57079633
20 #define THREE_PI_OVER_TWO 4.71238898
22 #define TWO_PI 6.28318531
24 #define TINY_MOVE 1E-5
86 Surface(
const char* surface_name=(
char*)
"");
112 virtual float evaluate(
float x,
float y,
float z) =0;
154 XPlane(
const char* surface_name=(
char*)
"");
159 float evaluate(
float x,
float y,
float z);
177 YPlane(
const char* surface_name=(
char*)
"");
182 float evaluate(
float x,
float y,
float z);
206 ZCylinder(
const char* surface_name=(
char*)
"");
211 void setX0(
float x0);
212 void setY0(
float y0);
215 float evaluate(
float x,
float y,
float z);
virtual float evaluate(neutron *neutron)=0
Returns the evaluation of a neutron's coordinates with respect to a quadratic surface ...
float _r_squared
Definition: Surface.h:200
Represents a neutron in a PINSPEC simulation.
Definition: Neutron.h:27
surfaceType _surface_type
Definition: Surface.h:82
void setY0(float y0)
Sets the y-coordinate of the cylinder's center.
Definition: Surface.cpp:385
float computeParametrizedDistance(neutron *neutron)
Computes the parametrized distance to the XPlane along a neutron's trajectory.
Definition: Surface.cpp:155
void setY(float y)
Sets the x-coordinate of the plane's intersection point with the y-axis.
Definition: Surface.cpp:234
YPlane(const char *surface_name=(char *)"")
The YPlane constructor.
Definition: Surface.cpp:207
surfaceType getSurfaceType() const
Returns this surface's type (XPLANE, YPLANE, CIRCLE, etc.)
Definition: Surface.cpp:47
surfaceTypes
Bounding surface types.
Definition: Surface.h:36
virtual ~Surface()
Surface destructor.
Definition: Surface.cpp:22
virtual ~YPlane()
YPlane destructor.
Definition: Surface.cpp:215
The Surface represents a quadratic surface in the xy-plane.
Definition: Surface.h:73
void reflectNeutron(neutron *neutron)
Perfectly reflects a neutron at a cylinder.
Definition: Surface.cpp:519
bool onSurface(neutron *neutron)
Checks whether a neutron is on the YPlane.
Definition: Surface.cpp:303
float _y
Definition: Surface.h:175
char * _surface_name
Definition: Surface.h:76
float getY0()
Returns the y-coordinate of the cylinder's center.
Definition: Surface.cpp:358
enum surfaceTypes surfaceType
Bounding surface type.
virtual ~XPlane()
XPlane destructor.
Definition: Surface.cpp:91
void setX0(float x0)
Sets the x-coordinate of the cylinder's center.
Definition: Surface.cpp:376
void setX(float x)
Sets the x-coordinate of the plane's intersection point with the x-axis.
Definition: Surface.cpp:109
void reflectNeutron(neutron *neutron)
Perfectly reflects a neutron at a xplane.
Definition: Surface.cpp:191
The YPlane is a a plane perpendicular to the y-axis.
Definition: Surface.h:172
float evaluate(neutron *neutron)
Returns the evaluation of a neutron's coordinates with respect to the quadratic surface representing...
Definition: Surface.cpp:406
virtual bool onSurface(neutron *neutron)=0
Determines whether or not a neutron at some location is on the surface.
virtual void reflectNeutron(neutron *neutron)=0
Perfectly reflects a neutron at the surface for REFLECTIVE boundary conditions.
bool onSurface(neutron *neutron)
Checks whether a neutron is on the XPlane.
Definition: Surface.cpp:179
virtual ~ZCylinder()
ZCylinder destructor.
Definition: Surface.cpp:342
char * getSurfaceName()
Return the name of the surface.
Definition: Surface.cpp:29
float getX0()
Returns the x-coordinate of the cylinder's center.
Definition: Surface.cpp:349
void reflectNeutron(neutron *neutron)
Perfectly reflects a neutron at a yplane.
Definition: Surface.cpp:316
float computeParametrizedDistance(neutron *neutron)
Computes the parametrized distance to the YPlane along a neutron's trajectory.
Definition: Surface.cpp:279
boundaryType _boundary_type
Definition: Surface.h:84
int _uid
Definition: Surface.h:80
The ZCylinder is the locus of a point equidistant from a fixed point.
Definition: Surface.h:195
void setBoundaryType(boundaryType type)
Sets the boundary type for this Surface.
Definition: Surface.cpp:69
float _x
Definition: Surface.h:152
int getUid() const
Returns the unique ID auto-generated for the surface.
Definition: Surface.cpp:38
boundaryTypes
Boundary condition types.
Definition: Surface.h:55
bool onSurface(neutron *neutron)
Checks whether a neutron is on the ZCylinder.
Definition: Surface.cpp:503
float _r
Definition: Surface.h:198
float getRadius()
Returns the radius of the cylinder.
Definition: Surface.cpp:367
XPlane(const char *surface_name=(char *)"")
The XPlane constructor.
Definition: Surface.cpp:83
virtual float computeParametrizedDistance(neutron *neutron)=0
Computes the parametrized distance between a neutron at some location with some trajectory and this s...
Utility functions for commonly used vector operations.
float evaluate(neutron *neutron)
Returns the evaluation of a neutron's coordinates with respect to the quadratic surface representing...
Definition: Surface.cpp:120
float getX()
Returns the x-coordinate of the plane's intersection point with the x-axis.
Definition: Surface.cpp:99
ZCylinder(const char *surface_name=(char *)"")
The ZCylinder constructor.
Definition: Surface.cpp:331
float _x0
Definition: Surface.h:202
The XPlane is a plane perpendicular to the y-axis.
Definition: Surface.h:149
Surface(const char *surface_name=(char *)"")
Surface class constructor.
Definition: Surface.cpp:11
boundaryType getBoundaryType() const
Returns this surface's boundary type.
Definition: Surface.cpp:58
Utility functions for writing log messages to the screen.
float computeParametrizedDistance(neutron *neutron)
Computes the parametrized distance to the ZCylinder along a neutron's trajectory. ...
Definition: Surface.cpp:439
void setRadius(float r)
Sets the radius of the cylinder's center.
Definition: Surface.cpp:394
float _y0
Definition: Surface.h:204
enum boundaryTypes boundaryType
Boundary condition type.
static int _n
Definition: Surface.h:78
float evaluate(neutron *neutron)
Returns the evaluation of a neutron's coordinates with respect to the quadratic surface representing...
Definition: Surface.cpp:245
float getY()
Returns the y-coordinate of the plane's intersection point with the y-axis.
Definition: Surface.cpp:224