Discontinuous Galerkin Library
#include "dg/algorithm.h"

\( D_x\), \( D_y\) and \( D_z \) More...

Collaboration diagram for create derivatives:

Enumerations

enum  dg::bc {
  dg::PER = 0 , dg::DIR = 1 , dg::DIR_NEU = 2 , dg::NEU_DIR = 3 ,
  dg::NEU = 4
}
 Switch between boundary conditions. More...
 
enum  dg::direction { dg::forward , dg::backward , dg::centered }
 Direction of a discrete derivative. More...
 
enum  dg::space { dg::lspace , dg::xspace }
 Space of DG coefficients. More...
 
enum class  dg::coo2d : char { dg::coo2d::x = 'x' , dg::coo2d::y = 'y' }
 2d coordinates More...
 
enum class  dg::coo3d : char {
  dg::coo3d::x = 'x' , dg::coo3d::y = 'y' , dg::coo3d::z = 'z' , dg::coo3d::xy = 'a' ,
  dg::coo3d::yz = 'b' , dg::coo3d::xz = 'c'
}
 3d contra- and covariant coordinates More...
 

Functions

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx (const aRealTopology2d< real_type > &g, bc bcx, direction dir=centered)
 Create 2d derivative in x-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx (const aRealTopology2d< real_type > &g, direction dir=centered)
 Create 2d derivative in x-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy (const aRealTopology2d< real_type > &g, bc bcy, direction dir=centered)
 Create 2d derivative in y-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy (const aRealTopology2d< real_type > &g, direction dir=centered)
 Create 2d derivative in y-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX (const aRealTopology2d< real_type > &g, bc bcx)
 Matrix that contains 2d jump terms in X direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY (const aRealTopology2d< real_type > &g, bc bcy)
 Matrix that contains 2d jump terms in Y direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX (const aRealTopology2d< real_type > &g)
 Matrix that contains 2d jump terms in X direction taking boundary conditions from the grid. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY (const aRealTopology2d< real_type > &g)
 Matrix that contains 2d jump terms in Y direction taking boundary conditions from the grid. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX (const aRealTopology3d< real_type > &g, bc bcx)
 Matrix that contains jump terms in X direction in 3D. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY (const aRealTopology3d< real_type > &g, bc bcy)
 Matrix that contains jump terms in Y direction in 3D. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpZ (const aRealTopology3d< real_type > &g, bc bcz)
 Matrix that contains jump terms in Z direction in 3D. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX (const aRealTopology3d< real_type > &g)
 Matrix that contains 3d jump terms in X direction taking boundary conditions from the grid. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY (const aRealTopology3d< real_type > &g)
 Matrix that contains 3d jump terms in Y direction taking boundary conditions from the grid. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpZ (const aRealTopology3d< real_type > &g)
 Matrix that contains 3d jump terms in Z direction taking boundary conditions from the grid. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx (const aRealTopology3d< real_type > &g, bc bcx, direction dir=centered)
 Create 3d derivative in x-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx (const aRealTopology3d< real_type > &g, direction dir=centered)
 Create 3d derivative in x-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy (const aRealTopology3d< real_type > &g, bc bcy, direction dir=centered)
 Create 3d derivative in y-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy (const aRealTopology3d< real_type > &g, direction dir=centered)
 Create 3d derivative in y-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dz (const aRealTopology3d< real_type > &g, bc bcz, direction dir=centered)
 Create 3d derivative in z-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dz (const aRealTopology3d< real_type > &g, direction dir=centered)
 Create 3d derivative in z-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx (const aRealTopologyX2d< real_type > &g, bc bcx, direction dir=centered)
 Create 2d derivative in x-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx (const aRealTopologyX2d< real_type > &g, direction dir=centered)
 Create 2d derivative in x-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy (const aRealTopologyX2d< real_type > &g, bc bcy, direction dir=centered)
 Create 2d derivative in y-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy (const aRealTopologyX2d< real_type > &g, direction dir=centered)
 Create 2d derivative in y-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX (const aRealTopologyX2d< real_type > &g, bc bcx)
 Matrix that contains 2d jump terms in X direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY (const aRealTopologyX2d< real_type > &g, bc bcy)
 Matrix that contains 2d jump terms in Y direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX (const aRealTopologyX2d< real_type > &g)
 Matrix that contains 2d jump terms in X direction taking boundary conditions from the grid. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY (const aRealTopologyX2d< real_type > &g)
 Matrix that contains 2d jump terms in Y direction taking boundary conditions from the grid. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX (const aRealTopologyX3d< real_type > &g, bc bcx)
 Matrix that contains jump terms in X direction in 3D. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY (const aRealTopologyX3d< real_type > &g, bc bcy)
 Matrix that contains jump terms in Y direction in 3D. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpZ (const aRealTopologyX3d< real_type > &g, bc bcz)
 Matrix that contains jump terms in Z direction in 3D. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX (const aRealTopologyX3d< real_type > &g)
 Matrix that contains 3d jump terms in X direction taking boundary conditions from the grid. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY (const aRealTopologyX3d< real_type > &g)
 Matrix that contains 3d jump terms in Y direction taking boundary conditions from the grid. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpZ (const aRealTopologyX3d< real_type > &g)
 Matrix that contains 3d jump terms in Z direction taking boundary conditions from the grid. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx (const aRealTopologyX3d< real_type > &g, bc bcx, direction dir=centered)
 Create 3d derivative in x-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx (const aRealTopologyX3d< real_type > &g, direction dir=centered)
 Create 3d derivative in x-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy (const aRealTopologyX3d< real_type > &g, bc bcy, direction dir=centered)
 Create 3d derivative in y-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy (const aRealTopologyX3d< real_type > &g, direction dir=centered)
 Create 3d derivative in y-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dz (const aRealTopologyX3d< real_type > &g, bc bcz, direction dir=centered)
 Create 3d derivative in z-direction. More...
 
