77template <
class Geometry,
class Matrix,
class Container,
class ContainerTmp = Container>
130 template<
class ...Params>
134 *
this =
Elliptic1d( std::forward<Params>( ps)...);
148 template<
class ContainerType0>
188 template<
class ContainerType0,
class ContainerType1>
189 void operator()(
const ContainerType0& x, ContainerType1&
y)
const {
194 template<
class ContainerType0,
class ContainerType1>
195 void symv(
const ContainerType0& x, ContainerType1&
y)
const {
199 template<
class ContainerType0,
class ContainerType1>
206 template<
class ContainerType0,
class ContainerType1,
class ContainerType2>
220 Matrix m_leftx, m_rightx, m_jumpX;
222 mutable ContainerTmp m_tempx;
261template <
class Geometry,
class Matrix,
class Container,
class ContainerTmp = Container>
310 value_type jfactor=1.,
bool chi_weight_jump =
false)
313 m_chi_weight_jump = chi_weight_jump;
324 m_tempx = m_tempy = m_temp;
330 template<
class ...Params>
334 *
this =
Elliptic2d( std::forward<Params>( ps)...);
353 template<
class ContainerType0>
376 template<
class ContainerType0>
443 template<
class ContainerType0,
class ContainerType1>
444 void operator()(
const ContainerType0& x, ContainerType1&
y)
const {
456 template<
class ContainerType0,
class ContainerType1>
457 void symv(
const ContainerType0& x, ContainerType1&
y)
const {
470 template<
class ContainerType0,
class ContainerType1>
500 template<
class ContainerType0,
class ContainerType1,
class ContainerType2>
517 if(m_chi_weight_jump)
541 template<
class ContainerType0,
class ContainerType1>
542 void variation(
const ContainerType0& phi, ContainerType1& sigma)
const{
554 template<
class ContainerTypeL,
class ContainerType0,
class ContainerType1>
555 void variation(
const ContainerTypeL& lambda,
const ContainerType0& phi, ContainerType1& sigma)
const{
569 template<
class ContainerTypeL,
class ContainerType0,
class ContainerType1>
579 Matrix m_leftx, m_lefty, m_rightx, m_righty, m_jumpX, m_jumpY;
581 mutable ContainerTmp m_tempx, m_tempy, m_temp;
585 bool m_chi_weight_jump;
590template <
class Geometry,
class Matrix,
class Container,
class ContainerTmp = Container>
631template <
class Geometry,
class Matrix,
class Container,
class ContainerTmp = Container>
674 m_chi_weight_jump = chi_weight_jump;
698 m_tempx = m_tempy = m_tempz = m_temp;
703 template<
class ...Params>
707 *
this =
Elliptic3d( std::forward<Params>( ps)...);
711 template<
class ContainerType0>
723 template<
class ContainerType0>
758 m_multiplyZ = !compute_in_2d;
762 template<
class ContainerType0,
class ContainerType1>
763 void symv(
const ContainerType0& x, ContainerType1&
y)
const {
767 template<
class ContainerType0,
class ContainerType1>
773 template<
class ContainerType0,
class ContainerType1,
class ContainerType2>
799 if(m_chi_weight_jump)
807 m_tempz, 0., m_tempx, m_tempy, m_tempz);
811 0., m_tempx, m_tempy);
829 template<
class ContainerType0,
class ContainerType1>
830 void variation(
const ContainerType0& phi, ContainerType1& sigma)
const{
834 template<
class ContainerTypeL,
class ContainerType0,
class ContainerType1>
835 void variation(
const ContainerTypeL& lambda,
const ContainerType0& phi, ContainerType1& sigma)
const{
839 template<
class ContainerTypeL,
class ContainerType0,
class ContainerType1>
848 dg::tensor::scalar_product3d(
alpha, lambda, m_tempx, m_tempy, m_tempz, m_chi, lambda, m_tempx, m_tempy, m_tempz,
beta, sigma);
852 Matrix m_leftx, m_lefty, m_leftz, m_rightx, m_righty, m_rightz, m_jumpX, m_jumpY, m_jumpZ;
854 mutable ContainerTmp m_tempx, m_tempy, m_tempz, m_temp;
858 bool m_multiplyZ =
true, m_addJumpZ =
false;
859 bool m_chi_weight_jump;
862template<
class G,
class M,
class V,
class V2>
863struct TensorTraits< Elliptic1d<G, M, V, V2> >
868template<
class G,
class M,
class V,
class V2>
869struct TensorTraits< Elliptic2d<G, M, V, V2> >
875template<
class G,
class M,
class V,
class V2>
876struct TensorTraits< Elliptic3d<G, M, V, V2> >
A 1d negative elliptic differential operator .
Definition elliptic.h:79
Geometry geometry_type
Definition elliptic.h:81
Container container_type
Definition elliptic.h:83
void set_chi(const ContainerType0 &sigma)
Change scalar part Chi.
Definition elliptic.h:149
void operator()(const ContainerType0 &x, ContainerType1 &y) const
Compute elliptic term and store in output.
Definition elliptic.h:189
Elliptic1d(const Geometry &g, bc bcx, direction dir=forward, value_type jfactor=1.)
Construct from grid and boundary conditions.
Definition elliptic.h:114
void construct(Params &&...ps)
Perfect forward parameters to one of the constructors.
Definition elliptic.h:131
get_value_type< Container > value_type
Definition elliptic.h:84
void symv(const ContainerType0 &x, ContainerType1 &y) const
Compute elliptic term and store in output.
Definition elliptic.h:195
Elliptic1d()=default
empty object ( no memory allocation)
void symv(value_type alpha, const ContainerType0 &x, value_type beta, ContainerType1 &y) const
Compute elliptic term and add to output.
Definition elliptic.h:200
void symv(value_type alpha, const ContainerType0 &x, value_type jfactor, const ContainerType2 &sigma, value_type beta, ContainerType1 &y) const
Compute elliptic term and add to output.
Definition elliptic.h:207
const Container & get_chi() const
Return the scalar part Chi.
Definition elliptic.h:163
void set_jfactor(value_type new_jfactor)
Set the currently used jfactor ( )
Definition elliptic.h:184
Elliptic1d(const Geometry &g, direction dir=forward, value_type jfactor=1.)
Construct from Grid.
Definition elliptic.h:98
const Container & precond() const
Return the default preconditioner to use in conjugate gradient.
Definition elliptic.h:180
const Container & weights() const
Return the weights making the operator self-adjoint.
Definition elliptic.h:169
value_type get_jfactor() const
Get the currently used jfactor ( )
Definition elliptic.h:186
A 2d negative elliptic differential operator .
Definition elliptic.h:263
void symv(const ContainerType0 &x, ContainerType1 &y) const
Compute elliptic term and store in output.
Definition elliptic.h:457
void variation(const ContainerTypeL &lambda, const ContainerType0 &phi, ContainerType1 &sigma) const
Definition elliptic.h:555
void symv(value_type alpha, const ContainerType0 &x, value_type beta, ContainerType1 &y) const
Compute elliptic term and add to output.
Definition elliptic.h:471
value_type get_jfactor() const
Get the currently used jfactor ( )
Definition elliptic.h:424
const SparseTensor< Container > & get_tau() const
Get tensor part of Chi tensor.
Definition elliptic.h:387
const Container & precond() const
Return the default preconditioner to use in conjugate gradient.
Definition elliptic.h:412
void set_jfactor(value_type new_jfactor)
Set the currently used jfactor ( )
Definition elliptic.h:419
void symv(value_type alpha, const ContainerType0 &x, value_type jfactor, const ContainerType2 &sigma, value_type beta, ContainerType1 &y) const
Compute elliptic term and add to output.
Definition elliptic.h:501
get_value_type< Container > value_type
Definition elliptic.h:268
Geometry geometry_type
Definition elliptic.h:265
void set_chi(const SparseTensor< ContainerType0 > &tau)
Change tensor part in Chi tensor.
Definition elliptic.h:377
void set_jump_weighting(bool jump_weighting)
Set the chi weighting of jump terms.
Definition elliptic.h:429
Elliptic2d(const Geometry &g, direction dir=forward, value_type jfactor=1., bool chi_weight_jump=false)
Construct from Grid.
Definition elliptic.h:286
Container container_type
Definition elliptic.h:267
void variation(value_type alpha, const ContainerTypeL &lambda, const ContainerType0 &phi, value_type beta, ContainerType1 &sigma) const
Definition elliptic.h:570
void set_chi(const ContainerType0 &sigma)
Change scalar part in Chi tensor.
Definition elliptic.h:354
void construct(Params &&...ps)
Perfect forward parameters to one of the constructors.
Definition elliptic.h:331
bool get_jump_weighting() const
Get the current state of chi weighted jump terms.
Definition elliptic.h:434
const Container & weights() const
Return the weights making the operator self-adjoint.
Definition elliptic.h:401
Elliptic2d()=default
empty object ( no memory allocation)
void variation(const ContainerType0 &phi, ContainerType1 &sigma) const
Definition elliptic.h:542
Elliptic2d(const Geometry &g, bc bcx, bc bcy, direction dir=forward, value_type jfactor=1., bool chi_weight_jump=false)
Construct from grid and boundary conditions.
Definition elliptic.h:308
void operator()(const ContainerType0 &x, ContainerType1 &y) const
Compute elliptic term and store in output.
Definition elliptic.h:444
const Container & get_sigma() const
Get scalar part of Chi tensor.
Definition elliptic.h:393
A 3d negative elliptic differential operator .
Definition elliptic.h:633
const Container & get_sigma() const
Get scalar part of Chi tensor.
Definition elliptic.h:731
get_value_type< Container > value_type
Definition elliptic.h:638
void set_compute_in_2d(bool compute_in_2d)
Restrict the problem to the first 2 dimensions.
Definition elliptic.h:757
const Container & weights() const
Return the weights making the operator self-adjoint.
Definition elliptic.h:734
const SparseTensor< Container > & get_tau() const
Get tensor part of Chi tensor.
Definition elliptic.h:729
bool get_jump_weighting() const
Get the current state of chi weighted jump terms.
Definition elliptic.h:748
void set_chi(const SparseTensor< ContainerType0 > &tau)
Change tensor part in Chi tensor.
Definition elliptic.h:724
void symv(const ContainerType0 &x, ContainerType1 &y) const
Compute elliptic term and store in output.
Definition elliptic.h:763
void set_chi(const ContainerType0 &sigma)
Change scalar part in Chi tensor.
Definition elliptic.h:712
void symv(value_type alpha, const ContainerType0 &x, value_type beta, ContainerType1 &y) const
Compute elliptic term and add to output.
Definition elliptic.h:768
void set_jump_weighting(bool jump_weighting)
Set the chi weighting of jump terms.
Definition elliptic.h:746
void construct(Params &&...ps)
Perfect forward parameters to one of the constructors.
Definition elliptic.h:704
const Container & precond() const
Return the default preconditioner to use in conjugate gradient.
Definition elliptic.h:738
void set_jfactor(value_type new_jfactor)
Set the currently used jfactor ( )
Definition elliptic.h:742
value_type get_jfactor() const
Get the currently used jfactor ( )
Definition elliptic.h:744
void symv(value_type alpha, const ContainerType0 &x, value_type jfactor, const ContainerType2 &sigma, value_type beta, ContainerType1 &y) const
Compute elliptic term and add to output.
Definition elliptic.h:774
Container container_type
Definition elliptic.h:637
Elliptic3d()=default
empty object ( no memory allocation)
void variation(const ContainerTypeL &lambda, const ContainerType0 &phi, ContainerType1 &sigma) const
Definition elliptic.h:835
Elliptic3d(const Geometry &g, direction dir=forward, value_type jfactor=1., bool chi_weight_jump=false)
Construct from Grid.
Definition elliptic.h:652
void variation(value_type alpha, const ContainerTypeL &lambda, const ContainerType0 &phi, value_type beta, ContainerType1 &sigma) const
Definition elliptic.h:840
Geometry geometry_type
Definition elliptic.h:635
Elliptic3d(const Geometry &g, bc bcx, bc bcy, bc bcz, direction dir=forward, value_type jfactor=1., bool chi_weight_jump=false)
Construct from grid and boundary conditions.
Definition elliptic.h:670
void variation(const ContainerType0 &phi, ContainerType1 &sigma) const
Definition elliptic.h:830
Function discretization routines.
DG_DEVICE T one(T, Ts ...)
Definition functions.h:24
void copy(const ContainerTypeIn &source, ContainerTypeOut &target)
Definition blas1.h:243
void axpbypgz(value_type alpha, const ContainerType1 &x, value_type1 beta, const ContainerType2 &y, value_type2 gamma, ContainerType &z)
Definition blas1.h:337
void axpby(value_type alpha, const ContainerType1 &x, value_type1 beta, ContainerType &y)
Definition blas1.h:306
void pointwiseDot(value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, value_type1 beta, ContainerType &y)
Definition blas1.h:406
void assign(const from_ContainerType &from, ContainerType &to, Params &&... ps)
Generic way to assign the contents of a from_ContainerType object to a ContainerType object optionall...
Definition blas1.h:767
void scal(ContainerType &x, value_type alpha)
Definition blas1.h:263
void pointwiseDivide(value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, value_type1 beta, ContainerType &y)
Definition blas1.h:495
void gemv(get_value_type< ContainerType1 > alpha, MatrixType &&M, const ContainerType1 &x, get_value_type< ContainerType1 > beta, ContainerType2 &y)
Alias for blas2::symv ;.
Definition blas2.h:345
void transfer(const MatrixType &x, AnotherMatrixType &y)
; Generic way to copy and/or convert a Matrix type to a different Matrix type
Definition blas2.h:479
void symv(MatrixType &&M, const ContainerType1 &x, ContainerType2 &y)
Definition blas2.h:331
auto dx(const Topology &g, dg::bc bc, dg::direction dir=centered)
Definition derivativesT.h:14
auto dy(const Topology &g, dg::bc bc, dg::direction dir=centered)
Short for dg::create::derivative( 1, g, bc, dir);
Definition derivativesT.h:21
auto jumpY(const Topology &g, bc bc)
Short for dg::create::jump( 1, g, bc);
Definition derivativesT.h:43
bc
Switch between boundary conditions.
Definition enums.h:15
auto jumpZ(const Topology &g, bc bc)
Short for dg::create::jump( 2, g, bc);
Definition derivativesT.h:50
direction
Direction of a discrete derivative.
Definition enums.h:97
auto dz(const Topology &g, dg::bc bc, dg::direction dir=centered)
Short for dg::create::derivative( 2, g, bc, dir);
Definition derivativesT.h:28
bc inverse(bc bound)
invert boundary condition
Definition enums.h:87
auto jumpX(const Topology &g, bc bc)
Short for dg::create::jump( 0, g, bc);
Definition derivativesT.h:36
@ forward
forward derivative (cell to the right and current cell)
Definition enums.h:98
@ centered
centered derivative (cell to the left and right and current cell)
Definition enums.h:100
typename TensorTraits< std::decay_t< Vector > >::value_type get_value_type
Definition tensor_traits.h:45
auto weights(const Topology &g)
Nodal weight coefficients.
Definition weights.h:62
auto evaluate(Functor &&f, const Topology &g)
Evaluate a function on grid coordinates
Definition evaluation.h:74
Geometry::host_vector volume(const Geometry &g)
Create the volume element on the grid (including weights!!)
Definition transform.h:192
void scalar_product2d(value_type0 alpha, const ContainerTypeL &lambda, const ContainerType0 &v0, const ContainerType1 &v1, const SparseTensor< ContainerType2 > &t, const ContainerTypeM &mu, const ContainerType3 &w0, const ContainerType4 &w1, value_type1 beta, ContainerType5 &y)
Definition multiply.h:493
void scalar_product3d(value_type0 alpha, const ContainerTypeL &lambda, const ContainerType0 &v0, const ContainerType1 &v1, const ContainerType2 &v2, const SparseTensor< ContainerType3 > &t, const ContainerTypeM &mu, const ContainerType4 &w0, const ContainerType5 &w1, const ContainerType6 &w2, value_type1 beta, ContainerType7 &y)
Definition multiply.h:533
void multiply2d(const ContainerTypeL &lambda, const SparseTensor< ContainerType0 > &t, const ContainerType1 &in0, const ContainerType2 &in1, const ContainerTypeM &mu, ContainerType3 &out0, ContainerType4 &out1)
Definition multiply.h:215
ContainerType volume(const SparseTensor< ContainerType > &t)
Definition multiply.h:389
void multiply3d(const ContainerTypeL &lambda, const SparseTensor< ContainerType0 > &t, const ContainerType1 &in0, const ContainerType2 &in1, const ContainerType3 &in2, const ContainerTypeM &mu, ContainerType4 &out0, ContainerType5 &out1, ContainerType6 &out2)
Definition multiply.h:240
Function discretization routines for mpi vectors.
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Ell Sparse Block Matrix format.
Definition sparseblockmat.h:46
Class for 2x2 and 3x3 matrices sharing elements.
Definition tensor.h:51
NotATensorTag tensor_category
Definition tensor_traits.h:40