An open source method of characteristics neutron transport code.
Track Class Reference

A Track represents a characteristic line across the geometry. More...

#include "src/Track.h"

Public Member Functions

 Track ()
 Constructor initializes an empty Track.
 
virtual ~Track ()
 Destructor clears the Track segments container.
 
virtual void setValues (const double start_x, const double start_y, const double end_x, const double end_y, const double phi)
 Set the values for the Track's start and end point and angle. More...
 
virtual void setCoords (double x0, double y0, double x1, double y1)
 Set the values for the Track's start and end point. More...
 
void setUid (int uid)
 Initializes a Track's unique ID. More...
 
void setPhi (const double phi)
 Set the Track's azimuthal angle. More...
 
void setBCFwd (const boundaryType bc_fwd)
 Sets the boundary condition for the incoming flux along the Track's "forward" direction. More...
 
void setBCBwd (const boundaryType bc_bwd)
 Sets the boundary condition for the incoming flux along the Track's "reverse" direction. More...
 
void setTrackNextFwd (long track_id)
 Set a pointer to the reflective Track in the forward direction. More...
 
void setTrackNextBwd (long track_id)
 Set a pointer to the reflective Track in the backward direction. More...
 
void setTrackPrdcFwd (long track_id)
 Set a pointer to the periodic Track in the forward direction. More...
 
void setTrackPrdcBwd (long track_id)
 Set a pointer to the periodic Track in the backward direction. More...
 
void setTrackReflFwd (long track_id)
 Set a pointer to the reflective Track in the forward direction. More...
 
void setTrackReflBwd (long track_id)
 Set a pointer to the reflective Track in the backward direction. More...
 
void setNextFwdFwd (bool fwd)
 Set whether the reflective track in the forward direction is pointing in forward direction. More...
 
void setNextBwdFwd (bool fwd)
 Set whether the reflective track in the backward direction is pointing in forward direction. More...
 
void setXYIndex (int index)
 Set the xy index of this Track. More...
 
void setAzimIndex (int index)
 Set a Track's azimuthal angle index. More...
 
void setSurfaceIn (int surface_in)
 Set the surface at which the Track starts. More...
 
void setSurfaceOut (int surface_out)
 Set the surface at which the Track ends. More...
 
void setDomainFwd (int neighbor)
 Set the domain at the end of the Track in the forward direction. More...
 
void setDomainBwd (int neighbor)
 Set the domain at the end of the Track in the backward direction. More...
 
void setLinkIndex (int index)
 Set a Track's link index. More...
 
int getUid ()
 Return the Track's unique ID. More...
 
PointgetEnd ()
 Returns a pointer to the Track's end Point. More...
 
PointgetStart ()
 Returns a pointer to the Track's start Point. More...
 
double getPhi () const
 Return the Track's azimuthal angle (with respect to the x-axis). More...
 
double getLength ()
 Return the Track's length. More...
 
long getTrackNextFwd ()
 Get a pointer to the reflective Track in the forward direction. More...
 
long getTrackNextBwd ()
 Get a pointer to the reflective Track in the backward direction. More...
 
long getTrackPrdcFwd ()
 Get a pointer to the periodic Track in the forward direction. More...
 
long getTrackPrdcBwd ()
 Get a pointer to the periodic Track in the backward direction. More...
 
long getTrackReflFwd ()
 Get a pointer to the reflective Track in the forward direction. More...
 
long getTrackReflBwd ()
 Get a pointer to the reflective Track in the backward direction. More...
 
bool getNextFwdFwd ()
 Get whether the reflective track in the forward direction is pointing in forward direction. More...
 
bool getNextBwdFwd ()
 Get whether the reflective track in the backward direction is pointing in forward direction. More...
 
int getXYIndex ()
 Get the xy index of this Track. More...
 
int getAzimIndex ()
 Get a Track's azimuthal angle index. More...
 
int getLinkIndex ()
 Get a Track's link index. More...
 
boundaryType getBCFwd () const
 Returns the boundary condition for the flux along the Track's "forward" direction. More...
 
boundaryType getBCBwd () const
 Returns the boundary condition for the flux along the Track's "reverse" direction. More...
 
segmentgetSegment (int s)
 Returns a pointer to a segment with a given index. More...
 
segmentgetSegments ()
 Returns a vector of pointers to the Track's segments. More...
 
int getNumSegments ()
 Return the number of segments along this Track. More...
 
int getDomainFwd ()
 Get the domain connected at the front end of the Track. More...
 
int getDomainBwd ()
 Get the domain connected at the back end of the Track. More...
 
int getSurfaceIn ()
 Get the surface from which the track originates in the domain. More...
 
