An open source method of characteristics neutron transport code.
VectorizedSolver.h
Go to the documentation of this file.
1 
9 #ifndef VECTORIZEDSOLVER_H_
10 #define VECTORIZEDSOLVER_H_
11 
12 #ifdef __cplusplus
13 #define _USE_MATH_DEFINES
14 #include "CPUSolver.h"
15 #include <math.h>
16 #include <omp.h>
17 #include <stdlib.h>
18 #include <mkl.h>
19 #endif
20 
23 #define taus(p,e) (taus[(p)*_num_groups + (e)])
24 
28 #define exponentials(p,e) (exponentials[(p)*_num_groups + (e)])
29 
39 class VectorizedSolver : public CPUSolver {
40 
41 protected:
42 
45 
47  FP_PRECISION* _delta_psi;
48 
50  FP_PRECISION* _thread_taus;
51 
54  FP_PRECISION* _thread_exponentials;
55 
57  void initializeFluxArrays();
59 
60  void normalizeFluxes();
61  void computeFSRSources(int iteration);
62  void addSourceToScalarFlux();
63  void computeKeff();
64 
65  void tallyScalarFlux(segment* curr_segment, int azim_index,
66  FP_PRECISION* track_flux, FP_PRECISION* fsr_flux);
67  void transferBoundaryFlux(int track_id, int azim_index, bool direction,
68  FP_PRECISION* track_flux);
69  void computeExponentials(segment* curr_segment, FP_PRECISION* exponentials);
70 
71 public:
72  VectorizedSolver(TrackGenerator* track_generator=NULL);
73  virtual ~VectorizedSolver();
74 
75  int getNumVectorWidths();
76 
77  void setFixedSourceByFSR(int fsr_id, int group,
78  FP_PRECISION source);
79  void setGeometry(Geometry* geometry);
80 };
81 
82 
83 #endif /* VECTORIZEDSOLVER_H_ */
This a subclass of the Solver class for multi-core CPUs using OpenMP multi-threading.
Definition: CPUSolver.h:54
void initializeExpEvaluator()
Allocates memory for the exponential linear interpolation table.
Definition: VectorizedSolver.cpp:148
This is a subclass of the CPUSolver class which uses memory-aligned data structures and Intel&#39;s auto-...
Definition: VectorizedSolver.h:39
void setGeometry(Geometry *geometry)
Sets the Geometry for the Solver and aligns all Material cross-section data for SIMD vector instructi...
Definition: VectorizedSolver.cpp:122
The CPUSolver class.
void tallyScalarFlux(segment *curr_segment, int azim_index, FP_PRECISION *track_flux, FP_PRECISION *fsr_flux)
Computes the contribution to the FSR scalar flux from a segment.
Definition: VectorizedSolver.cpp:611
#define exponentials(p, e)
Definition: VectorizedSolver.h:28
void setFixedSourceByFSR(int fsr_id, int group, FP_PRECISION source)
Assign a fixed source for a flat source region and energy group.
Definition: VectorizedSolver.cpp:100
The TrackGenerator is dedicated to generating and storing Tracks which cyclically wrap across the Geo...
Definition: TrackGenerator.h:36
void normalizeFluxes()
Normalizes all FSR scalar fluxes and Track boundary angular fluxes to the total fission source (times...
Definition: VectorizedSolver.cpp:254
FP_PRECISION * _thread_taus
Definition: VectorizedSolver.h:50
void computeExponentials(segment *curr_segment, FP_PRECISION *exponentials)
Computes an array of the exponentials in the transport equation, , for each energy group and polar an...
Definition: VectorizedSolver.cpp:677
The master class containing references to all geometry-related objects - Surfaces, Cells, Universes and Lattices - and Materials.
Definition: Geometry.h:122
int getNumVectorWidths()
Returns the number of vector lengths required to fit the number of energy groups. ...
Definition: VectorizedSolver.cpp:86
virtual ~VectorizedSolver()
Destructor deletes Track boundary angular flux and and FSR scalar flux and source arrays...
Definition: VectorizedSolver.cpp:29
A segment represents a line segment within a single flat source region along a track.
Definition: Track.h:27
FP_PRECISION * _thread_exponentials
Definition: VectorizedSolver.h:54
void initializeFluxArrays()
Allocates memory for Track boundary angular flux and leakage and FSR scalar flux arrays.
Definition: VectorizedSolver.cpp:173
void initializeSourceArrays()
Allocates memory for FSR source arrays.
Definition: VectorizedSolver.cpp:225
VectorizedSolver(TrackGenerator *track_generator=NULL)
Constructor initializes NULL arrays for source, flux, etc.
Definition: VectorizedSolver.cpp:8
#define track_flux(p, e)
Definition: Cmfd.h:45
void computeKeff()
Compute from the total, fission and scattering reaction rates and leakage.
Definition: VectorizedSolver.cpp:463
void computeFSRSources(int iteration)
Computes the total source (fission, scattering, fixed) in each FSR.
Definition: VectorizedSolver.cpp:330
FP_PRECISION * _delta_psi
Definition: VectorizedSolver.h:47
void transferBoundaryFlux(int track_id, int azim_index, bool direction, FP_PRECISION *track_flux)
Updates the boundary flux for a Track given boundary conditions.
Definition: VectorizedSolver.cpp:747
int _num_vector_lengths
Definition: VectorizedSolver.h:44
void addSourceToScalarFlux()
Add the source term contribution in the transport equation to the FSR scalar flux.
Definition: VectorizedSolver.cpp:415