template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dz (const aRealTopologyX3d< real_type > &g, direction dir=centered)
 Create 3d derivative in z-direction. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx (const RealGrid1d< real_type > &g, bc bcx, direction dir=centered)
 Create and assemble a host Matrix for the derivative in 1d. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx (const RealGrid1d< real_type > &g, direction dir=centered)
 Create and assemble a host Matrix for the derivative in 1d. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jump (const RealGrid1d< real_type > &g, bc bcx)
 Create and assemble a host Matrix for the jump in 1d. More...
 
template<class real_type >
EllSparseBlockMat< real_type > dg::create::jump (const RealGrid1d< real_type > &g)
 Create and assemble a host Matrix for the jump in 1d. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx (const aRealMPITopology2d< real_type > &g, bc bcx, direction dir=centered)
 Create a 2d derivative in the x-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy (const aRealMPITopology2d< real_type > &g, bc bcy, direction dir=centered)
 Create a 2d derivative in the y-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX (const aRealMPITopology2d< real_type > &g, bc bcx)
 Create a 2d jump in the x-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY (const aRealMPITopology2d< real_type > &g, bc bcy)
 Create a 2d jump in the y-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx (const aRealMPITopology3d< real_type > &g, bc bcx, direction dir=centered)
 Create a 3d derivative in the x-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy (const aRealMPITopology3d< real_type > &g, bc bcy, direction dir=centered)
 Create a 3d derivative in the y-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dz (const aRealMPITopology3d< real_type > &g, bc bcz, direction dir=centered)
 Create a 3d derivative in the z-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX (const aRealMPITopology3d< real_type > &g, bc bcx)
 Create a 3d jump in the x-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY (const aRealMPITopology3d< real_type > &g, bc bcy)
 Create a 3d jump in the y-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpZ (const aRealMPITopology3d< real_type > &g, bc bcz)
 Create a 3d jump in the z-direction for mpi. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx (const aRealMPITopology2d< real_type > &g, direction dir=centered)
 Create 2d derivative in x-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx (const aRealMPITopology3d< real_type > &g, direction dir=centered)
 Create 3d derivative in x-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX (const aRealMPITopology2d< real_type > &g)
 Create 2d jump in x-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX (const aRealMPITopology3d< real_type > &g)
 Create 3d jump in x-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy (const aRealMPITopology2d< real_type > &g, direction dir=centered)
 Create 2d derivative in y-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy (const aRealMPITopology3d< real_type > &g, direction dir=centered)
 Create 3d derivative in y-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY (const aRealMPITopology2d< real_type > &g)
 Create 2d jump in y-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY (const aRealMPITopology3d< real_type > &g)
 Create 3d jump in y-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dz (const aRealMPITopology3d< real_type > &g, direction dir=centered)
 Create 3d derivative in z-direction. More...
 
