Discontinuous Galerkin Library
#include "dg/algorithm.h"
Loading...
Searching...
No Matches
Collaboration diagram for Fast interpolation:

Classes

struct  dg::MultiMatrix< MatrixType, ContainerType >
 Struct that applies given matrices one after the other. More...
 

Functions

template<class real_type >
dg::HMatrix_t< real_type > dg::create::fast_interpolation1d (const RealGrid1d< real_type > &t, unsigned multiplyn, unsigned multiplyNx)
 Create interpolation matrix for integer multipliers.
 
template<class real_type >
dg::HMatrix_t< real_type > dg::create::fast_projection1d (const RealGrid1d< real_type > &t, unsigned dividen, unsigned divideNx)
 Create projecton matrix for integer dividers.
 
template<class real_type >
dg::HMatrix_t< real_type > dg::create::fast_transform1d (const dg::SquareMatrix< real_type > &opx, const RealGrid1d< real_type > &t)
 Create a block-diagonal matrix.
 
template<class real_type , size_t Nd>
EllSparseBlockMat< real_type, thrust::host_vector > dg::create::fast_interpolation (unsigned coord, const aRealTopology< real_type, Nd > &t, unsigned multiplyn, unsigned multiplyNx)
 Create interpolation matrix for integer multipliers.
 
template<class real_type , size_t Nd>
EllSparseBlockMat< real_type, thrust::host_vector > dg::create::fast_projection (unsigned coord, const aRealTopology< real_type, Nd > &t, unsigned dividen, unsigned divideNx)
 Create projecton matrix for integer dividers.
 
template<class real_type , size_t Nd>
EllSparseBlockMat< real_type, thrust::host_vector > dg::create::fast_transform (unsigned coord, const dg::SquareMatrix< real_type > &opx, const aRealTopology< real_type, Nd > &t)
 Create a block-diagonal matrix.
 
template<class real_type , size_t Nd>
dg::MHMatrix_t< real_type > dg::create::fast_interpolation (unsigned coord, const aRealMPITopology< real_type, Nd > &t, unsigned multiplyn, unsigned multiplyNx)
 Create interpolation matrix for integer multipliers.
 
template<class real_type , size_t Nd>
dg::MHMatrix_t< real_type > dg::create::fast_projection (unsigned coord, const aRealMPITopology< real_type, Nd > &t, unsigned dividen, unsigned divideNx)
 Create projecton matrix for integer dividers.
 
template<class real_type , size_t Nd>
MHMatrix_t< real_type > dg::create::fast_transform (unsigned coord, dg::SquareMatrix< real_type > opx, const aRealMPITopology< real_type, Nd > &t)
 Create a block-diagonal matrix.
 
template<class Topology >
auto dg::create::fast_interpolation (const Topology &t, unsigned multiplyn, unsigned multiplyNx, unsigned multiplyNy)
 Create interpolation matrix for integer multipliers in the first 2 grid dimensions.
 
template<class Topology >
auto dg::create::fast_projection (const Topology &t, unsigned dividen, unsigned divideNx, unsigned divideNy)
 Create projection matrix for integer dividers in the first 2 grid dimensions.
 
template<class Topology >
auto dg::create::fast_transform (const dg::SquareMatrix< typename Topology::value_type > &opx, const dg::SquareMatrix< typename Topology::value_type > &opy, const Topology &t)
 Create transform matrix in the first 2 grid dimensions.
 

Detailed Description

Function Documentation

◆ fast_interpolation() [1/3]

template<class Topology >
auto dg::create::fast_interpolation ( const Topology & t,
unsigned multiplyn,
unsigned multiplyNx,
unsigned multiplyNy )

Create interpolation matrix for integer multipliers in the first 2 grid dimensions.

When creating an interpolation from a given dg grid to one that has an integer multiple of cells and/or polynomial coefficients, the resulting interpolation matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose interpolation function, especially since it requires no communication from neighboring cells

See also
dg::create::interpolation
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/coarse) grid
multiplyninteger multiplier, the new grid has n*multiplyn polynomial coefficients
multiplyNxinteger multiplier, the new grid has Nx*multiplyNx points
multiplyNyinteger multiplier, the new grid has Ny*multiplyNy points

◆ fast_interpolation() [2/3]

template<class real_type , size_t Nd>
dg::MHMatrix_t< real_type > dg::create::fast_interpolation ( unsigned coord,
const aRealMPITopology< real_type, Nd > & t,
unsigned multiplyn,
unsigned multiplyNx )

Create interpolation matrix for integer multipliers.

