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

An MOCKernel object specifies a functionality to apply to MOC segments. More...

#include "src/MOCKernel.h"

Public Member Functions

 MOCKernel (TrackGenerator *track_generator)
 Constructor for the MOCKernel assigns default values. More...
 
virtual ~MOCKernel ()
 Destructor for MOCKernel.
 
int getCount ()
 Reads and returns the current count. More...
 
void setMaxOpticalLength (FP_PRECISION max_tau)
 Resets the maximum optcal path length for a segment. More...
 
virtual void newTrack (Track *track)
 Prepares an MOCKernel for a new Track. More...
 
virtual void execute (FP_PRECISION length, Material *mat, long fsr_id, int track_idx, int cmfd_surface_fwd, int cmfd_surface_bwd, FP_PRECISION x_start, FP_PRECISION y_start, FP_PRECISION z_start, FP_PRECISION phi, FP_PRECISION theta)=0
 

Protected Attributes

int _count
 
FP_PRECISION _max_tau
 
int _num_groups
 

Detailed Description

An MOCKernel object specifies a functionality to apply to MOC segments.

An MOCKernel is an object that owns some specified data and contains an "execute" function which applies some functionality to the data. This is useful in MOC where it is very common to apply some function to segment data in either a nested loop structure or from on-the-fly calculations. Kernels specify the actions applied to the segments, reducing the need for repeated code. This class is the parent class of CounterKernel, VolumeKernel, and SegmentationKernel. A generic MOCKernel should not be explicity instantiated. Instead, an inhereting class should be instantiated which describes the "execute" function.

Constructor & Destructor Documentation

◆ MOCKernel()

MOCKernel::MOCKernel ( TrackGenerator track_generator)

Constructor for the MOCKernel assigns default values.

Parameters
track_generatorthe TrackGenerator used to pull relevant tracking data from

Member Function Documentation

◆ getCount()

int MOCKernel::getCount ( )

Reads and returns the current count.

MOC kernels count how many times they are accessed. This value returns the value of the counter (number of execute accesses) since kernel creation or last call to newTrack.

Returns
_count the counter value

◆ newTrack()

void MOCKernel::newTrack ( Track track)
virtual

Prepares an MOCKernel for a new Track.

Resets the segment count

Parameters
trackThe new Track the MOCKernel prepares to handle

Reimplemented in TransportKernel, and VolumeKernel.

◆ setMaxOpticalLength()

void MOCKernel::setMaxOpticalLength ( FP_PRECISION  max_tau)

Resets the maximum optcal path length for a segment.

MOC kernels ensure that there are no segments with an optical path length greater than the maximum optical path length by splitting them when they get too large.

Parameters
max_tauthe maximum optical path length for a segment

Member Data Documentation

◆ _count

int MOCKernel::_count
protected

Count referring to the segment number

◆ _max_tau

FP_PRECISION MOCKernel::_max_tau
protected

Maximum optical path length when forming segments

◆ _num_groups

int MOCKernel::_num_groups
protected

Number of energy groups in the current problem


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