Extension: Matrix functions
#include "dg/matrix/matrix.h"
|
Matrix class that represents the arbitrary polarization operator. More...
Public Types | |
using | container_type = Container |
using | geometry_type = Geometry |
using | matrix_type = Matrix |
using | value_type = get_value_type<Container> |
Public Member Functions | |
TensorElliptic () | |
empty object ( no memory allocation) | |
TensorElliptic (const Geometry &g, direction dir=dg::centered, value_type jfactor=1.) | |
Construct TensorElliptic operator. | |
TensorElliptic (const Geometry &g, bc bcx, bc bcy, direction dir=dg::centered, value_type jfactor=1.) | |
Construct TensorElliptic operator. | |
template<class ... Params> | |
void | construct (Params &&...ps) |
Perfect forward parameters to one of the constructors. | |
const Container & | weights () const |
Return the weights making the operator self-adjoint. | |
const Container & | precond () const |
Preconditioner to use in conjugate gradient solvers. | |
template<class ContainerType0 > | |
void | set_chi (const ContainerType0 &chi) |
Set Chi in the above formula. | |
template<class ContainerType0 > | |
void | set_iota (const ContainerType0 &iota) |
Set Iota in the above formula. | |
void | variation (const Container &phi, const value_type &alpha, const Container &chi, Container &varphi) |
compute the variational of the operator (psi_2 in gf theory): | |
template<class ContainerType0 , class ContainerType1 > | |
void | operator() (const ContainerType0 &x, ContainerType1 &y) |
template<class ContainerType0 , class ContainerType1 > | |
void | symv (const ContainerType0 &x, ContainerType1 &y) |
template<class ContainerType0 , class ContainerType1 > | |
void | symv (value_type alpha, const ContainerType0 &x, value_type beta, ContainerType1 &y) |
apply operator | |
Matrix class that represents the arbitrary polarization operator.
Discretization of
\[ (-\nabla \cdot \chi \nabla - \Delta \iota \Delta + \nabla \cdot\nabla \cdot 2\iota \nabla \nabla ) x \]
in two dimensions where \( \chi\) and \(\iota\) are functions
using dg::mat::TensorElliptic< Geometry, Matrix, Container >::container_type = Container |
using dg::mat::TensorElliptic< Geometry, Matrix, Container >::geometry_type = Geometry |
using dg::mat::TensorElliptic< Geometry, Matrix, Container >::matrix_type = Matrix |
using dg::mat::TensorElliptic< Geometry, Matrix, Container >::value_type = get_value_type<Container> |
|
inline |
empty object ( no memory allocation)
|
inline |
Construct TensorElliptic
operator.
g | The grid to use |
dir | Direction of the Laplace operator (Note: only dg::centered tested) |
jfactor | The jfactor used in the Laplace operator (probably 1 is always the best factor but one never knows...) |
|
inline |
Construct TensorElliptic
operator.
g | The grid to use |
bcx | boundary condition in x |
bcy | boundary contition in y |
dir | Direction of the Laplace operator (Note: only dg::centered tested) |
jfactor | The jfactor used in the Laplace operator (probably 1 is always the best factor but one never knows...) |
|
inline |
Perfect forward parameters to one of the constructors.
Params | deduced by the compiler |
ps | parameters forwarded to constructors |
|
inline |
|
inline |
Preconditioner to use in conjugate gradient solvers.
|
inline |
Set Chi in the above formula.
chi | new container |
|
inline |
Set Iota in the above formula.
iota | new container |
|
inline |
|
inline |
apply operator
Computes
\[ y = W\left[-\nabla \cdot \chi \nabla_\perp - \Delta_\perp \iota \Delta_\perp + 2\nabla \cdot\nabla \cdot \iota \nabla_\perp \nabla_\perp \right] x \]
to make the matrix symmetric
alpha | |
x | lhs (is constant up to changes in ghost cells) |
beta | |
y | rhs contains solution |
\[\nabla \cdot\nabla \cdot (\chi \nabla_\perp^2 f) = \frac{1}{\sqrt{g}} \partial_j \left\{\partial_i \left[\sqrt{g} \chi P^{ni} \left( \partial_n ( P^{jm} \partial_m f)\right) \right]\right\} \]
where P is the projection tensor
|
inline |
compute the variational of the operator (psi_2 in gf theory):
\[ - \frac{\chi}{2} \left\{|\nabla \phi|^2 + \alpha \chi ( | \nabla^2 \phi |^2 - (\Delta \phi)^2 / 2) \right\}\]
phi | (e.g. Gamma phi) |
alpha | (e.g. tau/2) |
chi | (e.g. 1/B^2) |
varphi | equals psi_2 in gf theory if phi = gamma_phi |
|
inline |
Return the weights making the operator self-adjoint.