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

A class used to count the number of segments on each Track and the maximum number of segments per Track. More...

#include <TrackTraversingAlgorithms.h>

Public Member Functions

 SegmentCounter (TrackGenerator *track_generator)
 Constructor for SegmentCounter calls the TraverseSegments constructor and sets the max number of segments per Track to zero. More...
 
void execute ()
 Determines the maximum number of segments per Track. More...
 
void onTrack (Track *track, segment *segments)
 Updates the maximum number of segments per Track if a Track with a larger number of segments is observed. More...
 
void countTotalNumSegments ()
 Turn on counting segments.
 
long getTotalNumSegments ()
 Get the total number of segments. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TraverseSegments
 TraverseSegments (TrackGenerator *track_generator)
 Constructor for the TraverseSegments class assigns the TrackGenerator and pulls relevant information from it.
 
virtual ~TraverseSegments ()
 Destructor for TraverseSegments.
 
void loopOverTracks (MOCKernel *kernel)
 Loops over Tracks, applying the provided kernel to all segments and the functionality described in onTrack(...) to all Tracks. More...
 
void loopOverTracksByStackTwoWay (TransportKernel *kernel)
 Loops over all 3D Tracks using axial on-the-fly ray tracking by z-stack, going forward then backward on each 3D Track. More...
 
template<class KernelType >
MOCKernelgetKernel ()
 
- Protected Attributes inherited from TraverseSegments
TrackGenerator_track_generator
 
TrackGenerator3D_track_generator_3D
 
double * _global_z_mesh
 
int _mesh_size
 
segmentationType _segment_formation
 

Detailed Description

A class used to count the number of segments on each Track and the maximum number of segments per Track.

"src/TrackTraversingAlgorithms.h"

A SegmentCounter allocates CounterKernels to count segments along each Track given a maximum optical path length imported from the provided TrackGenerator and the maximum number of segments per Track in the TrackGenerator is updated.

Constructor & Destructor Documentation

◆ SegmentCounter()

SegmentCounter::SegmentCounter ( TrackGenerator track_generator)

Constructor for SegmentCounter calls the TraverseSegments constructor and sets the max number of segments per Track to zero.

Parameters
track_generatorThe TrackGenerator to pull tracking information from

Member Function Documentation

◆ execute()

void SegmentCounter::execute ( )
virtual

Determines the maximum number of segments per Track.

CounterKernels are initialized to count segments along each Track. Then Tracks are traversed, saving the maximum number of segments and setting the corresponding parameter on the TrackGenerator.

Implements TraverseSegments.

◆ getTotalNumSegments()

long SegmentCounter::getTotalNumSegments ( )

Get the total number of segments.

Returns
The total number of segments

◆ onTrack()

void SegmentCounter::onTrack ( Track track,
segment segments 
)
virtual

Updates the maximum number of segments per Track if a Track with a larger number of segments is observed.

Parameters
trackThe Track whose segments are counted
segmentsThe segments associated with the Track

Implements TraverseSegments.


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