SNSolverHPCCUDA

CUDA backend for the HPC SN solver path. Compiled when -DBUILD_CUDA_HPC=ON.

Source:

  • include/solvers/snsolver_hpc_cuda.hpp

  • src/solvers/snsolver_hpc.cu

class SNSolverHPCCUDA

Base class for all solvers.

Public Functions

SNSolverHPCCUDA(Config *settings)

Solver constructor.

Parameters:

settings – config class that stores all needed config information

void Solve()

Solve functions runs main iteration loop. Components of the solve loop are pure and subclassed by the child solvers.

inline void PrintVolumeOutput() const

Save Output solution to VTK file.

Private Functions

void SetGhostCells()

Sets vector of ghost cell values according to boundary conditions.

double ComputeTimeStep(double cfl) const

ComputeTimeStep calculates the maximal stable time step using the cfl number.

Parameters:

cfl – Courant-Friedrichs-Levy condition number

void PrepareVolumeOutput()

Initializes the output groups and fields of this solver and names the fields.

void WriteVolumeOutput(unsigned idx_iter)

Function that prepares VTK export and csv export of the current solver iteration.

Parameters:

idx_iter – current (pseudo) time iteration

void PrintVolumeOutput(int idx_iter)

Save Output solution at given energy (pseudo time) to VTK file. Write frequency is given by option VOLUME_OUTPUT_FREQUENCY. Always prints last iteration without iteration affix.

Parameters:

idx_iter – current (pseudo) time iteration

void PrepareScreenOutput()

Initialized the output fields and their Names for the screenoutput.

void WriteScalarOutput(unsigned idx_iter)

Function that writes screen and history output fields.

Parameters:

idx_iter – current (pseudo) time iteration

void PrintScreenOutput(unsigned idx_iter)

Prints ScreenOutputFields to Screen and to logger. Write frequency is given by option SCREEN_OUTPUT_FREQUENCY. Always prints last iteration.

Parameters:

idx_iter – current (pseudo) time iteration

void PrepareHistoryOutput()

Initialized the historyOutputFields and their Names for history output. Write frequency is given by option HISTORY_OUTPUT_FREQUENCY. Always prints last iteration.

void PrintHistoryOutput(unsigned idx_iter)

Prints HistoryOutputFields to logger.

Parameters:

idx_iter – current (pseudo) time iteration

void DrawPreSolverOutput()

Pre Solver Screen and Logger Output.

void DrawPostSolverOutput()

Post Solver Screen and Logger Output.

Private Members

double _curSimTime

current in-simulation time after current iteration

double _currTime

wall-time after current iteration

Config *_settings

config class for global information

unsigned long _nIter

number of time steps, for non CSD, this equals _nEnergies, for _csd, _maxIter =_nEnergies-1

double _dT

energy/time step size

int _idx_start_iter

index of first iteration

unsigned long _nCells

number of spatial cells

unsigned long _nSys

number of equations in the transport system, i.e. num quad pts

unsigned long _nq

number of quadrature points

std::vector<double> _areas

surface area of all spatial cells, dim(_areas) = _NCells

std::vector<double> _normals

edge normals multiplied by edge length, dim(_normals) = (_NCells,nEdgesPerCell,spatialDim)

std::vector<unsigned> _neighbors

edge neighbor cell ids, dim(_neighbors) = (_NCells,nEdgesPerCell)

std::vector<double> _cellMidPoints

dim _nCells x _dim

std::vector<double> _interfaceMidPoints

dim: _nCells x _nEdgesPerCell x _dim

std::vector<BOUNDARY_TYPE> _cellBoundaryTypes

dim: _nCells x _nEdgesPerCell x _dim

std::map<unsigned, std::vector<double>> _ghostCells

Vector of ghost cells for boundary conditions. CAN BE MORE EFFICIENT.

std::vector<double> _relativeInterfaceMidPt

dim _nCells * _nNbr * _nDim

std::vector<double> _relativeCellVertices

dim _nCells * _nNbr * _nDim

std::map<unsigned, bool> _ghostCellsReflectingY

map that indicates if a ghostcell has a fixed value or is a mirroring boundary

std::map<unsigned, bool> _ghostCellsReflectingX

map that indicates if a ghostcell has a fixed value or is a mirroring boundary

std::vector<unsigned> _quadratureYReflection

map that gives a Reflection against the y axis for the velocity ordinates