int getSurfaceOut ()
 Get the surface at which the Track ends in the domain. More...
 
void addSegment (segment *segment)
 Adds a segment to this Track's list of segments. More...
 
void removeSegment (int index)
 Removes a segment from this Track's list of segments. More...
 
void insertSegment (int index, segment *segment)
 Inserts a segment struct into this Track's list of segments. More...
 
void clearSegments ()
 Deletes each of this Track's segments.
 
void setNumSegments (int num_segments)
 Sets the number of segments in a track. More...
 
virtual std::string toString ()
 Convert this Track's attributes to a character array. More...
 

Protected Attributes

int _uid
 
Point _start
 
Point _end
 
double _phi
 
std::vector< segment_segments
 
int _num_segments
 
boundaryType _bc_fwd
 
boundaryType _bc_bwd
 
int _azim_index
 
int _xy_index
 
int _link_index
 
long _track_next_fwd
 
long _track_next_bwd
 
long _track_prdc_fwd
 
long _track_prdc_bwd
 
long _track_refl_fwd
 
long _track_refl_bwd
 
bool _next_fwd_fwd
 
bool _next_bwd_fwd
 
bool _direction_in_cycle
 
int _surface_in
 
int _surface_out
 
int _domain_fwd
 
int _domain_bwd
 

Detailed Description

A Track represents a characteristic line across the geometry.

A Track has particular starting and ending points on the boundaries of the geometry and an azimuthal and polar angle.

Member Function Documentation

◆ addSegment()

void Track::addSegment ( segment segment)

Adds a segment to this Track's list of segments.

This method assumes that segments are added in order of their starting location from the Track's start point.

Parameters
segmentA pointer to the segment

◆ getAzimIndex()

int Track::getAzimIndex ( )

Get a Track's azimuthal angle index.

Returns
The azimuthal angle index

◆ getBCBwd()

boundaryType Track::getBCBwd ( ) const
inline

Returns the boundary condition for the flux along the Track's "reverse" direction.

Returns
vacuum (0), reflective (1), or periodic (2) boundary conditions

◆ getBCFwd()

boundaryType Track::getBCFwd ( ) const
inline

Returns the boundary condition for the flux along the Track's "forward" direction.

Returns
vacuum (0), reflective (1), or periodic (2) boundary conditions

◆ getDomainBwd()

int Track::getDomainBwd ( )

Get the domain connected at the back end of the Track.

Returns
The id of the domain behind the Track

◆ getDomainFwd()

int Track::getDomainFwd ( )

Get the domain connected at the front end of the Track.

Returns
The id of the domain in front of the Track

◆ getEnd()

Point * Track::getEnd ( )
inline

Returns a pointer to the Track's end Point.

Returns
A pointer to the Track's end Point

◆ getLength()

double Track::getLength ( )

Return the Track's length.

Returns
The Track's length

◆ getLinkIndex()

int Track::getLinkIndex ( )

Get a Track's link index.

In generating 3D tracks, we need to know the tracks linking this track with both periodic and reflective boundary conditions. Therefore, we generate a periodic chain of tracks that extend periodically from the y-min to the y-max boundary. This is the index of each track in its' periodic chain.

Returns
The link index

◆ getNextBwdFwd()

bool Track::getNextBwdFwd ( )

Get whether the reflective track in the backward direction is pointing in forward direction.

Returns
Boolean indicating whether reflective track in the backward direction is point in forward direction

◆ getNextFwdFwd()

bool Track::getNextFwdFwd ( )

Get whether the reflective track in the forward direction is pointing in forward direction.

Returns
Boolean indicating whether reflective track in the forward direction is point in forward direction

◆ getNumSegments()

int Track::getNumSegments ( )
inline

Return the number of segments along this Track.

Returns
the number of segments

◆ getPhi()

double Track::getPhi ( ) const
inline

Return the Track's azimuthal angle (with respect to the x-axis).

Returns
The azimuthal angle $ \phi \in [0, \pi] $

◆ getSegment()

segment * Track::getSegment ( int  segment)
inline

Returns a pointer to a segment with a given index.

Returns a pointer to the segment or ends program if Track does not have the requested segment.

Parameters
segmentindex into the Track's segments container
Returns
a pointer to the requested segment

◆ getSegments()

segment * Track::getSegments ( )
inline

Returns a vector of pointers to the Track's segments.

Returns
vector of segment pointers

◆ getStart()

Point * Track::getStart ( )
inline

Returns a pointer to the Track's start Point.

Returns
A pointer to the Track's start Point

◆ getSurfaceIn()

int Track::getSurfaceIn ( )

Get the surface from which the track originates in the domain.

