Discontinuous Galerkin Library
#include "dg/algorithm.h"
Collaboration diagram for create stencils:

Functions

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::window_stencil (unsigned window_size, const RealGrid1d< real_type > &g, dg::bc bcx)
 A 1d centered window stencil. More...
 
template<class real_type >
dg::IHMatrix_t< real_type > dg::create::limiter_stencil (const RealGrid1d< real_type > &g, dg::bc bound)
 A stencil for the dg Slope limiter. More...
 
template<class real_type >
dg::IHMatrix_t< real_type > dg::create::window_stencil (std::array< int, 2 > window_size, const aRealTopology2d< real_type > &g, dg::bc bcx, dg::bc bcy)
 A 2d centered window stencil. More...
 
template<class real_type >
dg::IHMatrix_t< real_type > dg::create::limiter_stencil (enum coo3d direction, const aRealTopology2d< real_type > &g, dg::bc bound)
 A stencil for the dg Slope limiter. More...
 
template<class real_type >
dg::IHMatrix_t< real_type > dg::create::limiter_stencil (enum coo3d direction, const aRealTopology3d< real_type > &g, dg::bc bound)
 A stencil for the dg Slope limiter. More...
 
template<class real_type >
dg::IHMatrix_t< real_type > dg::create::window_stencil (std::array< int, 2 > window_size, const aRealTopology3d< real_type > &g, dg::bc bcx, dg::bc bcy)
 A 2d centered window stencil. More...
 
template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::window_stencil (std::array< int, 2 > window_size, const aRealMPITopology2d< real_type > &g, dg::bc bcx, dg::bc bcy)
 A 2d centered window stencil. More...
 
template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::window_stencil (std::array< int, 2 > window_size, const aRealMPITopology3d< real_type > &g, dg::bc bcx, dg::bc bcy)
 A 2d centered window stencil. More...
 
template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::limiter_stencil (enum coo3d direction, const aRealMPITopology2d< real_type > &g, dg::bc bound)
 A stencil for the dg Slope limiter. More...
 
template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::limiter_stencil (enum coo3d direction, const aRealMPITopology3d< real_type > &g, dg::bc bound)
 A stencil for the dg Slope limiter. More...
 

Detailed Description

Function Documentation

◆ limiter_stencil() [1/5]

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::limiter_stencil ( const RealGrid1d< real_type > &  g,
dg::bc  bound 
)

A stencil for the dg Slope limiter.

This stencil is specifically made to implement a dg slope limiter

Parameters
gthe grid, grid.n() must be greater than 0
boundDetermine what to do at the boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are multiplied with -1
Returns
A sparse matrix with 0 or 3n entries per row (the zero coefficient has 3n entries, the remaining coefficients have 0). The values contain the transformation matrices necessary to implement the filter
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil dg::CSRSlopeLimiter
Attention
Do not sort the matrix as then the ordering is destroyed
Note
Does unfortunately not work very well in more than 1 dimension

◆ limiter_stencil() [2/5]

template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::limiter_stencil ( enum coo3d  direction,
const aRealMPITopology2d< real_type > &  g,
dg::bc  bound 
)

A stencil for the dg Slope limiter.

This stencil is specifically made to implement a dg slope limiter

Parameters
gthe grid, grid.n() must be greater than 0
boundDetermine what to do at the boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are multiplied with -1
Returns
A sparse matrix with 0 or 3n entries per row (the zero coefficient has 3n entries, the remaining coefficients have 0). The values contain the transformation matrices necessary to implement the filter
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil dg::CSRSlopeLimiter
Attention
Do not sort the matrix as then the ordering is destroyed
Note
Does unfortunately not work very well in more than 1 dimension
Parameters
directionThe limiter acts on only 1 direction at a time

◆ limiter_stencil() [3/5]

template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::limiter_stencil ( enum coo3d  direction,
const aRealMPITopology3d< real_type > &  g,
dg::bc  bound 
)

A stencil for the dg Slope limiter.

This stencil is specifically made to implement a dg slope limiter

Parameters
gthe grid, grid.n() must be greater than 0
boundDetermine what to do at the boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are multiplied with -1
Returns
A sparse matrix with 0 or 3n entries per row (the zero coefficient has 3n entries, the remaining coefficients have 0). The values contain the transformation matrices necessary to implement the filter
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil dg::CSRSlopeLimiter
Attention
Do not sort the matrix as then the ordering is destroyed
Note
Does unfortunately not work very well in more than 1 dimension
Parameters
directionThe limiter acts on only 1 direction at a time

◆ limiter_stencil() [4/5]

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::limiter_stencil ( enum coo3d  direction,
const aRealTopology2d< real_type > &  g,
dg::bc  bound 
)

A stencil for the dg Slope limiter.

This stencil is specifically made to implement a dg slope limiter