template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpZ (const aRealMPITopology3d< real_type > &g)
 Create 3d jump in z-direction. More...
 
static std::string dg::bc2str (bc bcx)
 write a string describing boundary condition to an output stream More...
 
static bc dg::str2bc (std::string s)
 convert a string to a bc More...
 
static bc dg::inverse (bc bound)
 invert boundary condition More...
 
static direction dg::str2direction (std::string s)
 convert a string to a direction More...
 
static std::string dg::direction2str (enum direction dir)
 convert a direciton to string More...
 
static direction dg::inverse (direction dir)
 invert direction More...
 

Detailed Description

\( D_x\), \( D_y\) and \( D_z \)

High level matrix creation functions

Enumeration Type Documentation

◆ bc

enum dg::bc

Switch between boundary conditions.

Enumerator
PER 

periodic boundaries

DIR 

homogeneous dirichlet boundaries

DIR_NEU 

Dirichlet on left, Neumann on right boundary.

NEU_DIR 

Neumann on left, Dirichlet on right boundary.

NEU 

Neumann on both boundaries.

◆ coo2d

enum class dg::coo2d : char
strong

2d coordinates

Enumerator

x direction

y direction

◆ coo3d

enum class dg::coo3d : char
strong

3d contra- and covariant coordinates

Enumerator

x direction

y direction

z direction

xy 

xy plane

yz 

yz plane

xz 

xz plane

◆ direction

Direction of a discrete derivative.

Enumerator
forward 

forward derivative (cell to the right and current cell)

backward 

backward derivative (cell to the left and current cell)

centered 

centered derivative (cell to the left and right and current cell)

◆ space

enum dg::space

Space of DG coefficients.

Enumerator
lspace 

DG Polynomial space "modal values".

xspace 

Configuration space "nodal values".

Function Documentation

◆ bc2str()

static std::string dg::bc2str ( bc  bcx)
inlinestatic

write a string describing boundary condition to an output stream

converts

◆ direction2str()

static std::string dg::direction2str ( enum direction  dir)
inlinestatic

convert a direciton to string

converts

  • forward to "forward"
  • backward to "backward"
  • centered to "centered"
Parameters
dirthe input direction
Returns
a string

