template<class Matrix, class Container>
struct dg::GeneralHelmholtz< Matrix, Container >
A general Helmholtz-type operator \( (\chi-\alpha F) \).
where \( \chi\) is a vector and \(\alpha\) a scalar and \(F\) is an operator.
- Attention
- If \( F\) is the
Elliptic
operator then the Laplacian in this formula becomes positive as opposed to the negative sign in the Elliptic
operator
Can be used by the dg::PCG
class. The following example shows how the class can be used to act as a Helmholtz2
operator:
std::cout << "Alternative test with two Helmholtz operators\n";
t.tic();
unsigned number1 = pcgO.solve( gamma1inv, phi, rholap, 1., w2d, eps/100);
unsigned number2 = pcgOO.solve( gamma1inv, x, phi, 1., w2d, eps/100);
t.toc();
Preconditioned conjugate gradient method to solve .
Definition: pcg.h:57
void axpby(get_value_type< ContainerType > alpha, const ContainerType1 &x, get_value_type< ContainerType > beta, ContainerType &y)
Definition: blas1.h:231
void pointwiseDot(get_value_type< ContainerType > alpha, const ContainerType1 &x1, const ContainerType2 &x2, get_value_type< ContainerType > beta, ContainerType &y)
Definition: blas1.h:336
@ centered
centered derivative (cell to the left and right and current cell)
Definition: enums.h:100
A general Helmholtz-type operator .
Definition: helmholtz.h:34
value_type & alpha()
Change alpha.
Definition: helmholtz.h:95
const Container & chi() const
Access chi.
Definition: helmholtz.h:116
void set_chi(const ContainerType0 &chi)
Set Chi in the above formula.
Definition: helmholtz.h:109
- Template Parameters
-
Geometry | A type that is or derives from one of the abstract geometry base classes ( aGeometry2d , aGeometry3d , aMPIGeometry2d , ...). Geometry determines which Matrix and Container types can be used: |
Matrix | A class for which the dg::blas2::symv functions are callable in connection with the Container class and to which the return type of dg::create::dx() can be converted using dg::blas2::transfer . The Matrix type can be one of:
|
Container | A data container class for which the blas1 functionality is overloaded and to which the return type of blas1::subroutine() can be converted using dg::assign . We assume that Container is copyable/assignable and has a swap member function. In connection with Geometry this is one of
|
- Note
- The intention is for Matrix to be one of the Elliptic classes with the
weights()
and precond()
methods defined. If Matrix is to be an arbitrary functor then it is more convenient to simply directly use a lambda function to achieve the computation of \( y = (\chi - \alpha F)x\)