Returns
The id of the Surface at the beginning of the Track

◆ getSurfaceOut()

int Track::getSurfaceOut ( )

Get the surface at which the Track ends in the domain.

Returns
The id of the Surface at the end of the Track

◆ getTrackNextBwd()

long Track::getTrackNextBwd ( )

Get a pointer to the reflective Track in the backward direction.

Returns
the id of the reflective track in the backward direction

◆ getTrackNextFwd()

long Track::getTrackNextFwd ( )

Get a pointer to the reflective Track in the forward direction.

Returns
the id of the reflective track in the forward direction

◆ getTrackPrdcBwd()

long Track::getTrackPrdcBwd ( )

Get a pointer to the periodic Track in the backward direction.

Returns
the id of the periodic track in the backward direction

◆ getTrackPrdcFwd()

long Track::getTrackPrdcFwd ( )

Get a pointer to the periodic Track in the forward direction.

Returns
the id of the periodic track in the forward direction

◆ getTrackReflBwd()

long Track::getTrackReflBwd ( )

Get a pointer to the reflective Track in the backward direction.

Returns
the id of the reflective track in the backward direction

◆ getTrackReflFwd()

long Track::getTrackReflFwd ( )

Get a pointer to the reflective Track in the forward direction.

Returns
the id of the reflective track in the forward direction

◆ getUid()

int Track::getUid ( )
inline

Return the Track's unique ID.

Returns
the Track's unique ID

◆ getXYIndex()

int Track::getXYIndex ( )

Get the xy index of this Track.

Returns
The xy index of this Track

◆ insertSegment()

void Track::insertSegment ( int  index,
segment segment 
)

Inserts a segment struct into this Track's list of segments.

This method appends the new segment directly behind another segment in the Track. This is a helper method for the TrackGenerator::splitTracks(...) routine.

Parameters
indexThe index of the segment to insert behind in the list
segmentA pointer to the segment to insert

◆ removeSegment()

void Track::removeSegment ( int  index)

Removes a segment from this Track's list of segments.

Parameters
indexThe index of the segment to remove

◆ setAzimIndex()

void Track::setAzimIndex ( int  index)

Set a Track's azimuthal angle index.

Parameters
indexThe azimuthal angle index

◆ setBCBwd()

void Track::setBCBwd ( const boundaryType  bc_bwd)

Sets the boundary condition for the incoming flux along the Track's "reverse" direction.

The boolean represents vacuum (false) or reflective (true) boundary conditions.

Parameters
bc_bwdBoundary condition for the incoming flux in the "reverse" direction

◆ setBCFwd()

void Track::setBCFwd ( const boundaryType  bc_fwd)

Sets the boundary condition for the incoming flux along the Track's "forward" direction.

The boolean represents vacuum (false) or reflective (true) boundary conditions.

Parameters
bc_fwdBoundary condition for the incoming flux in the "forward" direction

◆ setCoords()

void Track::setCoords ( double  x0,
double  y0,
double  x1,
double  y1 
)
virtual

Set the values for the Track's start and end point.

Parameters
x0the x-coordinate at the starting point
y0the y-coordinate at the starting point
x1the x-coordinate at the ending point
y1the y-coordinate at the ending point

◆ setDomainBwd()

void Track::setDomainBwd ( int  neighbor)

Set the domain at the end of the Track in the backward direction.

Parameters
neighborNeighbor domain at the beginning of the Track

◆ setDomainFwd()

void Track::setDomainFwd ( int  neighbor)

Set the domain at the end of the Track in the forward direction.

Parameters
neighborNeighbor domain at the end of the Track

◆ setLinkIndex()

void Track::setLinkIndex ( int  index)

Set a Track's link index.

In generating 3D tracks, we need to know the tracks linking this track with both periodic and reflective boundary conditions. Therefore, we generate a periodic chain of tracks that extend periodically from the y-min to the y-max boundary. This is the index of each track in its' periodic chain.

Parameters
indexThe link index

◆ setNextBwdFwd()

void Track::setNextBwdFwd ( bool  fwd)

Set whether the reflective track in the backward direction is pointing in forward direction.

Parameters
fwdBoolean indicating whether reflective track in the backward direction is point in forward direction

◆ setNextFwdFwd()

void Track::setNextFwdFwd ( bool  fwd)

Set whether the reflective track in the forward direction is pointing in forward direction.

Parameters
fwdBoolean indicating whether reflective track in the forward direction is point in forward direction

◆ setNumSegments()

void Track::setNumSegments ( int  num_segments)
inline

Sets the number of segments in a track.

This function sets the number of segments in a track. It's purpose is to be used for 3D tracks with on-the-fly ray tracing where segments are not explicitly created, but there is a need to know how many segments exist.

