File GridManip.h
FileList > src > GridManip.h
Go to the source code of this file
#include "General.h"
#include "Param.h"
#include "Util_CPU.h"
#include "Forcing.h"
#include "Arrays.h"
#include "MemManagement.h"
Public Functions
Type | Name |
---|---|
void | Copy2CartCPU (int nx, int ny, T * dest, T * src) Copy values from source to destination for a Cartesian grid. |
void | CopyArrayBUQ (Param XParam, BlockP< F > XBlock, T * source, T *& dest) Copy values from source array to destination array for all blocks. |
void | CopyArrayBUQ (Param XParam, BlockP< T > XBlock, EvolvingP< T > source, EvolvingP< T > & dest) Copy all evolving variables from source to destination. |
void | CopyArrayBUQ (Param XParam, BlockP< T > XBlock, EvolvingP< T > source, EvolvingP_M< T > & dest) Copy all evolving variables and compute derived quantities (U, hU). |
void | InitArrayBUQ (Param XParam, BlockP< F > XBlock, T initval, T *& Arr) Initialize a block-structured array with a given value. |
void | InitBlkBUQ (Param XParam, BlockP< F > XBlock, T initval, T *& Arr) Initialize a block-level array with a given value. |
void | InterpstepCPU (int nx, int ny, int hdstep, F totaltime, F hddt, T *& Ux, T * Uo, T * Un) CPU routine for time interpolation of solution arrays. |
__global__ void | InterpstepGPU (int nx, int ny, T totaltime, T beforetime, T aftertime, T * Ux, T * Uo, T * Un) GPU kernel for time interpolation of solution arrays. |
void | interp2BUQ (Param XParam, BlockP< T > XBlock, std::vector< StaticForcingP< float > > forcing, T * z) Interpolate values from multiple forcing maps to block array using bilinear interpolation. |
void | interp2BUQ (Param XParam, BlockP< T > XBlock, F forcing, T *& z) Interpolate values from forcing map to block array using bilinear interpolation. |
T | interp2BUQ (T x, T y, F forcing) Bilinear interpolation for value at (x, y) from forcing map. |
T | interp2BUQ (T x, T y, T dx, F forcing) Interpolate value at (x, y) using either bilinear or blockmean interpolation. |
void | setedges (Param XParam, BlockP< T > XBlock, T *& zb) Set edge values for bathymetry array at domain boundaries. |
Public Functions Documentation
function Copy2CartCPU
Copy values from source to destination for a Cartesian grid.
Copies all values from src to dest for a regular Cartesian grid.
Template parameters:
T
Data type
Parameters:
nx
Number of x grid pointsny
Number of y grid pointsdest
Destination arraysrc
Source array
function CopyArrayBUQ
Copy values from source array to destination array for all blocks.
template<class T, class F>
void CopyArrayBUQ (
Param XParam,
BlockP < F > XBlock,
T * source,
T *& dest
)
Copies all elements for each active block from source to dest.
Template parameters:
T
Data typeF
Block type
Parameters:
XParam
Simulation parametersXBlock
Block parameterssource
Source arraydest
Destination array
function CopyArrayBUQ
Copy all evolving variables from source to destination.
template<class T>
void CopyArrayBUQ (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > source,
EvolvingP < T > & dest
)
Copies h, u, v, zs arrays for all blocks.
Template parameters:
T
Data type
Parameters:
XParam
Simulation parametersXBlock
Block parameterssource
Source evolving variablesdest
Destination evolving variables
function CopyArrayBUQ
Copy all evolving variables and compute derived quantities (U, hU).
template<class T>
void CopyArrayBUQ (
Param XParam,
BlockP < T > XBlock,
EvolvingP < T > source,
EvolvingP_M < T > & dest
)
Copies h, u, v, zs arrays and computes U and hU for all blocks.
Template parameters:
T
Data type
Parameters:
XParam
Simulation parametersXBlock
Block parameterssource
Source evolving variablesdest
Destination evolving variables (with derived quantities)
function InitArrayBUQ
Initialize a block-structured array with a given value.
template<class T, class F>
void InitArrayBUQ (
Param XParam,
BlockP < F > XBlock,
T initval,
T *& Arr
)
Sets all elements of Arr for each active block to initval.
Template parameters:
T
Data type (float, double, int, bool)F
Block type
Parameters:
XParam
Simulation parametersXBlock
Block parametersinitval
Value to initializeArr
Array to initialize
function InitBlkBUQ
Initialize a block-level array with a given value.
template<class T, class F>
void InitBlkBUQ (
Param XParam,
BlockP < F > XBlock,
T initval,
T *& Arr
)
Sets each block's entry in Arr to initval.
Template parameters:
T
Data typeF
Block type
Parameters:
XParam
Simulation parametersXBlock
Block parametersinitval
Value to initializeArr
Array to initialize
function InterpstepCPU
CPU routine for time interpolation of solution arrays.
template<class T, class F>
void InterpstepCPU (
int nx,
int ny,
int hdstep,
F totaltime,
F hddt,
T *& Ux,
T * Uo,
T * Un
)
Interpolates between Uo and Un to compute Ux at a given time step.
Template parameters:
T
Data typeF
Time type
Parameters:
nx
Number of x grid pointsny
Number of y grid pointshdstep
Time step indextotaltime
Total simulation timehddt
Time step sizeUx
Output arrayUo
Previous solution arrayUn
Next solution array
function InterpstepGPU
GPU kernel for time interpolation of solution arrays.
template<class T>
__global__ void InterpstepGPU (
int nx,
int ny,
T totaltime,
T beforetime,
T aftertime,
T * Ux,
T * Uo,
T * Un
)
Interpolates between Uo and Un to compute Ux at a given time using shared memory.
Template parameters:
T
Data type
Parameters:
nx
Number of x grid pointsny
Number of y grid pointstotaltime
Total simulation timebeforetime
Previous timeaftertime
Next timeUx
Output arrayUo
Previous solution arrayUn
Next solution array
function interp2BUQ
Interpolate values from multiple forcing maps to block array using bilinear interpolation.
template<class T>
void interp2BUQ (
Param XParam,
BlockP < T > XBlock,
std::vector< StaticForcingP < float > > forcing,
T * z
)
Fills z array for each block using bilinear interpolation from multiple forcing maps.
Template parameters:
T
Data type
Parameters:
XParam
Simulation parametersXBlock
Block parametersforcing
Vector of forcing mapsz
Output array
function interp2BUQ
Interpolate values from forcing map to block array using bilinear interpolation.
Fills z array for each block using bilinear interpolation from forcing map(s).
Template parameters:
T
Data typeF
Forcing type
Parameters:
XParam
Simulation parametersXBlock
Block parametersforcing
Forcing map(s)z
Output array
function interp2BUQ
Bilinear interpolation for value at (x, y) from forcing map.
Performs bilinear interpolation using surrounding grid points in forcing map.
Template parameters:
T
Data typeF
Forcing type
Parameters:
x
X coordinatey
Y coordinateforcing
Forcing map
Returns:
Interpolated value
function interp2BUQ
Interpolate value at (x, y) using either bilinear or blockmean interpolation.
Chooses interpolation method based on grid spacing dx.
Template parameters:
T
Data typeF
Forcing type
Parameters:
x
X coordinatey
Y coordinatedx
Grid spacingforcing
Forcing map
Returns:
Interpolated value
function setedges
Set edge values for bathymetry array at domain boundaries.
Copies values from interior to boundary cells for blocks with no neighbor.
Template parameters:
T
Data type
Parameters:
XParam
Simulation parametersXBlock
Block parameterszb
Bathymetry array
The documentation for this class was generated from the following file src/GridManip.h