Discontinuous Galerkin Library
#include "dg/algorithm.h"
|
Classes | |
struct | dg::ClonePtr< Cloneable > |
Manager class that invokes the clone() method on the managed ptr when copied. More... | |
struct | dg::Buffer< T > |
a manager class that invokes the copy constructor on the managed ptr when copied (deep copy) More... | |
Functions | |
template<class Matrix > | |
Matrix | dg::transpose (const Matrix &src) |
Generic matrix transpose method. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::dx_symm (int n, int N, real_type h, bc bcx) |
Create and assemble a host Matrix for the centered 1d single derivative. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::dx_plus (int n, int N, real_type h, bc bcx) |
Create and assemble a host Matrix for the forward 1d single derivative. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::dx_minus (int n, int N, real_type h, bc bcx) |
Create and assemble a host Matrix for the backward 1d single derivative. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::jump (int n, int N, real_type h, bc bcx) |
Create and assemble a host Matrix for the jump terms in 1d. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::dx_normed (int n, int N, real_type h, bc bcx, direction dir) |
Create and assemble a host Matrix for normed derivative in 1d. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::dx (const RealGridX1d< real_type > &g, bc bcx, direction dir=centered) |
Create and assemble a host Matrix for the derivative in 1d. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::dx (const RealGridX1d< real_type > &g, direction dir=centered) |
Create and assemble a host Matrix for the derivative in 1d. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::jump (const RealGridX1d< real_type > &g, bc bcx) |
Create and assemble a host Matrix for the jump in 1d. More... | |
template<class real_type > | |
EllSparseBlockMat< real_type > | dg::create::jump (const RealGridX1d< real_type > &g) |
Create and assemble a host Matrix for the jump in 1d. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::delta (unsigned n) |
Create the unit matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::pipj (unsigned n) |
Create the S-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::pipj_inv (unsigned n) |
Create the T-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::pidxpj (unsigned n) |
Create the D-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::rirj (unsigned n) |
Create the R-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::rilj (unsigned n) |
Create the RL-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::lirj (unsigned n) |
Create the LR-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::lilj (unsigned n) |
Create the L-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::ninj (unsigned n) |
Create the N-matrix. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::weights (const DLT< real_type > &dlt) |
Construct a diagonal operator with weights. More... | |
template<class real_type > | |
Operator< real_type > | dg::create::inv_weights (const DLT< real_type > &dlt) |
Construct a diagonal operator with inverse weights. More... | |
template<class T > | |
Operator< T > | dg::tensorproduct (const Operator< T > &op1, const Operator< T > &op2) |
Form the tensor product between two operators. More... | |
template<class T > | |
cusp::coo_matrix< int, T, cusp::host_memory > | dg::tensorproduct (unsigned N, const Operator< T > &op) |
Tensor product between Identity matrix and an operator. More... | |
template<class T > | |
cusp::coo_matrix< int, T, cusp::host_memory > | dg::sandwich (const Operator< T > &left, const cusp::coo_matrix< int, T, cusp::host_memory > &m, const Operator< T > &right) |
Multiply 1d matrices by diagonal block matrices from left and right. More... | |
template<class T > | |
cusp::csr_matrix< int, T, cusp::host_memory > | dg::tensorproduct (const cusp::csr_matrix< int, T, cusp::host_memory > &lhs, const cusp::csr_matrix< int, T, cusp::host_memory > &rhs) |
\( L\otimes R\) Form the tensor (Kronecker) product between two matrices More... | |
Operator< real_type > dg::create::delta | ( | unsigned | n | ) |
EllSparseBlockMat< real_type > dg::create::dx | ( | const RealGridX1d< real_type > & | g, |
bc | bcx, | ||
direction | dir = centered |
||
) |
Create and assemble a host Matrix for the derivative in 1d.
g | 1D grid with X-point topology |
bcx | boundary condition |
dir | The direction of the first derivative |
EllSparseBlockMat< real_type > dg::create::dx | ( | const RealGridX1d< real_type > & | g, |
direction | dir = centered |
||
) |
Create and assemble a host Matrix for the derivative in 1d.
Take the boundary condition from the grid
g | 1D grid with X-point topology |
dir | The direction of the first derivative |
EllSparseBlockMat< real_type > dg::create::dx_minus | ( | int | n, |
int | N, | ||
real_type | h, | ||
bc | bcx | ||
) |
Create and assemble a host Matrix for the backward 1d single derivative.
n | Number of Legendre nodes per cell |
N | Vector size ( number of cells) |
h | cell size ( used to compute normalisation) |
bcx | boundary condition |
EllSparseBlockMat< real_type > dg::create::dx_normed | ( | int | n, |
int | N, | ||
real_type | h, | ||
bc | bcx, | ||
direction | dir | ||
) |
Create and assemble a host Matrix for normed derivative in 1d.
n | Number of Legendre nodes per cell |
N | Vector size ( number of cells) |
h | cell size ( used to compute normalisation) |
bcx | boundary condition |
dir | The direction of the first derivative |
EllSparseBlockMat< real_type > dg::create::dx_plus | ( | int | n, |
int | N, | ||
real_type | h, | ||
bc | bcx | ||
) |
Create and assemble a host Matrix for the forward 1d single derivative.
n | Number of Legendre nodes per cell |
N | Vector size ( number of cells) |
h | cell size ( used to compute normalisation) |
bcx | boundary condition |
EllSparseBlockMat< real_type > dg::create::dx_symm | ( | int | n, |
int | N, | ||
real_type | h, | ||
bc | bcx | ||
) |
Create and assemble a host Matrix for the centered 1d single derivative.
The matrix isn't symmetric due to the normalisation T.
n | Number of Legendre nodes per cell |
N | Vector size ( number of cells) |
h | cell size (used to compute normalisation) |
bcx | boundary condition |
Operator< real_type > dg::create::inv_weights | ( | const DLT< real_type > & | dlt | ) |
Construct a diagonal operator with inverse weights.
dlt |
EllSparseBlockMat< real_type > dg::create::jump | ( | const RealGridX1d< real_type > & | g | ) |
Create and assemble a host Matrix for the jump in 1d.
Take the boundary condition from the grid
g | 1D grid with X-point topology |
EllSparseBlockMat< real_type > dg::create::jump | ( | const RealGridX1d< real_type > & | g, |
bc | bcx | ||
) |
Create and assemble a host Matrix for the jump in 1d.
g | 1D grid with X-point topology |
bcx | boundary condition |
EllSparseBlockMat< real_type > dg::create::jump | ( | int | n, |
int | N, | ||
real_type | h, | ||
bc | bcx | ||
) |
Create and assemble a host Matrix for the jump terms in 1d.
n | Number of Legendre nodes per cell |
N | Vector size ( number of cells) |
h | cell size ( used to compute normalisation) |
bcx | boundary condition |
Operator< real_type > dg::create::lilj | ( | unsigned | n | ) |
Operator< real_type > dg::create::lirj | ( | unsigned | n | ) |
Operator< real_type > dg::create::ninj | ( | unsigned | n | ) |
Operator< real_type > dg::create::pidxpj | ( | unsigned | n | ) |
Operator< real_type > dg::create::pipj | ( | unsigned | n | ) |
Operator< real_type > dg::create::pipj_inv | ( | unsigned | n | ) |
Operator< real_type > dg::create::rilj | ( | unsigned | n | ) |
Operator< real_type > dg::create::rirj | ( | unsigned | n | ) |
cusp::coo_matrix< int, T, cusp::host_memory > dg::sandwich | ( | const Operator< T > & | left, |
const cusp::coo_matrix< int, T, cusp::host_memory > & | m, | ||
const Operator< T > & | right | ||
) |
Multiply 1d matrices by diagonal block matrices from left and right.
computes (1xleft)m(1xright)
T | value type |
left | The left hand side |
m | The matrix |
right | The right hand side |
cusp::csr_matrix< int, T, cusp::host_memory > dg::tensorproduct | ( | const cusp::csr_matrix< int, T, cusp::host_memory > & | lhs, |
const cusp::csr_matrix< int, T, cusp::host_memory > & | rhs | ||
) |
\( L\otimes R\) Form the tensor (Kronecker) product between two matrices
The Kronecker product is formed by the triplets \(I = k n_r+l\), \( J = i N_r +j \), \( M_{IJ} = L_{ki}R_{lj}\)
T | value type |
lhs | The left hand side matrix (duplicate entries lead to duplicate entries in result) |
rhs | The right hand side matrix (duplicate entries lead to duplicate entries in result) |
cusp::add
and cusp::multiply
to add and multiply matrices. Operator< T > dg::tensorproduct | ( | const Operator< T > & | op1, |
const Operator< T > & | op2 | ||
) |
Form the tensor product between two operators.
Computes C_{ijkl} = op1_{ij}op2_{kl}
T | The value type |
op1 | The left hand side |
op2 | The right hand side |
cusp::coo_matrix< int, T, cusp::host_memory > dg::tensorproduct | ( | unsigned | N, |
const Operator< T > & | op | ||
) |
Tensor product between Identity matrix and an operator.
\[ M = \begin{pmatrix} op & & & & & \\ & op & & & & \\ & & op & & & \\ & & & op & & \\ & & &...& & \end{pmatrix} \]
Can be used to create tensors that operate on each dg-vector entry
T | value type |
N | Size of the identity (=number of times op is repeated in the matrix) |
op | The Operator |
N*op.size()
) Matrix dg::transpose | ( | const Matrix & | src | ) |
Generic matrix transpose method.
Matrix | one of
|
src | the marix to transpose |