Extension: Matrix functions
#include "dg/matrix/matrix.h"
|
Various arbitary wavelength polarization charge operators of delta-f (df) and full-f (ff) More...
Public Types | |
using | value_type = get_value_type< Container > |
Public Member Functions | |
PolCharge () | |
empty object ( no memory allocation) More... | |
PolCharge (value_type alpha, std::vector< value_type > eps_gamma, const Geometry &g, direction dir=forward, value_type jfactor=1., std::string mode="df", bool commute=false) | |
Construct from Grid. More... | |
PolCharge (value_type alpha, std::vector< value_type > eps_gamma, const Geometry &g, bc bcx, bc bcy, direction dir=forward, value_type jfactor=1., std::string mode="df", bool commute=false) | |
Construct from boundary conditions. More... | |
template<class ... Params> | |
void | construct (Params &&...ps) |
Perfect forward parameters to one of the constructors. More... | |
template<class ContainerType0 > | |
void | set_chi (const ContainerType0 &sigma) |
Change \(\chi\) in the elliptic or tensor elliptic operator. More... | |
template<class ContainerType0 > | |
void | set_chi (const SparseTensor< ContainerType0 > &tau) |
Change \(\chi\) in the elliptic or tensor elliptic operator. More... | |
template<class ContainerType0 > | |
void | set_iota (const ContainerType0 &sigma) |
Change \(\iota\) in the tensor elliptic operator. More... | |
void | set_commute (bool commute) |
Set the commute. More... | |
bool | get_commute () const |
Get the current state of commute. More... | |
const Container & | weights () const |
Return the vector making the matrix symmetric. More... | |
const Container & | precond () const |
Return the default preconditioner to use in conjugate gradient. More... | |
template<class ContainerType0 , class ContainerType1 > | |
void | variation (const ContainerType0 &phi, ContainerType1 &varphi) |
template<class ContainerType0 , class ContainerType1 > | |
void | operator() (const ContainerType0 &x, ContainerType1 &y) |
Compute elliptic term and store in output. More... | |
template<class ContainerType0 , class ContainerType1 > | |
void | symv (const ContainerType0 &x, ContainerType1 &y) |
Compute elliptic term and store in output. More... | |
template<class ContainerType0 , class ContainerType1 > | |
void | symv (value_type alpha, const ContainerType0 &x, value_type beta, ContainerType1 &y) |
Compute elliptic term and add to output. More... | |
Various arbitary wavelength polarization charge operators of delta-f (df) and full-f (ff)
"df"
\[ x = -\Delta \left(1+\alpha\Delta\right)^{-1} \phi \]
\[ \]
"ff"
\[ x = \sqrt{1+\alpha\Delta}^{-1}\left(-\nabla \cdot \chi \nabla\right)\sqrt{1+\alpha\Delta}^{-1}\phi \]
"ffO4"
\[ x = (1+\alpha\Delta)^{-1} \left(-\nabla \cdot \chi \nabla - \Delta \iota \Delta + \nabla \cdot\nabla \cdot 2\iota \nabla \nabla \right)(1+\alpha\Delta)^{-1} \phi \]
using dg::mat::PolCharge< Geometry, Matrix, Container >::value_type = get_value_type<Container> |
|
inline |
empty object ( no memory allocation)
|
inline |
Construct from Grid.
alpha | alpha of the Helmholtz operator |
eps_gamma | epsilon (-vector) for the Helmholtz operator inversion or the sqrt Helmholtz operator inversion |
g | The Grid, boundary conditions are taken from here |
dir | Direction of the right first derivative in x and y (i.e. dg::forward , dg::backward or dg::centered ), |
jfactor | ( \( = \alpha \) ) scale jump terms (1 is a good value but in some cases 0.1 or 0.01 might be better) |
mode | arbitrary wavelength polarization charge mode ("df" / "ff" / "ffO4" are implemented) |
commute | false if Helmholtz operators (or their square root) are outside the elliptic or tensorelliptic operator and true otherwise |
|
inline |
Construct from boundary conditions.
alpha | alpha of the Helmholtz operator |
eps_gamma | epsilon (-vector) for the Helmholtz operator inversion or the sqrt Helmholtz operator inversion |
g | The Grid, boundary conditions are taken from here |
bcx | boundary condition in x |
bcy | boundary contition in y |
dir | Direction of the right first derivative in x and y (i.e. dg::forward , dg::backward or dg::centered ), |
jfactor | ( \( = \alpha \) ) scale jump terms (1 is a good value but in some cases 0.1 or 0.01 might be better) |
mode | arbitrary wavelength polarization charge mode ("df" / "ff" / "ffO4" (O as in Order!) are implemented) |
commute | false if Helmholtz operators (or their square root) are outside the elliptic or tensorelliptic operator and true otherwise |
|
inline |
Perfect forward parameters to one of the constructors.
Params | deduced by the compiler |
ps | parameters forwarded to constructors |
|
inline |
Get the current state of commute.
|
inline |
Compute elliptic term and store in output.
i.e. y=M*x
x | left-hand-side |
y | result |
ContainerTypes | must be usable with Container in The dg dispatch system |
|
inline |
Return the default preconditioner to use in conjugate gradient.
Currently returns the inverse scalar part of \( \chi\). This is especially good when \( \chi\) exhibits large amplitudes or variations
|
inline |
Change \(\chi\) in the elliptic or tensor elliptic operator.
sigma | The new scalar part in \(\chi\) (all elements must be >0) |
ContainerType0 | must be usable with Container in The dg dispatch system |
|
inline |
Change \(\chi\) in the elliptic or tensor elliptic operator.
tau | The new tensor part in \(\chi\) (all elements must be >0) |
ContainerType0 | must be usable in dg::assign to Container |
|
inline |
Set the commute.
commute | Either true or false. |
|
inline |
Change \(\iota\) in the tensor elliptic operator.
sigma | The new scalar part in \(\chi\) (all elements must be >0) |
ContainerType0 | must be usable with Container in The dg dispatch system |
|
inline |
Compute elliptic term and store in output.
i.e. y=M*x
x | left-hand-side |
y | result |
ContainerTypes | must be usable with Container in The dg dispatch system |
|
inline |
Compute elliptic term and add to output.
i.e. y=alpha*M*x+beta*y
alpha | a scalar |
x | left-hand-side |
beta | a scalar |
y | result |
ContainerTypes | must be usable with Container in The dg dispatch system |
|
inline |
|
inline |
Return the vector making the matrix symmetric.
i.e. the volume form