A monte carlo pin cell spectral code for nuclear engineering applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
ZCylinder Class Reference

The ZCylinder is the locus of a point equidistant from a fixed point. More...

#include "pinspec/src/Surface.h"

Inheritance diagram for ZCylinder:
Surface

Public Member Functions

 ZCylinder (const char *surface_name=(char *)"")
 The ZCylinder constructor. More...
 
virtual ~ZCylinder ()
 ZCylinder destructor.
 
float getX0 ()
 Returns the x-coordinate of the cylinder's center. More...
 
float getY0 ()
 Returns the y-coordinate of the cylinder's center. More...
 
float getRadius ()
 Returns the radius of the cylinder. More...
 
void setX0 (float x0)
 Sets the x-coordinate of the cylinder's center. More...
 
void setY0 (float y0)
 Sets the y-coordinate of the cylinder's center. More...
 
void setRadius (float r)
 Sets the radius of the cylinder's center. More...
 
float evaluate (neutron *neutron)
 Returns the evaluation of a neutron's coordinates $ (x,y) $ with respect to the quadratic surface representing this cylinder: $ f(x,y) = (x - x_0)^2 + (y - y_0)^2 - R^2 $. More...
 
float evaluate (float x, float y, float z)
 Returns the evaluation of a neutron's coordinates $ (x,y,z) $ with respect to the quadratic surface representing this cylinder: $ f(x,y,z) = (x - x_0)^2 + (y - y_0)^2 - R^2 $. More...
 
float computeParametrizedDistance (neutron *neutron)
 Computes the parametrized distance to the ZCylinder along a neutron's trajectory. More...
 
bool onSurface (neutron *neutron)
 Checks whether a neutron is on the ZCylinder. More...
 
void reflectNeutron (neutron *neutron)
 Perfectly reflects a neutron at a cylinder. More...
 
- Public Member Functions inherited from Surface
 Surface (const char *surface_name=(char *)"")
 Surface class constructor. More...
 
virtual ~Surface ()
 Surface destructor.
 
char * getSurfaceName ()
 Return the name of the surface. More...
 
int getUid () const
 Returns the unique ID auto-generated for the surface. More...
 
boundaryType getBoundaryType () const
 Returns this surface's boundary type. More...
 
surfaceType getSurfaceType () const
 Returns this surface's type (XPLANE, YPLANE, CIRCLE, etc.) More...
 
void setBoundaryType (boundaryType type)
 Sets the boundary type for this Surface. More...
 

Protected Attributes

float _r
 
float _r_squared
 
float _x0
 
float _y0
 
- Protected Attributes inherited from Surface
char * _surface_name
 
int _uid
 
surfaceType _surface_type
 
boundaryType _boundary_type
 

Additional Inherited Members

- Static Protected Attributes inherited from Surface
static int _n = 1
 

Detailed Description

The ZCylinder is the locus of a point equidistant from a fixed point.

The ZCylinder represents a set of points within a given distance from a point in the xy-plane called the cylinder's center.

Constructor & Destructor Documentation

ZCylinder::ZCylinder ( const char *  surface_name = (char*)"")

The ZCylinder constructor.

Parameters
surface_namethe (optional) name of the surface

Assigns default values for the center of the cylinder (x=0, y=0) and a radius of 0.

Member Function Documentation

float ZCylinder::computeParametrizedDistance ( neutron neutron)
virtual

Computes the parametrized distance to the ZCylinder along a neutron's trajectory.

The distance returned is a parametrized distance along the unit vectory defining the neutron's trajectory, not a Cartesian distance. If the neutron is traveling away from the surface then the distance returned will be infinity. This method solves a quadratic equation for 0, 1, or 2 surface intersection points and selects the one nearest to the neutron.

Parameters
neutrona pointer to a neutron struct
Returns
the parametrized distance to the surface along the neutron's trajectory

Implements Surface.

float ZCylinder::evaluate ( neutron neutron)
virtual

Returns the evaluation of a neutron's coordinates $ (x,y) $ with respect to the quadratic surface representing this cylinder: $ f(x,y) = (x - x_0)^2 + (y - y_0)^2 - R^2 $.

Parameters
neutronthe neutron of interest

Implements Surface.

float ZCylinder::evaluate ( float  x,
float  y,
float  z 
)
virtual

Returns the evaluation of a neutron's coordinates $ (x,y,z) $ with respect to the quadratic surface representing this cylinder: $ f(x,y,z) = (x - x_0)^2 + (y - y_0)^2 - R^2 $.

Parameters
xthe x-coordinate of interest
ythe y-coordinate of interest
zthe z-coordinate of interest

Implements Surface.

float ZCylinder::getRadius ( )

Returns the radius of the cylinder.

Returns
the cylinder radius
float ZCylinder::getX0 ( )

Returns the x-coordinate of the cylinder's center.

Returns
the x-coordinate of the cylinder center
float ZCylinder::getY0 ( )

Returns the y-coordinate of the cylinder's center.

Returns
the y-coordinate of the cylinder center
bool ZCylinder::onSurface ( neutron neutron)
virtual

Checks whether a neutron is on the ZCylinder.

The threshold used to compute whether or not a neutron is on the on the neutron is 1E-6 for the difference between the distance between the neutron and the cylinder center and the radius of the cylinder.

Parameters
neutronthe neutron of interest
Returns
true if on the XPlane, otherwise false

Implements Surface.

void ZCylinder::reflectNeutron ( neutron neutron)
virtual

Perfectly reflects a neutron at a cylinder.

Parameters
neutronthe neutron of interest

Implements Surface.

void ZCylinder::setRadius ( float  r)

Sets the radius of the cylinder's center.

Parameters
rthe cylinder's radius
void ZCylinder::setX0 ( float  x0)

Sets the x-coordinate of the cylinder's center.

Parameters
x0the x-coordinate of the cylinder center
void ZCylinder::setY0 ( float  y0)

Sets the y-coordinate of the cylinder's center.

Parameters
y0the y-coordinate of the cylinder center

Member Data Documentation

float ZCylinder::_r
protected

The cylinder's radius

float ZCylinder::_r_squared
protected

The square of the cylinder's radius

float ZCylinder::_x0
protected

The x-coordinate of the cylinder's center

float ZCylinder::_y0
protected

The y-coordinate of the cylinder's center


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