std::vector<unsigned> _quadratureXReflection

map that gives a Reflection against the y axis for the velocity ordinates

unsigned _temporalOrder

temporal order (current: 1 & 2)

unsigned _spatialOrder

spatial order (current: 1 & 2)

std::vector<double> _solDx

dim = _nCells x _nSys x _dim

std::vector<double> _limiter

dim = _nCells x _nSys

std::vector<double> _sigmaS

dim: _nCells

std::vector<double> _sigmaT

dim: _nCells

std::vector<double> _source

dim: _nCells x _nSys

std::vector<double> _scatteringKernel

dim: _nSys x _nSys

std::vector<double> _quadPts

dim: _nSys x _dim

std::vector<double> _quadWeights

dim: _nSys

std::vector<double> _sol

dim = _nCells x _nSys

std::vector<double> _flux

dim = _nCells x _nSys

std::vector<double> _scalarFlux

dim = _nCells

std::vector<double> _scalarFluxPrevIter

scalar flux snapshot before current solver iteration

double _curAbsorptionLattice

Absorption of particles at Lattice checkerboard regions at current time step.

double _totalAbsorptionLattice

Absorption of particles at Lattice checkerboard regions integrated until current time step.

double _curMaxAbsorptionLattice

Maximum pointwise absorption of particles at Lattice checkerboard regions until current time step.

double _curScalarOutflow

Outflow over whole boundary at current time step.

double _totalScalarOutflow

Outflow over whole boundary integrated until current time step.

double _curMaxOrdinateOutflow

Maximum ordinate-wise ouftlow over boundary over all time steps.

std::vector<double> _localMaxOrdinateOutflow

Maximum ordinate-wise ouftlow over boundary over all time steps.

double _curScalarOutflowPeri1

Outflow over whole boundary at current time step.

double _totalScalarOutflowPeri1

Outflow over whole boundary integrated until current time step.

double _curScalarOutflowPeri2

Outflow over whole boundary at current time step.

double _totalScalarOutflowPeri2

Outflow over whole boundary integrated until current time step.

std::vector<std::vector<unsigned>> _probingCellsHohlraum

Indices of cells that contain a probing sensor.

std::vector<double> _probingMoments

Solution Momnets at the probing cells that contain a probing sensor.

unsigned _probingMomentsTimeIntervals

Solution Momnets at the probing cells that contain a probing sensor.

unsigned _nProbingCellsLineGreen

Number of sampling cells that contain a probing sensor for the sliding window.

std::vector<unsigned> _probingCellsLineGreen

Indices of cells that contain a probing sensor for the sliding window.

std::vector<double> _absorptionValsLineSegment

Avg Absorption value at the sampleing points of lineGreen.

std::vector<std::vector<unsigned>> _probingCellsBlocksGreen

Indices of cells that contain a probing sensor blocks.

std::vector<double> _absorptionValsBlocksGreen

Avg Absorption value at the sampleing blocks of lineGreen.

std::vector<double> _absorptionValsBlocksGreenIntegrated

Internal QoI-3 running values A_i(t) = |g_i|^{-1} \int_{g_i}\int_0^t sigma_a phi d\tau dxdy.

std::vector<double> _cornerUpperLeftGreen

Coord of corner of the green area (minus thickness/2 of it) relative to the green center.

std::vector<double> _cornerLowerLeftGreen

Coord of corner of the green area (minus thickness/2 of it) relative to the green center.

std::vector<double> _cornerUpperRightGreen

Coord of corner of the green area (minus thickness/2 of it) relative to the green center.

std::vector<double> _cornerLowerRightGreen

Coord of corner of the green area (minus thickness/2 of it) relative to the green center.

double _thicknessGreen

thickness of the green area

std::vector<double> _centerGreen

Center of the Hohlraum

std::vector<std::vector<std::vector<double>>> _outputFields

Solver Output: dimensions (GroupID,FieldID,CellID).

std::vector<std::vector<std::string>> _outputFieldNames

Names of the outputFields: dimensions (GroupID,FieldID)

std::vector<double> _screenOutputFields

Solver Output: dimensions (FieldID).

std::vector<std::string> _screenOutputFieldNames

Names of the outputFields: dimensions (FieldID)

std::vector<double> _historyOutputFields

Solver Output: dimensions (FieldID).

std::vector<std::string> _historyOutputFieldNames

Names of the outputFields: dimensions (FieldID)