Skip to content

File Gradients.h

FileList > src > Gradients.h

Go to the source code of this file

  • #include "General.h"
  • #include "Param.h"
  • #include "Arrays.h"
  • #include "Forcing.h"
  • #include "Util_CPU.h"
  • #include "Setup_GPU.h"
  • #include "MemManagement.h"
  • #include "Halo.h"

Public Functions

Type Name
__global__ void WetsloperesetHaloBotGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
GPU kernel to reset the wet slope limiter at the bottom halo boundary. Adjusts y-derivative gradients to prevent non-physical slopes in wet-dry transition zones.
__global__ void WetsloperesetHaloLeftGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
Device kernel to apply wet slope limiters to gradients of surface elevation at the left halo boundary. Adjusts x-derivative gradients to prevent non-physical slopes in wet-dry transition zones.
__global__ void WetsloperesetHaloRightGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
Device kernel to apply wet slope limiters to gradients of surface elevation at the right halo boundary. Adjusts x-derivative gradients to prevent non-physical slopes in wet-dry transition zones.
__global__ void WetsloperesetHaloTopGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
GPU kernel to reset the wet slope limiter at the top halo boundary. Adjusts y-derivative gradients to prevent non-physical slopes in wet-dry transition zones.
__global__ void WetsloperesetXGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
Device kernel to apply wet slope limiters to gradients of surface elevation in the x-direction. Adjusts x-derivative gradients to prevent non-physical slopes in wet-dry transition zones.
__global__ void WetsloperesetYGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
Device kernel to apply wet slope limiters to gradients of surface elevation in the y-direction. Adjusts y-derivative gradients to prevent non-physical slopes in wet-dry transition zones.
__global__ void gradient (int halowidth, int * active, int * level, T theta, T dx, T * a, T * dadx, T * dady)
Device kernel for calculating gradients for an evolving parameter using the minmod limiter.
void gradientC (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
CPU function for calculating gradients using the minmod limiter. Computes spatial derivatives in x and y directions for a given variable.
void gradientCPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
CPU function to compute gradients for all evolving parameters, handle halo regions, and apply wet-dry fixes. Calculates spatial derivatives for height, surface elevation, and velocity components. Also manages halo regions and applies wet-dry fixes if necessary.
void gradientGPU (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
Entry point for gradient of evolving variables calculation on the GPU.
void gradientGPUnew (Param XParam, BlockP< T > XBlock, EvolvingP< T > XEv, GradientsP< T > XGrad, T * zb)
Alternative GPU gradient calculation using shared memory kernels and CUDA streams.
void gradientHalo (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
CPU function to compute gradients at the halo boundaries of all active blocks. This function iterates over all active blocks and computes the gradients at their halo boundaries using finite difference approximations.
__global__ void gradientHaloBotGPU (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the bottom halo boundary of blocks. This kernel calculates the x and y derivatives at the bottom edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientHaloBotGPUnew (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the bottom halo boundary of blocks. This kernel calculates the x and y derivatives at the bottom edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
void gradientHaloGPU (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU function to compute gradients at the halo boundaries of all active blocks. This function launches CUDA kernels to compute the gradients at the halo boundaries of all active blocks using parallel processing.
__global__ void gradientHaloLeftGPU (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the left halo boundary of blocks. This kernel calculates the x and y derivatives at the left edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientHaloLeftGPUnew (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the left halo boundary of blocks. This kernel calculates the x and y derivatives at the left edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientHaloRightGPU (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the right halo boundary of blocks. This kernel calculates the x and y derivatives at the right edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientHaloRightGPUnew (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the right halo boundary of blocks. This kernel calculates the x and y derivatives at the right edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientHaloTopGPU (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the top halo boundary of blocks. This kernel calculates the x and y derivatives at the top edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientHaloTopGPUnew (Param XParam, BlockP< T > XBlock, T * a, T * dadx, T * dady)
GPU kernel to compute the gradient at the top halo boundary of blocks. This kernel calculates the x and y derivatives at the top edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.
__global__ void gradientSM (int halowidth, int * active, int * level, T theta, T dx, T * a, T * dadx, T * dady)
Deprecated shared memory device kernel for gradient calculation.
__global__ void gradientSMB (int halowidth, int * active, int * level, T theta, T dx, T * a, T * dadx, T * dady)
Shared memory device kernel for gradient calculation (variant B).
__global__ void gradientSMC (int halowidth, int * active, int * level, T theta, T dx, T * a, T * dadx, T * dady)
Shared memory device kernel for gradient calculation (variant C).
__global__ void gradientedgeX (int halowidth, int * active, int * level, T theta, T dx, T * a, T * dadx)
Device kernel for calculating gradients for an evolving parameter using the minmod limiter only at a fixed column (i.e. fixed ix).
__global__ void gradientedgeY (int halowidth, int * active, int * level, T theta, T dx, T * a, T * dady)
Device kernel for calculating gradients for an evolving parameter using the minmod limiter only at a fixed row (i.e. fixed iy).

Public Functions Documentation

function WetsloperesetHaloBotGPU

GPU kernel to reset the wet slope limiter at the bottom halo boundary. Adjusts y-derivative gradients to prevent non-physical slopes in wet-dry transition zones.

template<class T>
__global__ void WetsloperesetHaloBotGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

Note:

This kernel specifically handles the bottom halo boundary, where special care is needed due to the absence of neighboring blocks on that side. The logic accounts for various configurations of neighboring blocks to correctly compute the bottom surface elevation needed for the wet slope limiter.


function WetsloperesetHaloLeftGPU

Device kernel to apply wet slope limiters to gradients of surface elevation at the left halo boundary. Adjusts x-derivative gradients to prevent non-physical slopes in wet-dry transition zones.

template<class T>
__global__ void WetsloperesetHaloLeftGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

Note:

This kernel specifically handles the left halo boundary, where special care is needed due to the absence of neighboring blocks on that side. The logic accounts for various configurations of neighboring blocks to correctly compute the left surface elevation needed for the wet slope limiter.


function WetsloperesetHaloRightGPU

Device kernel to apply wet slope limiters to gradients of surface elevation at the right halo boundary. Adjusts x-derivative gradients to prevent non-physical slopes in wet-dry transition zones.

template<class T>
__global__ void WetsloperesetHaloRightGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

Note:

This kernel specifically handles the right halo boundary, where special care is needed due to the absence of neighboring blocks on that side. The logic accounts for various configurations of neighboring blocks to correctly compute the right surface elevation needed for the wet slope limiter.


function WetsloperesetHaloTopGPU

GPU kernel to reset the wet slope limiter at the top halo boundary. Adjusts y-derivative gradients to prevent non-physical slopes in wet-dry transition zones.

template<class T>
__global__ void WetsloperesetHaloTopGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

Note:

This kernel specifically handles the top halo boundary, where special care is needed due to the absence of neighboring blocks on that side. The logic accounts for various configurations of neighboring blocks to correctly compute the top surface elevation needed for the wet slope limiter.


function WetsloperesetXGPU

Device kernel to apply wet slope limiters to gradients of surface elevation in the x-direction. Adjusts x-derivative gradients to prevent non-physical slopes in wet-dry transition zones.

template<class T>
__global__ void WetsloperesetXGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

function WetsloperesetYGPU

Device kernel to apply wet slope limiters to gradients of surface elevation in the y-direction. Adjusts y-derivative gradients to prevent non-physical slopes in wet-dry transition zones.

template<class T>
__global__ void WetsloperesetYGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

function gradient

Device kernel for calculating gradients for an evolving parameter using the minmod limiter.

template<class T>
__global__ void gradient (
    int halowidth,
    int * active,
    int * level,
    T theta,
    T dx,
    T * a,
    T * dadx,
    T * dady
) 

Computes spatial derivatives in x and y directions for a given variable.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Width of halo region
  • active Active block indices
  • level Block refinement levels
  • theta Limiter parameter
  • dx Grid spacing
  • a Input variable array
  • dadx Output gradient in x
  • dady Output gradient in y

function gradientC

CPU function for calculating gradients using the minmod limiter. Computes spatial derivatives in x and y directions for a given variable.

template<class T>
void gradientC (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Input variable array
  • dadx Output gradient in x
  • dady Output gradient in y

function gradientCPU

CPU function to compute gradients for all evolving parameters, handle halo regions, and apply wet-dry fixes. Calculates spatial derivatives for height, surface elevation, and velocity components. Also manages halo regions and applies wet-dry fixes if necessary.

template<class T>
void gradientCPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • XEv Evolving parameters (height, surface elevation, velocities)
  • XGrad Gradient storage for the evolving parameters
  • zb Bathymetry array

function gradientGPU

Entry point for gradient of evolving variables calculation on the GPU.

template<class T>
void gradientGPU (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Calculates gradients of evolving variables using CUDA kernels and synchronizes device operations. Handles halo filling and elevation conservation if required.

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block parameters
  • XEv Evolving variables
  • XGrad Gradient variables
  • zb Bed elevation array

Wrapping function to calculate gradien of evolving variables on GPU This function is the entry point to the gradient functions on the GPU


function gradientGPUnew

Alternative GPU gradient calculation using shared memory kernels and CUDA streams.

template<class T>
void gradientGPUnew (
    Param XParam,
    BlockP < T > XBlock,
    EvolvingP < T > XEv,
    GradientsP < T > XGrad,
    T * zb
) 

Uses gradientSMC kernels and handles halo filling, elevation conservation, and wet/dry prolongation.

Template parameters:

  • T Data type (float or double)

Parameters:

  • XParam Simulation parameters
  • XBlock Block parameters
  • XEv Evolving variables
  • XGrad Gradient variables
  • zb Bed elevation array

function gradientHalo

CPU function to compute gradients at the halo boundaries of all active blocks. This function iterates over all active blocks and computes the gradients at their halo boundaries using finite difference approximations.

template<class T>
void gradientHalo (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This function calls specific functions to handle each of the four halo boundaries (left, right, bottom, top) for each block. It ensures that gradients are accurately computed at the edges of the computational domain, which is crucial for maintaining solution accuracy and stability. The function assumes that the input arrays are properly allocated and sized according to the simulation parameters. The gradient computations are performed using central differences where possible, and one-sided differences at the boundaries. The function is templated to support different data types (e.g., float, double).

See also: gradientHaloLeft, gradientHaloRight, gradientHaloBot, gradientHaloTop


function gradientHaloBotGPU

GPU kernel to compute the gradient at the bottom halo boundary of blocks. This kernel calculates the x and y derivatives at the bottom edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloBotGPU (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloBotGPUnew

GPU kernel to compute the gradient at the bottom halo boundary of blocks. This kernel calculates the x and y derivatives at the bottom edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloBotGPUnew (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloGPU

GPU function to compute gradients at the halo boundaries of all active blocks. This function launches CUDA kernels to compute the gradients at the halo boundaries of all active blocks using parallel processing.

template<class T>
void gradientHaloGPU (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This function sets up the CUDA grid and block dimensions and launches specific kernels to handle each of the four halo boundaries (left, right, bottom, top) for all active blocks. It ensures that gradients are accurately computed at the edges of the computational domain, which is crucial for maintaining solution accuracy and stability. The function assumes that the input arrays are properly allocated and sized according to the simulation parameters. The gradient computations are performed using central differences where possible, and one-sided differences at the boundaries. The function is templated to support different data types (e.g., float, double).

See also: gradientHaloLeftGPU, gradientHaloRightGPU, gradientHaloBotGPU, gradientHaloTopGPU

See also: gradientHaloLeft, gradientHaloRight, gradientHaloBot, gradientHaloTop


function gradientHaloLeftGPU

GPU kernel to compute the gradient at the left halo boundary of blocks. This kernel calculates the x and y derivatives at the left edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloLeftGPU (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloLeftGPUnew

GPU kernel to compute the gradient at the left halo boundary of blocks. This kernel calculates the x and y derivatives at the left edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloLeftGPUnew (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloRightGPU

GPU kernel to compute the gradient at the right halo boundary of blocks. This kernel calculates the x and y derivatives at the right edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloRightGPU (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloRightGPUnew

GPU kernel to compute the gradient at the right halo boundary of blocks. This kernel calculates the x and y derivatives at the right edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloRightGPUnew (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloTopGPU

GPU kernel to compute the gradient at the top halo boundary of blocks. This kernel calculates the x and y derivatives at the top edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloTopGPU (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientHaloTopGPUnew

GPU kernel to compute the gradient at the top halo boundary of blocks. This kernel calculates the x and y derivatives at the top edge of each block using finite difference approximations, taking into account the presence of neighboring blocks and their levels.

template<class T>
__global__ void gradientHaloTopGPUnew (
    Param XParam,
    BlockP < T > XBlock,
    T * a,
    T * dadx,
    T * dady
) 

Parameters:

  • XParam Simulation parameters
  • XBlock Block information
  • a Array containing the variable for which gradients are to be computed
  • dadx Array to store the computed x-derivative gradients
  • dady Array to store the computed y-derivative gradients

Note:

This kernel handles various configurations of neighboring blocks, including cases where neighboring blocks are at different levels of refinement


function gradientSM

Deprecated shared memory device kernel for gradient calculation.

template<class T>
__global__ void gradientSM (
    int halowidth,
    int * active,
    int * level,
    T theta,
    T dx,
    T * a,
    T * dadx,
    T * dady
) 

Uses shared memory for stencil operations; slower than the standard kernel.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Width of halo region
  • active Active block indices
  • level Block refinement levels
  • theta Limiter parameter
  • dx Grid spacing
  • a Input variable array
  • dadx Output gradient in x
  • dady Output gradient in y

function gradientSMB

Shared memory device kernel for gradient calculation (variant B).

template<class T>
__global__ void gradientSMB (
    int halowidth,
    int * active,
    int * level,
    T theta,
    T dx,
    T * a,
    T * dadx,
    T * dady
) 

Uses a fixed shared memory tile for stencil operations; only computes gradients for interior points.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Width of halo region
  • active Active block indices
  • level Block refinement levels
  • theta Limiter parameter
  • dx Grid spacing
  • a Input variable array
  • dadx Output gradient in x
  • dady Output gradient in y

function gradientSMC

Shared memory device kernel for gradient calculation (variant C).

template<class T>
__global__ void gradientSMC (
    int halowidth,
    int * active,
    int * level,
    T theta,
    T dx,
    T * a,
    T * dadx,
    T * dady
) 

Uses a flat shared memory array for stencil operations; computes gradients for all points.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Width of halo region
  • active Active block indices
  • level Block refinement levels
  • theta Limiter parameter
  • dx Grid spacing
  • a Input variable array
  • dadx Output gradient in x
  • dady Output gradient in y

function gradientedgeX

Device kernel for calculating gradients for an evolving parameter using the minmod limiter only at a fixed column (i.e. fixed ix).

template<class T>
__global__ void gradientedgeX (
    int halowidth,
    int * active,
    int * level,
    T theta,
    T dx,
    T * a,
    T * dadx
) 

Computes x-derivative for a specific column using the minmod limiter.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Width of halo region
  • active Active block indices
  • level Block refinement levels
  • theta Limiter parameter
  • dx Grid spacing
  • a Input variable array
  • dadx Output gradient in x

function gradientedgeY

Device kernel for calculating gradients for an evolving parameter using the minmod limiter only at a fixed row (i.e. fixed iy).

template<class T>
__global__ void gradientedgeY (
    int halowidth,
    int * active,
    int * level,
    T theta,
    T dx,
    T * a,
    T * dady
) 

Computes y-derivative for a specific row using the minmod limiter.

Template parameters:

  • T Data type (float or double)

Parameters:

  • halowidth Width of halo region
  • active Active block indices
  • level Block refinement levels
  • theta Limiter parameter
  • dx Grid spacing
  • a Input variable array
  • dady Output gradient in y


The documentation for this class was generated from the following file src/Gradients.h