When creating an interpolation from a given dg grid to one that has an integer multiple of cells and/or polynomial coefficients, the resulting interpolation matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose interpolation function, especially since it requires no communication from neighboring cells

See also
dg::create::interpolation
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/coarse) grid
multiplyninteger multiplier, the new grid has n*multiplyn polynomial coefficients
multiplyNxinteger multiplier, the new grid has Nx*multiplyNx points
Parameters
coordThe direction inside the structured grid to which to apply the sparse block matrix.

◆ fast_interpolation() [3/3]

template<class real_type , size_t Nd>
EllSparseBlockMat< real_type, thrust::host_vector > dg::create::fast_interpolation ( unsigned coord,
const aRealTopology< real_type, Nd > & t,
unsigned multiplyn,
unsigned multiplyNx )

Create interpolation matrix for integer multipliers.

When creating an interpolation from a given dg grid to one that has an integer multiple of cells and/or polynomial coefficients, the resulting interpolation matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose interpolation function, especially since it requires no communication from neighboring cells

See also
dg::create::interpolation
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/coarse) grid
multiplyninteger multiplier, the new grid has n*multiplyn polynomial coefficients
multiplyNxinteger multiplier, the new grid has Nx*multiplyNx points
Parameters
coordThe direction inside the structured grid to which to apply the sparse block matrix.

◆ fast_interpolation1d()

template<class real_type >
dg::HMatrix_t< real_type > dg::create::fast_interpolation1d ( const RealGrid1d< real_type > & t,
unsigned multiplyn,
unsigned multiplyNx )

Create interpolation matrix for integer multipliers.

When creating an interpolation from a given dg grid to one that has an integer multiple of cells and/or polynomial coefficients, the resulting interpolation matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose interpolation function, especially since it requires no communication from neighboring cells

See also
dg::create::interpolation
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/coarse) grid
multiplyninteger multiplier, the new grid has n*multiplyn polynomial coefficients
multiplyNxinteger multiplier, the new grid has Nx*multiplyNx points

◆ fast_projection() [1/3]

template<class Topology >
auto dg::create::fast_projection ( const Topology & t,
unsigned dividen,
unsigned divideNx,
unsigned divideNy )

Create projection matrix for integer dividers in the first 2 grid dimensions.

When creating a projection from a given dg grid to one that has an integer division of cells and/or polynomial coefficients, the resulting projection matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose projection function, especially since it requires no communication from neighboring cells

See also
dg::create::projection
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/fine) grid
divideninteger divisor, the new grid has n/multiplyn polynomial coefficients
divideNxinteger divisor, the new grid has Nx/multiplyNx points
divideNyinteger multiplier, the new grid has Ny/divideNy points

◆ fast_projection() [2/3]

template<class real_type , size_t Nd>
dg::MHMatrix_t< real_type > dg::create::fast_projection ( unsigned coord,
const aRealMPITopology< real_type, Nd > & t,
unsigned dividen,
unsigned divideNx )

Create projecton matrix for integer dividers.

When creating a projection from a given dg grid to one that has an integer division of cells and/or polynomial coefficients, the resulting projection matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose projection function, especially since it requires no communication from neighboring cells

See also
dg::create::projection
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/fine) grid
divideninteger divisor, the new grid has n/multiplyn polynomial coefficients
divideNxinteger divisor, the new grid has Nx/multiplyNx points
Parameters
coordThe direction inside the structured grid to which to apply the sparse block matrix.

◆ fast_projection() [3/3]

template<class real_type , size_t Nd>
EllSparseBlockMat< real_type, thrust::host_vector > dg::create::fast_projection ( unsigned coord,
const aRealTopology< real_type, Nd > & t,
unsigned dividen,
unsigned divideNx )

Create projecton matrix for integer dividers.

When creating a projection from a given dg grid to one that has an integer division of cells and/or polynomial coefficients, the resulting projection matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose projection function, especially since it requires no communication from neighboring cells

See also
dg::create::projection
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/fine) grid
divideninteger divisor, the new grid has n/multiplyn polynomial coefficients
divideNxinteger divisor, the new grid has Nx/multiplyNx points
Parameters
coordThe direction inside the structured grid to which to apply the sparse block matrix.

◆ fast_projection1d()

template<class real_type >
dg::HMatrix_t< real_type > dg::create::fast_projection1d ( const RealGrid1d< real_type > & t,
unsigned dividen,
unsigned divideNx )

Create projecton matrix for integer dividers.

When creating a projection from a given dg grid to one that has an integer division of cells and/or polynomial coefficients, the resulting projection matrix fits into our dg::EllSparseBlockMat format, which is much faster to apply than the full sparse matrix format from the general purpose projection function, especially since it requires no communication from neighboring cells

