Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
\( I \) and \( P = I^\dagger\) More...
Namespaces | |
namespace | dg::create |
Contains functions used for matrix creation. | |
Functions | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_interpolation (const RealGrid1d< real_type > &t, unsigned multiplyn, unsigned multiplyNx) |
Create interpolation matrix for integer multipliers. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_projection (const RealGrid1d< real_type > &t, unsigned dividen, unsigned divideNx) |
Create projecton matrix for integer dividers. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_transform (dg::Operator< real_type > opx, const RealGrid1d< real_type > &t) |
Create a block-diagonal matrix. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_interpolation (enum coo3d direction, const aRealTopology2d< real_type > &t, unsigned multiplyn, unsigned multiplyNx) |
Create interpolation matrix for integer multipliers. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_projection (enum coo3d direction, const aRealTopology2d< real_type > &t, unsigned dividen, unsigned divideNx) |
Create projecton matrix for integer dividers. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_transform (enum coo3d direction, dg::Operator< real_type > opx, const aRealTopology2d< real_type > &t) |
Create a block-diagonal matrix. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_interpolation (enum coo3d direction, const aRealTopology3d< real_type > &t, unsigned multiplyn, unsigned multiplyNx) |
Create interpolation matrix for integer multipliers. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_projection (enum coo3d direction, const aRealTopology3d< real_type > &t, unsigned dividen, unsigned divideNx) |
Create projecton matrix for integer dividers. More... | |
template<class real_type > | |
dg::HMatrix_t< real_type > | dg::create::fast_transform (enum coo3d direction, dg::Operator< real_type > opx, const aRealTopology3d< real_type > &t) |
Create a block-diagonal matrix. More... | |
template<class real_type > | |
dg::MHMatrix_t< real_type > | dg::create::fast_interpolation (enum coo3d direction, const aRealMPITopology2d< real_type > &t, unsigned multiplyn, unsigned multiplyNx) |
Create interpolation matrix for integer multipliers. More... | |
template<class real_type > | |
dg::MHMatrix_t< real_type > | dg::create::fast_projection (enum coo3d direction, const aRealMPITopology2d< real_type > &t, unsigned dividen, unsigned divideNx) |
Create projecton matrix for integer dividers. More... | |
template<class real_type > | |
MHMatrix_t< real_type > | dg::create::fast_transform (enum coo3d direction, dg::Operator< real_type > opx, const aRealMPITopology2d< real_type > &t) |
Create a block-diagonal matrix. More... | |
template<class real_type > | |
dg::MHMatrix_t< real_type > | dg::create::fast_interpolation (enum coo3d direction, const aRealMPITopology3d< real_type > &t, unsigned multiplyn, unsigned multiplyNx) |
Create interpolation matrix for integer multipliers. More... | |
template<class real_type > | |
dg::MHMatrix_t< real_type > | dg::create::fast_projection (enum coo3d direction, const aRealMPITopology3d< real_type > &t, unsigned dividen, unsigned divideNx) |
Create projecton matrix for integer dividers. More... | |
template<class real_type > | |
MHMatrix_t< real_type > | dg::create::fast_transform (enum coo3d direction, dg::Operator< real_type > opx, const aRealMPITopology3d< real_type > &t) |
Create a block-diagonal matrix. More... | |
template<class Topology > | |
auto | dg::create::fast_interpolation (const Topology &t, unsigned multiplyn, unsigned multiplyNx, unsigned multiplyNy) |
Create interpolation matrix for integer multipliers. More... | |
template<class Topology > | |
auto | dg::create::fast_projection (const Topology &t, unsigned dividen, unsigned divideNx, unsigned divideNy) |
Create projecton matrix for integer dividers. More... | |
template<class Topology > | |
auto | dg::create::fast_transform (dg::Operator< typename Topology::value_type > opx, dg::Operator< typename Topology::value_type > opy, const Topology &t) |
Create a block-diagonal matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const RealGrid1d< real_type > &g, dg::bc bcx=dg::NEU, std::string method="dg") |
Create interpolation matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const thrust::host_vector< real_type > &y, const aRealTopology2d< real_type > &g, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, std::string method="dg") |
Create interpolation matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const thrust::host_vector< real_type > &y, const thrust::host_vector< real_type > &z, const aRealTopology3d< real_type > &g, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, dg::bc bcz=dg::PER, std::string method="dg") |
Create interpolation matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const RealGrid1d< real_type > &g_new, const RealGrid1d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const aRealTopology2d< real_type > &g_new, const aRealTopology2d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const aRealTopology3d< real_type > &g_new, const aRealTopology3d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const aRealTopology3d< real_type > &g_new, const aRealTopology2d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
real_type | dg::interpolate (dg::space sp, const thrust::host_vector< real_type > &v, real_type x, const RealGrid1d< real_type > &g, dg::bc bcx=dg::NEU) |
Interpolate a vector on a single point on a 1d Grid. More... | |
template<class real_type > | |
real_type | dg::interpolate (dg::space sp, const thrust::host_vector< real_type > &v, real_type x, real_type y, const aRealTopology2d< real_type > &g, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU) |
Interpolate a vector on a single point on a 2d Grid. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const RealGridX1d< real_type > &g) |
Create interpolation matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const thrust::host_vector< real_type > &y, const aRealTopologyX2d< real_type > &g, dg::bc globalbcz=dg::NEU) |
Create interpolation matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const thrust::host_vector< real_type > &y, const thrust::host_vector< real_type > &z, const aRealTopologyX3d< real_type > &g, dg::bc globalbcz=dg::NEU) |
Create interpolation matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const RealGridX1d< real_type > &g_new, const RealGridX1d< real_type > &g_old) |
Create interpolation between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const aRealTopologyX2d< real_type > &g_new, const aRealTopologyX2d< real_type > &g_old) |
Create interpolation between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::interpolation (const aRealTopologyX3d< real_type > &g_new, const aRealTopologyX3d< real_type > &g_old) |
Create interpolation between two grids. More... | |
template<class real_type > | |
real_type | dg::interpolate (dg::space sp, const thrust::host_vector< real_type > &v, real_type x, real_type y, const aRealTopologyX2d< real_type > &g, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU) |
Interpolate a vector on a single point on a 2d Grid. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::interpolation (const aRealMPITopology2d< real_type > &g_new, const aRealMPITopology2d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::interpolation (const aRealMPITopology3d< real_type > &g_new, const aRealMPITopology3d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::interpolation (const aRealMPITopology3d< real_type > &g_new, const aRealMPITopology2d< real_type > &g_old, std::string method="dg") |
Create interpolation between two grids. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::projection (const aRealMPITopology2d< real_type > &g_new, const aRealMPITopology2d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::projection (const aRealMPITopology3d< real_type > &g_new, const aRealMPITopology3d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const thrust::host_vector< real_type > &y, const aRealMPITopology2d< real_type > &g, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, std::string method="dg") |
Create an MPI row distributed interpolation 2d matrix. More... | |
template<class real_type > | |
dg::MIHMatrix_t< real_type > | dg::create::interpolation (const thrust::host_vector< real_type > &x, const thrust::host_vector< real_type > &y, const thrust::host_vector< real_type > &z, const aRealMPITopology3d< real_type > &g, dg::bc bcx=dg::NEU, dg::bc bcy=dg::NEU, dg::bc bcz=dg::PER, std::string method="linear") |
Create an MPI row distributed interpolation 3d matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::diagonal (const thrust::host_vector< real_type > &diagonal) |
Create a diagonal matrix. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::projection (const RealGrid1d< real_type > &g_new, const RealGrid1d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::projection (const aRealTopology2d< real_type > &g_new, const aRealTopology2d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::projection (const aRealTopology3d< real_type > &g_new, const aRealTopology3d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::transformation (const aRealTopology3d< real_type > &g_new, const aRealTopology3d< real_type > &g_old) |
Create a transformation matrix between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::transformation (const aRealTopology2d< real_type > &g_new, const aRealTopology2d< real_type > &g_old) |
Create a transformation matrix between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::transformation (const RealGrid1d< real_type > &g_new, const RealGrid1d< real_type > &g_old) |
Create a transformation matrix between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::projection (const RealGridX1d< real_type > &g_new, const RealGridX1d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::projection (const aRealTopologyX2d< real_type > &g_new, const aRealTopologyX2d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
template<class real_type > | |
cusp::coo_matrix< int, real_type, cusp::host_memory > | dg::create::projection (const aRealTopologyX3d< real_type > &g_new, const aRealTopologyX3d< real_type > &g_old, std::string method="dg") |
Create a projection between two grids. More... | |
\( I \) and \( P = I^\dagger\)
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::diagonal | ( | const thrust::host_vector< real_type > & | diagonal | ) |
Create a diagonal matrix.
This matrix is given by \( D_{ij} = d_i \delta_{ij}\)
diagonal | The diagonal elements d_i |
dg::HMatrix_t< real_type > dg::create::fast_interpolation | ( | 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
real_type | a floating point type |
t | The existing (old/coarse) grid |
multiplyn | integer multiplier, the new grid has n*multiplyn polynomial coefficients |
multiplyNx | integer multiplier, the new grid has Nx*multiplyNx points |
auto dg::create::fast_interpolation | ( | const Topology & | t, |
unsigned | multiplyn, | ||
unsigned | multiplyNx, | ||
unsigned | multiplyNy | ||
) |
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
real_type | a floating point type |
t | The existing (old/coarse) grid |
multiplyn | integer multiplier, the new grid has n*multiplyn polynomial coefficients |
multiplyNx | integer multiplier, the new grid has Nx*multiplyNx points |
multiplyNy | integer multiplier, the new grid has Ny*multiplyNy points |
dg::MHMatrix_t< real_type > dg::create::fast_interpolation | ( | enum coo3d | direction, |
const aRealMPITopology2d< 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
real_type | a floating point type |
t | The existing (old/coarse) grid |
multiplyn | integer multiplier, the new grid has n*multiplyn polynomial coefficients |
multiplyNx | integer multiplier, the new grid has Nx*multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::MHMatrix_t< real_type > dg::create::fast_interpolation | ( | enum coo3d | direction, |
const aRealMPITopology3d< 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
real_type | a floating point type |
t | The existing (old/coarse) grid |
multiplyn | integer multiplier, the new grid has n*multiplyn polynomial coefficients |
multiplyNx | integer multiplier, the new grid has Nx*multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_interpolation | ( | enum coo3d | direction, |
const aRealTopology2d< 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
real_type | a floating point type |
t | The existing (old/coarse) grid |
multiplyn | integer multiplier, the new grid has n*multiplyn polynomial coefficients |
multiplyNx | integer multiplier, the new grid has Nx*multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_interpolation | ( | enum coo3d | direction, |
const aRealTopology3d< 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
real_type | a floating point type |
t | The existing (old/coarse) grid |
multiplyn | integer multiplier, the new grid has n*multiplyn polynomial coefficients |
multiplyNx | integer multiplier, the new grid has Nx*multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_projection | ( | 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
real_type | a floating point type |
t | The existing (old/fine) grid |
dividen | integer divisor, the new grid has n/multiplyn polynomial coefficients |
divideNx | integer divisor, the new grid has Nx/multiplyNx points |
auto dg::create::fast_projection | ( | const Topology & | t, |
unsigned | dividen, | ||
unsigned | divideNx, | ||
unsigned | divideNy | ||
) |
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
real_type | a floating point type |
t | The existing (old/fine) grid |
dividen | integer divisor, the new grid has n/multiplyn polynomial coefficients |
divideNx | integer divisor, the new grid has Nx/multiplyNx points |
divideNy | integer multiplier, the new grid has Ny/divideNy points |
dg::MHMatrix_t< real_type > dg::create::fast_projection | ( | enum coo3d | direction, |
const aRealMPITopology2d< 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
real_type | a floating point type |
t | The existing (old/fine) grid |
dividen | integer divisor, the new grid has n/multiplyn polynomial coefficients |
divideNx | integer divisor, the new grid has Nx/multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::MHMatrix_t< real_type > dg::create::fast_projection | ( | enum coo3d | direction, |
const aRealMPITopology3d< 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
real_type | a floating point type |
t | The existing (old/fine) grid |
dividen | integer divisor, the new grid has n/multiplyn polynomial coefficients |
divideNx | integer divisor, the new grid has Nx/multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_projection | ( | enum coo3d | direction, |
const aRealTopology2d< 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
real_type | a floating point type |
t | The existing (old/fine) grid |
dividen | integer divisor, the new grid has n/multiplyn polynomial coefficients |
divideNx | integer divisor, the new grid has Nx/multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_projection | ( | enum coo3d | direction, |
const aRealTopology3d< 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
real_type | a floating point type |
t | The existing (old/fine) grid |
dividen | integer divisor, the new grid has n/multiplyn polynomial coefficients |
divideNx | integer divisor, the new grid has Nx/multiplyNx points |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_transform | ( | dg::Operator< 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
dg::DLT::forward()
and dg::DLT::backward()
to create a forward/backward transformation from configuration to Legendre space (or from nodal to modal values) real_type | a floating point type |
opx | the block B |
t | The grid determines the number of rows and columns |
auto dg::create::fast_transform | ( | dg::Operator< typename Topology::value_type > | opx, |
dg::Operator< typename Topology::value_type > | opy, | ||
const Topology & | 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
dg::DLT::forward()
and dg::DLT::backward()
to create a forward/backward transformation from configuration to Legendre space (or from nodal to modal values) real_type | a floating point type |
opx | the block B |
t | The grid determines the number of rows and columns |
opy | the block B for the y transform |
MHMatrix_t< real_type > dg::create::fast_transform | ( | enum coo3d | direction, |
dg::Operator< real_type > | opx, | ||
const aRealMPITopology2d< 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
dg::DLT::forward()
and dg::DLT::backward()
to create a forward/backward transformation from configuration to Legendre space (or from nodal to modal values) real_type | a floating point type |
opx | the block B |
t | The grid determines the number of rows and columns |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
MHMatrix_t< real_type > dg::create::fast_transform | ( | enum coo3d | direction, |
dg::Operator< real_type > | opx, | ||
const aRealMPITopology3d< 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
dg::DLT::forward()
and dg::DLT::backward()
to create a forward/backward transformation from configuration to Legendre space (or from nodal to modal values) real_type | a floating point type |
opx | the block B |
t | The grid determines the number of rows and columns |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_transform | ( | enum coo3d | direction, |
dg::Operator< real_type > | opx, | ||
const aRealTopology2d< 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
dg::DLT::forward()
and dg::DLT::backward()
to create a forward/backward transformation from configuration to Legendre space (or from nodal to modal values) real_type | a floating point type |
opx | the block B |
t | The grid determines the number of rows and columns |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
dg::HMatrix_t< real_type > dg::create::fast_transform | ( | enum coo3d | direction, |
dg::Operator< real_type > | opx, | ||
const aRealTopology3d< 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
dg::DLT::forward()
and dg::DLT::backward()
to create a forward/backward transformation from configuration to Legendre space (or from nodal to modal values) real_type | a floating point type |
opx | the block B |
t | The grid determines the number of rows and columns |
direction | The direction inside the structured grid to which to apply the sparse block matrix. |
real_type dg::interpolate | ( | dg::space | sp, |
const thrust::host_vector< real_type > & | v, | ||
real_type | x, | ||
const RealGrid1d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU |
||
) |
Interpolate a vector on a single point on a 1d Grid.
sp | Indicate whether the elements of the vector v are in xspace (nodal values) or lspace (modal values) (choose dg::xspace if you don't know what is going on here, It is faster to interpolate in dg::lspace so consider transforming v using dg::forward_transform( ) if you do it very many times) |
v | The vector to interpolate |
x | X-coordinate of interpolation point |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
real_type dg::interpolate | ( | dg::space | sp, |
const thrust::host_vector< real_type > & | v, | ||
real_type | x, | ||
real_type | y, | ||
const aRealTopology2d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU |
||
) |
Interpolate a vector on a single point on a 2d Grid.
sp | Indicate whether the elements of the vector v are in xspace (nodal values) or lspace (modal values) (choose dg::xspace if you don't know what is going on here, It is faster to interpolate in dg::lspace so consider transforming v using dg::forward_transform( ) if you do it very many times) |
v | The vector to interpolate in dg::xspace, or dg::lspace s.a. dg::forward_transform( ) |
x | X-coordinate of interpolation point |
y | Y-coordinate of interpolation point |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
bcy | analogous to bcx , applies to y direction |
real_type dg::interpolate | ( | dg::space | sp, |
const thrust::host_vector< real_type > & | v, | ||
real_type | x, | ||
real_type | y, | ||
const aRealTopologyX2d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU |
||
) |
Interpolate a vector on a single point on a 2d Grid.
sp | Indicate whether the elements of the vector v are in xspace or lspace (choose dg::xspace if you don't know what is going on here, It is faster to interpolate in dg::lspace so consider transforming v using dg::forward_transform( ) if you do it very many times) |
v | The vector to interpolate in dg::xspace, or dg::lspace s.a. dg::forward_transform( ) |
x | X-coordinate of interpolation point |
y | Y-coordinate of interpolation point |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
bcy | analogous to bcx , applies to y direction |
g.contains(x,y)
must return true dg::MIHMatrix_t< real_type > dg::create::interpolation | ( | const aRealMPITopology2d< real_type > & | g_new, |
const aRealMPITopology2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows dg::MIHMatrix_t< real_type > dg::create::interpolation | ( | const aRealMPITopology3d< real_type > & | g_new, |
const aRealMPITopology2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows dg::MIHMatrix_t< real_type > dg::create::interpolation | ( | const aRealMPITopology3d< real_type > & | g_new, |
const aRealMPITopology3d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const aRealTopology2d< real_type > & | g_new, |
const aRealTopology2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const aRealTopology3d< real_type > & | g_new, |
const aRealTopology2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const aRealTopology3d< real_type > & | g_new, |
const aRealTopology3d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const aRealTopologyX2d< real_type > & | g_new, |
const aRealTopologyX2d< real_type > & | g_old | ||
) |
Create interpolation between two grids.
This matrix can be applied to vectors defined on the old grid to obtain its values on the new grid.
g_new | The new points |
g_old | The old grid |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const aRealTopologyX3d< real_type > & | g_new, |
const aRealTopologyX3d< real_type > & | g_old | ||
) |
Create interpolation between two grids.
This matrix can be applied to vectors defined on the old grid to obtain its values on the new grid.
g_new | The new points |
g_old | The old grid |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const RealGrid1d< real_type > & | g_new, |
const RealGrid1d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create interpolation between two grids.
This matrix interpolates vectors on the old grid g_old
to the Gaussian nodes of the new grid g_new
. The interpolation is of the order g_old.n()
g_new | The new grid |
g_old | The old grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
g_old.size()
columns and g_new.size()
rows cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const RealGridX1d< real_type > & | g_new, |
const RealGridX1d< real_type > & | g_old | ||
) |
Create interpolation between two grids.
This matrix can be applied to vectors defined on the old grid to obtain its values on the new grid.
g_new | The new points |
g_old | The old grid |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const RealGrid1d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
std::string | method = "dg" |
||
) |
Create interpolation matrix.
The created matrix has g.size()
columns and x.size()
rows. Per default it uses polynomial interpolation given by the dG polynomials, i.e. the interpolation has order g.n()
. When applied to a vector the result contains the interpolated values at the given interpolation points. The given boundary conditions determine how interpolation points outside the grid domain are treated.
x | X-coordinates of interpolation points |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const RealGridX1d< real_type > & | g | ||
) |
Create interpolation matrix.
The matrix, when applied to a vector, interpolates its values to the given coordinates
x | X-coordinates of interpolation points |
g | The Grid on which to operate |
dg::MIHMatrix_t< real_type > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const thrust::host_vector< real_type > & | y, | ||
const aRealMPITopology2d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
std::string | method = "dg" |
||
) |
Create an MPI row distributed interpolation 2d matrix.
The created matrix has g.size()
columns and x.size()
rows. Per default it uses polynomial interpolation given by the dG polynomials, i.e. the interpolation has order g.n()
. When applied to a vector the result contains the interpolated values at the given interpolation points. The given boundary conditions determine how interpolation points outside the grid domain are treated.
x | X-coordinates of interpolation points |
y | Y-coordinates of interpolation points (y.size() must equal x.size() ) |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
bcy | analogous to bcx , applies to y direction |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const thrust::host_vector< real_type > & | y, | ||
const aRealTopology2d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
std::string | method = "dg" |
||
) |
Create interpolation matrix.
The created matrix has g.size()
columns and x.size()
rows. Per default it uses polynomial interpolation given by the dG polynomials, i.e. the interpolation has order g.n()
. When applied to a vector the result contains the interpolated values at the given interpolation points. The given boundary conditions determine how interpolation points outside the grid domain are treated.
x | X-coordinates of interpolation points |
y | Y-coordinates of interpolation points (y.size() must equal x.size() ) |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
bcy | analogous to bcx , applies to y direction |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const thrust::host_vector< real_type > & | y, | ||
const aRealTopologyX2d< real_type > & | g, | ||
dg::bc | globalbcz = dg::NEU |
||
) |
Create interpolation matrix.
The matrix, when applied to a vector, interpolates its values to the given coordinates
x | X-coordinates of interpolation points |
y | Y-coordinates of interpolation points |
g | The Grid on which to operate |
globalbcz | NEU for common interpolation. DIR for zeros at Box |
dg::MIHMatrix_t< real_type > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const thrust::host_vector< real_type > & | y, | ||
const thrust::host_vector< real_type > & | z, | ||
const aRealMPITopology3d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
dg::bc | bcz = dg::PER , |
||
std::string | method = "linear" |
||
) |
Create an MPI row distributed interpolation 3d matrix.
The created matrix has g.size()
columns and x.size()
rows. Per default it uses polynomial interpolation given by the dG polynomials, i.e. the interpolation has order g.n()
. When applied to a vector the result contains the interpolated values at the given interpolation points.
x | X-coordinates of interpolation points |
y | Y-coordinates of interpolation points (y.size() must equal x.size() ) |
z | Z-coordinates of interpolation points (z.size() must equal x.size() ) |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
bcy | analogous to bcx , applies to y direction |
bcz | analogous to bcx , applies to z direction |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const thrust::host_vector< real_type > & | y, | ||
const thrust::host_vector< real_type > & | z, | ||
const aRealTopology3d< real_type > & | g, | ||
dg::bc | bcx = dg::NEU , |
||
dg::bc | bcy = dg::NEU , |
||
dg::bc | bcz = dg::PER , |
||
std::string | method = "dg" |
||
) |
Create interpolation matrix.
The created matrix has g.size()
columns and x.size()
rows. Per default it uses polynomial interpolation given by the dG polynomials, i.e. the interpolation has order g.n()
. When applied to a vector the result contains the interpolated values at the given interpolation points.
x | X-coordinates of interpolation points |
y | Y-coordinates of interpolation points (y.size() must equal x.size() ) |
z | Z-coordinates of interpolation points (z.size() must equal x.size() ) |
g | The Grid on which to operate |
bcx | determines what to do when a point lies outside the boundary in x. If dg::PER , the point will be shifted topologically back onto the domain. Else the point will be mirrored at the boundary: dg::NEU will then simply interpolate at the resulting point, dg::DIR will take the negative of the interpolation. (dg::DIR_NEU and dg::NEU_DIR apply dg::NEU / dg::DIR to the respective left or right boundary ) This means the result of the interpolation is as if the interpolated function were Fourier transformed with the correct boundary condition and thus extended beyond the grid boundaries. Note that if a point lies directly on the boundary between two grid cells, the value of the polynomial to the right is taken. |
bcy | analogous to bcx , applies to y direction |
bcz | analogous to bcx , applies to z direction |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::interpolation | ( | const thrust::host_vector< real_type > & | x, |
const thrust::host_vector< real_type > & | y, | ||
const thrust::host_vector< real_type > & | z, | ||
const aRealTopologyX3d< real_type > & | g, | ||
dg::bc | globalbcz = dg::NEU |
||
) |
Create interpolation matrix.
The matrix, when applied to a vector, interpolates its values to the given coordinates. In z-direction only a nearest neighbor interpolation is used
x | X-coordinates of interpolation points |
y | Y-coordinates of interpolation points |
z | Z-coordinates of interpolation points |
g | The Grid on which to operate |
globalbcz | determines what to do if values lie exactly on the boundary |
dg::MIHMatrix_t< real_type > dg::create::projection | ( | const aRealMPITopology2d< real_type > & | g_new, |
const aRealMPITopology2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution dg::MIHMatrix_t< real_type > dg::create::projection | ( | const aRealMPITopology3d< real_type > & | g_new, |
const aRealMPITopology3d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::projection | ( | const aRealTopology2d< real_type > & | g_new, |
const aRealTopology2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::projection | ( | const aRealTopology3d< real_type > & | g_new, |
const aRealTopology3d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::projection | ( | const aRealTopologyX2d< real_type > & | g_new, |
const aRealTopologyX2d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::projection | ( | const aRealTopologyX3d< real_type > & | g_new, |
const aRealTopologyX3d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::projection | ( | const RealGrid1d< real_type > & | g_new, |
const RealGrid1d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution !! cusp::multiply removes explicit zeros in the output
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::projection | ( | const RealGridX1d< real_type > & | g_new, |
const RealGridX1d< real_type > & | g_old, | ||
std::string | method = "dg" |
||
) |
Create a projection between two grids.
This matrix can be applied to vectors defined on the old (fine) grid to obtain its values projected on the new (coarse) grid. (Projection means that the projection integrals over the base polynomials are computed). If the fine grid is a multiple of the coarse grid, the integral value of the projected vector will be conserved and the difference in the L2 norm between old and new vector small. The projection matrix is the adjoint of the interpolation matrix
g_new | The new (coarse) grid |
g_old | The old (fine) grid |
method | Several interpolation methods are available: dg uses the native dG interpolation scheme given by the grid, nearest searches for the nearest point and copies its value, linear searches for the two (in 2d four, etc.) closest points and linearly interpolates their values, cubic searches for the four (in 2d 16, etc) closest points and interpolates a cubic polynomial. Pay attention that linear and cubic entail nearest neighbor communication in mpi. |
dg::create::transformation
, which is the more general solution cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::transformation | ( | const aRealTopology2d< real_type > & | g_new, |
const aRealTopology2d< real_type > & | g_old | ||
) |
Create a transformation matrix between two grids.
The transformation matrix is probably the most correct way of transforming dG vectors between any two grids of different resolution. It first finds the least common multiple grid (lcm) of the old and the new grid. Then it interpolates the values to the lcm grid and finally projects them back to the new grid. In total we have
\[ \mathcal T = P Q \]
where \( Q\) is the interpolation matrix and \( P \) the projection. If either new or old grid is already the lcm grid this function reduces to the interpolation/projection function.
g_new | The new grid |
g_old | The old grid |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::transformation | ( | const aRealTopology3d< real_type > & | g_new, |
const aRealTopology3d< real_type > & | g_old | ||
) |
Create a transformation matrix between two grids.
The transformation matrix is probably the most correct way of transforming dG vectors between any two grids of different resolution. It first finds the least common multiple grid (lcm) of the old and the new grid. Then it interpolates the values to the lcm grid and finally projects them back to the new grid. In total we have
\[ \mathcal T = P Q \]
where \( Q\) is the interpolation matrix and \( P \) the projection. If either new or old grid is already the lcm grid this function reduces to the interpolation/projection function.
g_new | The new grid |
g_old | The old grid |
cusp::coo_matrix< int, real_type, cusp::host_memory > dg::create::transformation | ( | const RealGrid1d< real_type > & | g_new, |
const RealGrid1d< real_type > & | g_old | ||
) |
Create a transformation matrix between two grids.
The transformation matrix is probably the most correct way of transforming dG vectors between any two grids of different resolution. It first finds the least common multiple grid (lcm) of the old and the new grid. Then it interpolates the values to the lcm grid and finally projects them back to the new grid. In total we have
\[ \mathcal T = P Q \]
where \( Q\) is the interpolation matrix and \( P \) the projection. If either new or old grid is already the lcm grid this function reduces to the interpolation/projection function.
g_new | The new grid |
g_old | The old grid |