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:
TData type
Parameters:
nxNumber of x grid pointsnyNumber of y grid pointsdestDestination arraysrcSource 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:
TData typeFBlock type
Parameters:
XParamSimulation parametersXBlockBlock parameterssourceSource arraydestDestination 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:
TData type
Parameters:
XParamSimulation parametersXBlockBlock parameterssourceSource evolving variablesdestDestination 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:
TData type
Parameters:
XParamSimulation parametersXBlockBlock parameterssourceSource evolving variablesdestDestination 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:
TData type (float, double, int, bool)FBlock type
Parameters:
XParamSimulation parametersXBlockBlock parametersinitvalValue to initializeArrArray 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:
TData typeFBlock type
Parameters:
XParamSimulation parametersXBlockBlock parametersinitvalValue to initializeArrArray 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:
TData typeFTime type
Parameters:
nxNumber of x grid pointsnyNumber of y grid pointshdstepTime step indextotaltimeTotal simulation timehddtTime step sizeUxOutput arrayUoPrevious solution arrayUnNext 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:
TData type
Parameters:
nxNumber of x grid pointsnyNumber of y grid pointstotaltimeTotal simulation timebeforetimePrevious timeaftertimeNext timeUxOutput arrayUoPrevious solution arrayUnNext 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:
TData type
Parameters:
XParamSimulation parametersXBlockBlock parametersforcingVector of forcing mapszOutput 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:
TData typeFForcing type
Parameters:
XParamSimulation parametersXBlockBlock parametersforcingForcing map(s)zOutput 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:
TData typeFForcing type
Parameters:
xX coordinateyY coordinateforcingForcing 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:
TData typeFForcing type
Parameters:
xX coordinateyY coordinatedxGrid spacingforcingForcing 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:
TData type
Parameters:
XParamSimulation parametersXBlockBlock parameterszbBathymetry array
The documentation for this class was generated from the following file src/GridManip.h