Parameters
gthe grid, grid.n() must be greater than 0
boundDetermine what to do at the boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are multiplied with -1
Returns
A sparse matrix with 0 or 3n entries per row (the zero coefficient has 3n entries, the remaining coefficients have 0). The values contain the transformation matrices necessary to implement the filter
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil dg::CSRSlopeLimiter
Attention
Do not sort the matrix as then the ordering is destroyed
Note
Does unfortunately not work very well in more than 1 dimension
Parameters
directionThe limiter acts on only 1 direction at a time

◆ limiter_stencil() [5/5]

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::limiter_stencil ( enum coo3d  direction,
const aRealTopology3d< real_type > &  g,
dg::bc  bound 
)

A stencil for the dg Slope limiter.

This stencil is specifically made to implement a dg slope limiter

Parameters
gthe grid, grid.n() must be greater than 0
boundDetermine what to do at the boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are multiplied with -1
Returns
A sparse matrix with 0 or 3n entries per row (the zero coefficient has 3n entries, the remaining coefficients have 0). The values contain the transformation matrices necessary to implement the filter
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil dg::CSRSlopeLimiter
Attention
Do not sort the matrix as then the ordering is destroyed
Note
Does unfortunately not work very well in more than 1 dimension
Parameters
directionThe limiter acts on only 1 direction at a time

◆ window_stencil() [1/5]

template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::window_stencil ( std::array< int, 2 >  window_size,
const aRealMPITopology2d< real_type > &  g,
dg::bc  bcx,
dg::bc  bcy 
)

A 2d centered window stencil.

Create a CSR Matrix containing a centered fixed sized window on each row as the tensor product of two 1d stencils.

Parameters
window_sizeThe number of points involved in the window in each dimension. First entry is x-dimension, 2nd is y-dimension. If even, the number of points left is 1 higher than right.
gthe grid
bcxDetermine what to do at the x-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
bcyDetermine what to do at the y-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
Returns
A sparse matrix with window_size[0]*window_size[1] entries per row, each with value 1
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil

◆ window_stencil() [2/5]

template<class real_type >
dg::MIHMatrix_t< real_type > dg::create::window_stencil ( std::array< int, 2 >  window_size,
const aRealMPITopology3d< real_type > &  g,
dg::bc  bcx,
dg::bc  bcy 
)

A 2d centered window stencil.

Create a CSR Matrix containing a centered fixed sized window on each row as the tensor product of two 1d stencils and the identity in the third dimension

Parameters
window_sizeThe number of points involved in the window in each dimension. First entry is x-dimension, 2nd is y-dimension. If even, the number of points left is 1 higher than right.
gthe grid
bcxDetermine what to do at the x-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
bcyDetermine what to do at the y-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
Returns
A sparse matrix with window_size[0]*window_size[1] entries per row, each with value 1
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil

◆ window_stencil() [3/5]

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::window_stencil ( std::array< int, 2 >  window_size,
const aRealTopology2d< real_type > &  g,
dg::bc  bcx,
dg::bc  bcy 
)

A 2d centered window stencil.

Create a CSR Matrix containing a centered fixed sized window on each row as the tensor product of two 1d stencils.

Parameters
window_sizeThe number of points involved in the window in each dimension. First entry is x-dimension, 2nd is y-dimension. If even, the number of points left is 1 higher than right.
gthe grid
bcxDetermine what to do at the x-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
bcyDetermine what to do at the y-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
Returns
A sparse matrix with window_size[0]*window_size[1] entries per row, each with value 1
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil

◆ window_stencil() [4/5]

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::window_stencil ( std::array< int, 2 >  window_size,
const aRealTopology3d< real_type > &  g,
dg::bc  bcx,
dg::bc  bcy 
)

A 2d centered window stencil.

Create a CSR Matrix containing a centered fixed sized window on each row as the tensor product of two 1d stencils and the identity in the third dimension

Parameters
window_sizeThe number of points involved in the window in each dimension. First entry is x-dimension, 2nd is y-dimension. If even, the number of points left is 1 higher than right.
gthe grid
bcxDetermine what to do at the x-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
bcyDetermine what to do at the y-boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
Returns
A sparse matrix with window_size[0]*window_size[1] entries per row, each with value 1
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil

◆ window_stencil() [5/5]

template<class real_type >
dg::IHMatrix_t< real_type > dg::create::window_stencil ( unsigned  window_size,
const RealGrid1d< real_type > &  g,
dg::bc  bcx 
)

A 1d centered window stencil.

Create a CSR Matrix containing a centered fixed sized window on each row.

Parameters
window_sizeThe number of points involved in the window. If even, the number of points left is 1 higher than right.
gthe grid
bcxDetermine what to do at the boundary. For Neumann conditions the boundary points are simply duplicated, For Dirichlet they are duplicated as well and the values are set to -1 instead of 1.
Returns
A sparse matrix with window_size entries per row, each with value 1
Template Parameters
real_typeThe value type of the matrix
See also
dg::blas2::stencil