An open source method of characteristics neutron transport code.
TraverseSegments.h
Go to the documentation of this file.
1 
8 #ifndef TRAVERSE_SEGMENTS_H_
9 #define TRAVERSE_SEGMENTS_H_
10 
11 #ifdef SWIG
12 #include "Python.h"
13 #endif
14 #include "Track.h"
15 #include "Track3D.h"
16 #include "Geometry.h"
17 #include "TrackGenerator3D.h"
18 
19 
36 
37 private:
38 
39  /* Functions defining how to loop over Tracks */
40  void loopOverTracks2D(MOCKernel* kernel);
41  void loopOverTracksExplicit(MOCKernel* kernel);
42  void loopOverTracksByTrackOTF(MOCKernel* kernel);
43  void loopOverTracksByStackOTF(MOCKernel* kernel);
44 
45  /* Functions defining how to traverse segments */
46  void traceSegmentsExplicit(Track* track, MOCKernel* kernel);
47  void traceSegmentsOTF(Track* flattened_track, Point* start,
48  double theta, MOCKernel* kernel);
49  void traceStackOTF(Track* flattened_track, int polar_index,
50  MOCKernel* kernel);
51 
52  void traceStackTwoWay(Track* flattened_track, int polar_index,
53  TransportKernel* kernel);
54 
55 
56  int findMeshIndex(double* values, int size, double val, int sign);
57 
58 protected:
59 
62  TrackGenerator3D* _track_generator_3D;
63 
65  double* _global_z_mesh;
66 
69 
72 
73  TraverseSegments(TrackGenerator* track_generator);
74  virtual ~TraverseSegments();
75 
76  /* Functions defining how to loop over and operate on Tracks */
77  void loopOverTracks(MOCKernel* kernel);
78  virtual void onTrack(Track* track, segment* segments) = 0;
79 
80  //FIXME Rework function calls to make this private
82 
83  /* Returns a kernel of the requested type */
84  template <class KernelType>
85  MOCKernel* getKernel() {
86 
87  /* Check for segmentation kernel in explicit methods */
88  if ((typeid(KernelType) != typeid(SegmentationKernel)) ||
91 
92  /* Allocate kernel */
93  MOCKernel* kernel = new KernelType(_track_generator);
94  return kernel;
95  }
96  else
97  return NULL;
98  }
99 
100 public:
101  virtual void execute() = 0;
102 
103 };
104 
105 #endif
TraverseSegments(TrackGenerator *track_generator)
Constructor for the TraverseSegments class assigns the TrackGenerator and pulls relevant information ...
Definition: TraverseSegments.cpp:7
virtual ~TraverseSegments()
Destructor for TraverseSegments.
Definition: TraverseSegments.cpp:26
double * _global_z_mesh
Definition: TraverseSegments.h:65
The TrackGenerator is dedicated to generating and storing Tracks which cyclically wrap across the Geo...
Definition: TrackGenerator.h:36
Class to represent a 2D/3D point in space.
Definition: Point.h:24
segmentationType
The types of Track segmentation supported by OpenMOC.
Definition: segmentation_type.h:15
void loopOverTracksByStackTwoWay(TransportKernel *kernel)
Loops over all 3D Tracks using axial on-the-fly ray tracking by z-stack, going forward then backward ...
Definition: TraverseSegments.cpp:968
TrackGenerator * _track_generator
Definition: TraverseSegments.h:61
void loopOverTracks(MOCKernel *kernel)
Loops over Tracks, applying the provided kernel to all segments and the functionality described in on...
Definition: TraverseSegments.cpp:39
A segment represents a line segment within a single flat source region along a track.
Definition: Track.h:27
The 3D Track class.
An MOCKernel object specifies a functionality to apply to MOC segments.
Definition: MOCKernel.h:41
Applies transport equations to segment data.
Definition: MOCKernel.h:162
int _mesh_size
Definition: TraverseSegments.h:68
The TrackGenerator3D class.
Forms segment data associated with a 3D track.
Definition: MOCKernel.h:140
Definition: segmentation_type.h:21
segmentationType _segment_formation
Definition: TraverseSegments.h:71
An TraverseSegments object defines how to loop over Tracks given various different segmentation schem...
Definition: TraverseSegments.h:35
Definition: segmentation_type.h:18
The generic Track class.
A Track represents a characteristic line across the geometry.
Definition: Track.h:67
The TrackGenerator3D is dedicated to generating and storing Tracks which cyclically wrap across the G...
Definition: TrackGenerator3D.h:86
The Geometry class.