15 #include "../../Solver.h" 18 #define PySys_WriteStdout printf 20 #include <thrust/copy.h> 23 #include <thrust/device_vector.h> 24 #include <thrust/copy.h> 25 #include <thrust/fill.h> 26 #include <thrust/reduce.h> 27 #include <thrust/replace.h> 28 #include <thrust/functional.h> 29 #include <thrust/iterator/constant_iterator.h> 30 #include <thrust/iterator/counting_iterator.h> 31 #include <thrust/iterator/transform_iterator.h> 32 #include <thrust/iterator/permutation_iterator.h> 33 #include <sm_20_atomic_functions.h> 38 #define scalar_flux(tid,e) (scalar_flux[(tid)*(*num_groups) + (e)]) 41 #define old_scalar_flux(tid,e) (old_scalar_flux[(tid)*(*num_groups) + (e)]) 45 #define reduced_sources(tid,e) (reduced_sources[(tid)*(*num_groups) + (e)]) 48 #define fixed_sources(r,e) (fixed_sources[(r)*(*num_groups) + (e)]) 51 #define weights(i,p) (weights[(i)*(*num_polar_2) + (p)]) 55 #define boundary_flux(t,pe2) (boundary_flux[2*(t)*(*polar_times_groups)+(pe2)]) 60 #define start_flux(t,pe2) (start_flux[2*(t)*(*polar_times_groups)+(pe2)]) 89 thrust::device_vector<FP_PRECISION> _boundary_flux;
92 thrust::device_vector<FP_PRECISION> _start_flux;
95 thrust::device_vector<FP_PRECISION> _scalar_flux;
98 thrust::device_vector<FP_PRECISION> _old_scalar_flux;
101 thrust::device_vector<FP_PRECISION> _fixed_sources;
104 thrust::device_vector<FP_PRECISION> _reduced_sources;
107 std::map<int, int> _material_IDs_to_indices;
109 void copyQuadrature();
116 int getNumThreadBlocks();
123 FP_PRECISION getFSRSource(
int fsr_id,
int group);
124 FP_PRECISION getFlux(
int fsr_id,
int group);
125 void getFluxes(FP_PRECISION* out_fluxes,
int num_fluxes);
127 void setNumThreadBlocks(
int num_blocks);
128 void setNumThreadsPerBlock(
int num_threads);
129 void setGeometry(
Geometry* geometry);
131 void setFluxes(FP_PRECISION* in_fluxes,
int num_fluxes);
133 void initializeExpEvaluator();
136 void initializeTracks();
145 void computeFSRSources();
153 void computeFSRFissionRates(
double* fission_rates,
int num_FSRs);
This a subclass of the Solver class for NVIDIA Graphics Processing Units (GPUs).
Definition: GPUSolver.h:69
void zeroTrackFluxes()
Zero each Track's boundary fluxes for each energy group and polar angle in the "forward" and "reverse...
void flattenFSRFluxes(FP_PRECISION value)
Set the scalar flux for each FSR and energy group to some value.
A dev_track represents a characteristic line across the geometry.
Definition: DeviceTrack.h:43
Routines to copy Material and Track objects to the GPU from CPU.
void initializeFixedSources()
Assigns fixed sources assigned by Cell, Material to FSRs.
void initializeSourceArrays()
Allocates memory for FSR source arrays.
The TrackGenerator is dedicated to generating and storing Tracks which cyclically wrap across the Geo...
Definition: TrackGenerator.h:36
void storeFSRFluxes()
Stores the current scalar fluxes in the old scalar flux array.
void computeKeff()
Compute from total fission and absorption rates in each FSR and energy group.
void computeFSRScatterSources()
Computes the total scattering source for each FSR and energy group.
The master class containing references to all geometry-related objects - Surfaces, Cells, Universes and Lattices - and Materials.
Definition: Geometry.h:122
double computeResidual(residualType res_type)
Computes the residual between successive flux/source iterations.
void addSourceToScalarFlux()
Add the source term contribution in the transport equation to the FSR scalar flux.
void initializeFSRs()
Initializes the FSR volumes and Materials array.
void transportSweep()
This method performs one transport sweep of all azimuthal angles, Tracks, segments, polar angles and energy groups.
void normalizeFluxes()
Normalizes all FSR scalar fluxes and Track boundary angular fluxes to the total fission source (times...
void computeFSRFissionSources()
Computes the total fission source for each FSR and energy group.
A Material's nuclear data to be stored on a GPU.
Definition: DeviceMaterial.h:22
This is an abstract base class which different Solver subclasses implement for different architecture...
Definition: Solver.h:121
int getNumThreadsPerBlock()
Returns the number of threads per block to execute on the GPU.
void initializeFluxArrays()
Initializes Track boundary angular flux and leakage and FSR scalar flux arrays.
residualType
The type of residual used for the convergence criterion.
Definition: Solver.h:86
solverMode
The solution mode used by the MOC solver.
Definition: Solver.h:72
The GPUExpEvaluator class.