◆ dx() [1/14]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx ( const aRealMPITopology2d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create a 2d derivative in the x-direction for mpi.

Parameters
gA 2D mpi grid
bcxboundary condition
dircentered, forward or backward
Returns
A mpi matrix

◆ dx() [2/14]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx ( const aRealMPITopology2d< real_type > &  g,
direction  dir = centered 
)

Create 2d derivative in x-direction.

Parameters
gThe grid on which to create dx (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A mpi matrix

◆ dx() [3/14]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx ( const aRealMPITopology3d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create a 3d derivative in the x-direction for mpi.

Parameters
gA 3D mpi grid
bcxboundary condition
dircentered, forward or backward
Returns
A mpi matrix

◆ dx() [4/14]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dx ( const aRealMPITopology3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in x-direction.

Parameters
gThe grid on which to create dx (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A mpi matrix

◆ dx() [5/14]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx ( const aRealTopology2d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create 2d derivative in x-direction.

Parameters
gThe grid on which to create dx
bcxThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [6/14]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx ( const aRealTopology2d< real_type > &  g,
direction  dir = centered 
)

Create 2d derivative in x-direction.

Parameters
gThe grid on which to create dx (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

This code snippet demonstrates how to derive a function on a device

//define a function to derive
double function(double x, double y){
return sin(x)*sin(y);
}
//create a grid of the domain [0,2]x[0,2] with 20 cells in x and y and 3 polynomial coefficients
dg::Grid2d g2d( 0, 2, 0, 2, 3, 20, 20, dg::DIR);
//declare a device matrix
//create the x derivative on the grid and transfer the matrix to the device
//discretize the function on the grid and transfer the result to the device
const dg::DVec x = dg::construct<dg::DVec>( dg::evaluate( function, g2d));
//allocate memory for the result
//apply the derivative to x and store result in y
//or equivalently
dg::blas2::symv(1., dx, x, 0., y);
void transfer(const MatrixType &x, AnotherMatrixType &y)
; Generic way to copy and/or convert a Matrix type to a different Matrix type
Definition: blas2.h:443
void symv(MatrixType &&M, const ContainerType1 &x, ContainerType2 &y)
Definition: blas2.h:287
EllSparseBlockMat< real_type > dx(const aRealTopology2d< real_type > &g, bc bcx, direction dir=centered)
Create 2d derivative in x-direction.
Definition: derivatives.h:33
@ DIR
homogeneous dirichlet boundaries
Definition: enums.h:17
@ y
y direction
@ x
x direction
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
Evaluate a 1d function on grid coordinates.
Definition: evaluation.h:67
thrust::device_vector< double > DVec
Device Vector. The device can be an OpenMP parallelized cpu or a gpu. This depends on the value of th...
Definition: typedefs.h:23
Ell Sparse Block Matrix format.
Definition: sparseblockmat.h:46

◆ dx() [7/14]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx ( const aRealTopology3d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create 3d derivative in x-direction.

Parameters
gThe grid on which to create dx
bcxThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [8/14]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx ( const aRealTopology3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in x-direction.

Parameters
gThe grid on which to create dx (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [9/14]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx ( const aRealTopologyX2d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create 2d derivative in x-direction.

Parameters
gThe grid on which to create dx
bcxThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [10/14]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx ( const aRealTopologyX2d< real_type > &  g,
direction  dir = centered 
)

Create 2d derivative in x-direction.

Parameters
gThe grid on which to create dx (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [11/14]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx ( const aRealTopologyX3d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create 3d derivative in x-direction.

Parameters
gThe grid on which to create dx
bcxThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [12/14]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dx ( const aRealTopologyX3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in x-direction.

Parameters
gThe grid on which to create dx (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dx() [13/14]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx ( const RealGrid1d< real_type > &  g,
bc  bcx,
direction  dir = centered 
)

Create and assemble a host Matrix for the derivative in 1d.

Parameters
g1D grid
bcxboundary condition
dirThe direction of the first derivative
Returns
Host Matrix

◆ dx() [14/14]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dx ( const RealGrid1d< real_type > &  g,
direction  dir = centered 
)

Create and assemble a host Matrix for the derivative in 1d.

Take the boundary condition from the grid

Parameters
g1D grid
dirThe direction of the first derivative
Returns
Host Matrix

◆ dy() [1/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy ( const aRealMPITopology2d< real_type > &  g,
bc  bcy,
direction  dir = centered 
)

Create a 2d derivative in the y-direction for mpi.

Parameters
gA 2D mpi grid
bcyboundary condition
dircentered, forward or backward
Returns
A mpi matrix

◆ dy() [2/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy ( const aRealMPITopology2d< real_type > &  g,
direction  dir = centered 
)

Create 2d derivative in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A mpi matrix

◆ dy() [3/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy ( const aRealMPITopology3d< real_type > &  g,
bc  bcy,
direction  dir = centered 
)

Create a 3d derivative in the y-direction for mpi.

Parameters
gA 3D mpi grid
bcyboundary condition
dircentered, forward or backward
Returns
A mpi matrix

◆ dy() [4/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dy ( const aRealMPITopology3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A mpi matrix

◆ dy() [5/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy ( const aRealTopology2d< real_type > &  g,
bc  bcy,
direction  dir = centered 
)

Create 2d derivative in y-direction.

Parameters
gThe grid on which to create dy
bcyThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [6/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy ( const aRealTopology2d< real_type > &  g,
direction  dir = centered 
)

Create 2d derivative in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [7/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy ( const aRealTopology3d< real_type > &  g,
bc  bcy,
direction  dir = centered 
)

Create 3d derivative in y-direction.

Parameters
gThe grid on which to create dy
bcyThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [8/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dy ( const aRealTopology3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [9/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy ( const aRealTopologyX2d< real_type > &  g,
bc  bcy,
direction  dir = centered 
)

Create 2d derivative in y-direction.

Parameters
gThe grid on which to create dy
bcyThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [10/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy ( const aRealTopologyX2d< real_type > &  g,
direction  dir = centered 
)

Create 2d derivative in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [11/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy ( const aRealTopologyX3d< real_type > &  g,
bc  bcy,
direction  dir = centered 
)

Create 3d derivative in y-direction.

Parameters
gThe grid on which to create dy
bcyThe boundary condition
dirThe direction of the first derivative
Returns
A host matrix

◆ dy() [12/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dy ( const aRealTopologyX3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A host matrix

◆ dz() [1/6]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dz ( const aRealMPITopology3d< real_type > &  g,
bc  bcz,
direction  dir = centered 
)

Create a 3d derivative in the z-direction for mpi.

Parameters
gA 3D mpi grid
bczboundary condition
dircentered, forward or backward
Returns
A mpi matrix

◆ dz() [2/6]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::dz ( const aRealMPITopology3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in z-direction.

Parameters
gThe grid on which to create dz (boundary condition is taken from here)
dirThe direction of the first derivative
Returns
A mpi matrix

◆ dz() [3/6]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dz ( const aRealTopology3d< real_type > &  g,
bc  bcz,
direction  dir = centered 
)

Create 3d derivative in z-direction.

Parameters
gThe grid on which to create dz
bczThe boundary condition
dirThe direction of the stencil
Returns
A host matrix

◆ dz() [4/6]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::dz ( const aRealTopology3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in z-direction.

Parameters
gThe grid on which to create dz (boundary condition is taken from here)
dirThe direction of the stencil
Returns
A host matrix

◆ dz() [5/6]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dz ( const aRealTopologyX3d< real_type > &  g,
bc  bcz,
direction  dir = centered 
)

Create 3d derivative in z-direction.

Parameters
gThe grid on which to create dz
bczThe boundary condition
dirThe direction of the stencil
Returns
A host matrix

◆ dz() [6/6]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::dz ( const aRealTopologyX3d< real_type > &  g,
direction  dir = centered 
)

Create 3d derivative in z-direction.

Parameters
gThe grid on which to create dz (boundary condition is taken from here)
dirThe direction of the stencil
Returns
A host matrix

◆ inverse() [1/2]

static bc dg::inverse ( bc  bound)
inlinestatic

invert boundary condition

Parameters
boundboundary condition to invert
Returns
NEU for DIR, DIR for NEU, NEU_DIR for DIR_NEU, DIR_NEU for NEU_DIR and PER for PER

◆ inverse() [2/2]

static direction dg::inverse ( direction  dir)
inlinestatic

invert direction

Parameters
dirdirection to invert
Returns
backward for forward, forward for backward, centered for centered

◆ jump() [1/2]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jump ( const RealGrid1d< real_type > &  g)

Create and assemble a host Matrix for the jump in 1d.

Take the boundary condition from the grid

Parameters
g1D grid
Returns
Host Matrix

◆ jump() [2/2]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jump ( const RealGrid1d< real_type > &  g,
bc  bcx 
)

Create and assemble a host Matrix for the jump in 1d.

Parameters
g1D grid
bcxboundary condition
Returns
Host Matrix

◆ jumpX() [1/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX ( const aRealMPITopology2d< real_type > &  g)

Create 2d jump in x-direction.

Parameters
gThe grid on which to create jump (boundary condition is taken from here)
Returns
A mpi matrix

◆ jumpX() [2/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX ( const aRealMPITopology2d< real_type > &  g,
bc  bcx 
)

Create a 2d jump in the x-direction for mpi.

Parameters
gA 2D mpi grid
bcxboundary condition
Returns
A mpi matrix

◆ jumpX() [3/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX ( const aRealMPITopology3d< real_type > &  g)

Create 3d jump in x-direction.

Parameters
gThe grid on which to create jump (boundary condition is taken from here)
Returns
A mpi matrix

◆ jumpX() [4/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpX ( const aRealMPITopology3d< real_type > &  g,
bc  bcx 
)

Create a 3d jump in the x-direction for mpi.

Parameters
gA 3D mpi grid
bcxboundary condition
Returns
A mpi matrix

◆ jumpX() [5/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX ( const aRealTopology2d< real_type > &  g)

Matrix that contains 2d jump terms in X direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpX() [6/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX ( const aRealTopology2d< real_type > &  g,
bc  bcx 
)

Matrix that contains 2d jump terms in X direction.

Parameters
ggrid
bcxboundary condition in x
Returns
A host matrix

◆ jumpX() [7/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX ( const aRealTopology3d< real_type > &  g)

Matrix that contains 3d jump terms in X direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpX() [8/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpX ( const aRealTopology3d< real_type > &  g,
bc  bcx 
)

Matrix that contains jump terms in X direction in 3D.

Parameters
gThe 3D grid
bcxboundary condition in x
Returns
A host matrix

◆ jumpX() [9/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX ( const aRealTopologyX2d< real_type > &  g)

Matrix that contains 2d jump terms in X direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpX() [10/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX ( const aRealTopologyX2d< real_type > &  g,
bc  bcx 
)

Matrix that contains 2d jump terms in X direction.

Parameters
ggrid
bcxboundary condition in x
Returns
A host matrix

◆ jumpX() [11/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX ( const aRealTopologyX3d< real_type > &  g)

Matrix that contains 3d jump terms in X direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpX() [12/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpX ( const aRealTopologyX3d< real_type > &  g,
bc  bcx 
)

Matrix that contains jump terms in X direction in 3D.

Parameters
gThe 3D grid
bcxboundary condition in x
Returns
A host matrix

◆ jumpY() [1/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY ( const aRealMPITopology2d< real_type > &  g)

Create 2d jump in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
Returns
A mpi matrix

◆ jumpY() [2/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY ( const aRealMPITopology2d< real_type > &  g,
bc  bcy 
)

Create a 2d jump in the y-direction for mpi.

Parameters
gA 2D mpi grid
bcyboundary condition
Returns
A mpi matrix

◆ jumpY() [3/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY ( const aRealMPITopology3d< real_type > &  g)

Create 3d jump in y-direction.

Parameters
gThe grid on which to create dy (boundary condition is taken from here)
Returns
A mpi matrix

◆ jumpY() [4/12]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpY ( const aRealMPITopology3d< real_type > &  g,
bc  bcy 
)

Create a 3d jump in the y-direction for mpi.

Parameters
gA 3D mpi grid
bcyboundary condition
Returns
A mpi matrix

◆ jumpY() [5/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY ( const aRealTopology2d< real_type > &  g)

Matrix that contains 2d jump terms in Y direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpY() [6/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY ( const aRealTopology2d< real_type > &  g,
bc  bcy 
)

Matrix that contains 2d jump terms in Y direction.

Parameters
ggrid
bcyboundary condition in y
Returns
A host matrix

◆ jumpY() [7/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY ( const aRealTopology3d< real_type > &  g)

Matrix that contains 3d jump terms in Y direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpY() [8/12]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpY ( const aRealTopology3d< real_type > &  g,
bc  bcy 
)

Matrix that contains jump terms in Y direction in 3D.

Parameters
gThe 3D grid
bcyboundary condition in y
Returns
A host matrix

◆ jumpY() [9/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY ( const aRealTopologyX2d< real_type > &  g)

Matrix that contains 2d jump terms in Y direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpY() [10/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY ( const aRealTopologyX2d< real_type > &  g,
bc  bcy 
)

Matrix that contains 2d jump terms in Y direction.

Parameters
ggrid
bcyboundary condition in y
Returns
A host matrix

◆ jumpY() [11/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY ( const aRealTopologyX3d< real_type > &  g)

Matrix that contains 3d jump terms in Y direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpY() [12/12]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpY ( const aRealTopologyX3d< real_type > &  g,
bc  bcy 
)

Matrix that contains jump terms in Y direction in 3D.

Parameters
gThe 3D grid
bcyboundary condition in y
Returns
A host matrix

◆ jumpZ() [1/6]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpZ ( const aRealMPITopology3d< real_type > &  g)

Create 3d jump in z-direction.

Parameters
gThe grid on which to create dz (boundary condition is taken from here)
Returns
A mpi matrix

◆ jumpZ() [2/6]

template<class real_type >
RowColDistMat< EllSparseBlockMat< real_type >, CooSparseBlockMat< real_type >, NNCH< real_type > > dg::create::jumpZ ( const aRealMPITopology3d< real_type > &  g,
bc  bcz 
)

Create a 3d jump in the z-direction for mpi.

Parameters
gA 3D mpi grid
bczboundary condition
Returns
A mpi matrix

◆ jumpZ() [3/6]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpZ ( const aRealTopology3d< real_type > &  g)

Matrix that contains 3d jump terms in Z direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpZ() [4/6]

template<class real_type >
EllSparseBlockMat< real_type > dg::create::jumpZ ( const aRealTopology3d< real_type > &  g,
bc  bcz 
)

Matrix that contains jump terms in Z direction in 3D.

Parameters
gThe 3D grid
bczboundary condition in z
Returns
A host matrix

◆ jumpZ() [5/6]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpZ ( const aRealTopologyX3d< real_type > &  g)

Matrix that contains 3d jump terms in Z direction taking boundary conditions from the grid.

Parameters
ggrid
Returns
A host matrix

◆ jumpZ() [6/6]

template<class real_type >
Composite< EllSparseBlockMat< real_type > > dg::create::jumpZ ( const aRealTopologyX3d< real_type > &  g,
bc  bcz 
)

Matrix that contains jump terms in Z direction in 3D.

Parameters
gThe 3D grid
bczboundary condition in z
Returns
A host matrix

◆ str2bc()

static bc dg::str2bc ( std::string  s)
inlinestatic

convert a string to a bc

converts

  • PER, per, periodic, PERIODIC and Periodic to dg::PER
  • DIR, dir, dirichlet, DIRICHLET and Dirichlet to dg::DIR
  • NEU, neu, neumann, NEUMANN and Neumann to dg::NEU
  • NEU_DIR and neu_dir to dg::NEU_DIR
  • DIR_NEU and dir_neu to dg::DIR_NEU
Parameters
sthe input string
Returns
a valid boundary condition
Exceptions
std::runtime_errorif string doesn't match any of the above

◆ str2direction()

static direction dg::str2direction ( std::string  s)
inlinestatic

convert a string to a direction

converts

  • "forward" to forward
  • "backward" to backward
  • "centered" to centered
Parameters
sthe input string
Returns
a valid direction
Exceptions
std::runtime_errorif string doesn't match any of the above