See also
dg::create::projection
For a derivation of the coefficients consult the dg manual Introduction to dg methods
Template Parameters
real_typea floating point type
Returns
a matrix that when applied to vectors on the old grid produces a vector on the new grid
Parameters
tThe existing (old/fine) grid
divideninteger divisor, the new grid has n/multiplyn polynomial coefficients
divideNxinteger divisor, the new grid has Nx/multiplyNx points

◆ fast_transform() [1/3]

template<class Topology >
auto dg::create::fast_transform ( const dg::SquareMatrix< typename Topology::value_type > & opx,
const dg::SquareMatrix< typename Topology::value_type > & opy,
const Topology & t )

Create transform matrix in the first 2 grid dimensions.

Create a block-diagonal matrix.

i.e. a matrix that has an \( n \times n \) block on its diagonal

\[ M = \begin{pmatrix} B & & & & & \\ & B & & & & \\ & & B & & & \\ & & & B & & \\ & & &...& & \end{pmatrix} \]

Block diagonal matrices fit into our dg::EllSparseBlockMat format, which is much faster to apply than a general sparse matrix, especially since it requires no communication from neighboring cells

Note
We use this function in combination with dg::DLT::forward() to create a forward transformation from configuration to Legendre space (or from nodal to modal values) in dg::forward_transform
Template Parameters
real_typea floating point type
Returns
a block diagonal matrix
Parameters
opxthe block B
tThe grid determines the number of rows and columns
opythe block B for the y transform

◆ fast_transform() [2/3]

template<class real_type , size_t Nd>
EllSparseBlockMat< real_type, thrust::host_vector > dg::create::fast_transform ( unsigned coord,
const dg::SquareMatrix< real_type > & opx,
const aRealTopology< real_type, Nd > & t )

Create a block-diagonal matrix.

i.e. a matrix that has an \( n \times n \) block on its diagonal

\[ M = \begin{pmatrix} B & & & & & \\ & B & & & & \\ & & B & & & \\ & & & B & & \\ & & &...& & \end{pmatrix} \]

Block diagonal matrices fit into our dg::EllSparseBlockMat format, which is much faster to apply than a general sparse matrix, especially since it requires no communication from neighboring cells

Note
We use this function in combination with dg::DLT::forward() to create a forward transformation from configuration to Legendre space (or from nodal to modal values) in dg::forward_transform
Template Parameters
real_typea floating point type
Returns
a block diagonal matrix
Parameters
opxthe block B
tThe grid determines the number of rows and columns
Parameters
coordThe direction inside the structured grid to which to apply the sparse block matrix.

◆ fast_transform() [3/3]

template<class real_type , size_t Nd>
MHMatrix_t< real_type > dg::create::fast_transform ( unsigned coord,
dg::SquareMatrix< real_type > opx,
const aRealMPITopology< real_type, Nd > & t )

Create a block-diagonal matrix.

i.e. a matrix that has an \( n \times n \) block on its diagonal

\[ M = \begin{pmatrix} B & & & & & \\ & B & & & & \\ & & B & & & \\ & & & B & & \\ & & &...& & \end{pmatrix} \]

Block diagonal matrices fit into our dg::EllSparseBlockMat format, which is much faster to apply than a general sparse matrix, especially since it requires no communication from neighboring cells

Note
We use this function in combination with dg::DLT::forward() to create a forward transformation from configuration to Legendre space (or from nodal to modal values) in dg::forward_transform
Template Parameters
real_typea floating point type
Returns
a block diagonal matrix
Parameters
opxthe block B
tThe grid determines the number of rows and columns
Parameters
coordThe direction inside the structured grid to which to apply the sparse block matrix.

◆ fast_transform1d()

template<class real_type >
dg::HMatrix_t< real_type > dg::create::fast_transform1d ( const dg::SquareMatrix< real_type > & opx,
const RealGrid1d< real_type > & t )

Create a block-diagonal matrix.

i.e. a matrix that has an \( n \times n \) block on its diagonal

\[ M = \begin{pmatrix} B & & & & & \\ & B & & & & \\ & & B & & & \\ & & & B & & \\ & & &...& & \end{pmatrix} \]

Block diagonal matrices fit into our dg::EllSparseBlockMat format, which is much faster to apply than a general sparse matrix, especially since it requires no communication from neighboring cells

Note
We use this function in combination with dg::DLT::forward() to create a forward transformation from configuration to Legendre space (or from nodal to modal values) in dg::forward_transform
Template Parameters
real_typea floating point type
Returns
a block diagonal matrix
Parameters
opxthe block B
tThe grid determines the number of rows and columns