◆ setPhi()

void Track::setPhi ( const double  phi)

Set the Track's azimuthal angle.

Parameters
phiThe azimuthal angle

◆ setSurfaceIn()

void Track::setSurfaceIn ( int  surface_in)

Set the surface at which the Track starts.

Parameters
surface_insurface from which the Track originates in the domain.

◆ setSurfaceOut()

void Track::setSurfaceOut ( int  surface_out)

Set the surface at which the Track ends.

Parameters
surface_outsurface at which the Track ends in the domain.

◆ setTrackNextBwd()

void Track::setTrackNextBwd ( long  track_id)

Set a pointer to the reflective Track in the backward direction.

Parameters
track_idthe id of the reflective track in the backward direction

◆ setTrackNextFwd()

void Track::setTrackNextFwd ( long  track_id)

Set a pointer to the reflective Track in the forward direction.

Parameters
track_idthe id of the reflective track in the forward direction

◆ setTrackPrdcBwd()

void Track::setTrackPrdcBwd ( long  track_id)

Set a pointer to the periodic Track in the backward direction.

Parameters
track_idthe id of the periodic track in the backward direction

◆ setTrackPrdcFwd()

void Track::setTrackPrdcFwd ( long  track_id)

Set a pointer to the periodic Track in the forward direction.

Parameters
track_idthe id of the periodic track in the forward direction

◆ setTrackReflBwd()

void Track::setTrackReflBwd ( long  track_id)

Set a pointer to the reflective Track in the backward direction.

Parameters
track_idthe id of the reflective track in the backward direction

◆ setTrackReflFwd()

void Track::setTrackReflFwd ( long  track_id)

Set a pointer to the reflective Track in the forward direction.

Parameters
track_idthe id of the reflective track in the forward direction

◆ setUid()

void Track::setUid ( int  uid)

Initializes a Track's unique ID.

This is set by the trackgenerator to correspond to the Track's location in a 2D ragged array of all tracks.

Parameters
uidThe Track's unique ID

◆ setValues()

void Track::setValues ( const double  start_x,
const double  start_y,
const double  end_x,
const double  end_y,
const double  phi 
)
virtual

Set the values for the Track's start and end point and angle.

Parameters
start_xthe x-coordinate at the starting point
start_ythe y-coordinate at the starting point
end_xthe x-coordinate at the ending point
end_ythe y-coordinate at the ending point
phithe track's azimuthal angle ( $ \phi \in [0, 2 \pi] $)

◆ setXYIndex()

void Track::setXYIndex ( int  index)

Set the xy index of this Track.

Parameters
indexThe xy index of this Track

◆ toString()

std::string Track::toString ( )
virtual

Convert this Track's attributes to a character array.

The character array returned includes the Track's starting and ending coordinates, the azimuthal angle and azimuthal weight.

Returns
a character array of this Track's attributes

Reimplemented in Track3D.

Member Data Documentation

◆ _bc_bwd

boundaryType Track::_bc_bwd
protected

An enum to indicate whether the outgoing angular flux along this Track's "reverse" direction should be zeroed out for vacuum boundary conditions or sent to a periodic or reflective track.

◆ _bc_fwd

boundaryType Track::_bc_fwd
protected

An enum to indicate whether the outgoing angular flux along this Track's "forward" direction should be zeroed out for vacuum boundary conditions or sent to a periodic or reflective track.

◆ _direction_in_cycle

bool Track::_direction_in_cycle
protected

Boolean indicating whether the track is pointing fwd (True) or bwd (False) in the cycle of tracks

◆ _domain_fwd

int Track::_domain_fwd
protected

Domains further along and before the current domain on this Track

◆ _end

Point Track::_end
protected

The Track's end point

◆ _next_fwd_fwd

bool Track::_next_fwd_fwd
protected

Booleans to indicate wheter the reflective Tracks in the forward and and backward direction enter into Tracks pointed in the forward direction.

◆ _num_segments

int Track::_num_segments
protected

Number of segments recorded during volume calculation

◆ _phi

double Track::_phi
protected

The azimuthal angle for the Track

◆ _segments

std::vector<segment> Track::_segments
protected

A dynamically sized vector of segments making up this Track

◆ _start

Point Track::_start
protected

The Track's start point

◆ _surface_in

int Track::_surface_in
protected

Surfaces at the beginning and end of the Track

◆ _track_next_fwd

long Track::_track_next_fwd
protected

Pointers to next, reflective, and periodic Tracks in the forward and reverse directions

◆ _uid

int Track::_uid
protected

A monotonically increasing unique ID for each Track created


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