33template<
class Geometry,
class Matrix,
class Container >
62 template<
class ...Params>
66 *
this =
ArakawaX( std::forward<Params>( ps)...);
80 template<
class ContainerType0,
class ContainerType1,
class ContainerType2>
81 void operator()(
const ContainerType0& lhs,
const ContainerType1& rhs, ContainerType2& result){
82 return this->
operator()( 1., lhs, rhs, 0., result);
81 void operator()(
const ContainerType0& lhs,
const ContainerType1& rhs, ContainerType2& result) {
…}
84 template<
class ContainerType0,
class ContainerType1,
class ContainerType2>
92 template<
class ContainerType0>
93 void set_chi(
const ContainerType0& new_chi) {
93 void set_chi(
const ContainerType0& new_chi) {
…}
103 const Matrix&
dx()
const {
103 const Matrix&
dx()
const {
…}
112 const Matrix&
dy()
const {
112 const Matrix&
dy()
const {
…}
117 Container m_dxlhs, m_dxrhs, m_dylhs, m_dyrhs, m_helper;
118 Matrix m_bdxf, m_bdyf;
119 Container m_chi, m_perp_vol;
122template<
class Geometry,
class Matrix,
class Container>
124 ArakawaX( g, g.bcx(), g.bcy()) { }
126template<
class Geometry,
class Matrix,
class Container>
128 m_dxlhs(
dg::
construct<Container>(
dg::
evaluate(
one, g)) ), m_dxrhs(m_dxlhs), m_dylhs(m_dxlhs), m_dyrhs( m_dxlhs), m_helper( m_dxlhs),
140 void operator()(T lhs, T rhs, T dxlhs, T& dylhs, T& dxrhs, T& dyrhs)
const
143 result = DG_FMA( (1./3.)*dxlhs, dyrhs, result);
144 result = DG_FMA( -(1./3.)*dylhs, dxrhs, result);
146 temp = DG_FMA( (1./3.)*lhs, dyrhs, temp);
148 temp = DG_FMA( -(1./3.)*dylhs, rhs, temp);
151 temp = DG_FMA( (1./3.)*dxlhs, rhs, temp);
152 temp = DG_FMA( -(1./3.)*lhs, dxrhs, temp);
157template<
class Geometry,
class Matrix,
class Container>
158template<
class ContainerType0,
class ContainerType1,
class ContainerType2>
Function discretization routines.
DG_DEVICE T one(T x, Ts ...xs)
Definition functions.h:24
void pointwiseDot(value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, value_type1 beta, ContainerType &y)
Definition blas1.h:406
ContainerType construct(const from_ContainerType &from, Params &&... ps)
Generic way to construct an object of ContainerType given a from_ContainerType object and optional ad...
Definition blas1.h:792
void subroutine(Subroutine f, ContainerType &&x, ContainerTypes &&... xs)
; Customizable and generic blas1 function
Definition blas1.h:677
void pointwiseDivide(value_type alpha, const ContainerType1 &x1, const ContainerType2 &x2, value_type1 beta, ContainerType &y)
Definition blas1.h:495
void symv(MatrixType &&M, const ContainerType1 &x, ContainerType2 &y)
Definition blas2.h:325
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
bc
Switch between boundary conditions.
Definition enums.h:15
@ 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 evaluate(Functor &&f, const Topology &g)
Evaluate a function on grid coordinates
Definition evaluation.h:74
ContainerType volume2d(const SparseTensor< ContainerType > &t)
Definition multiply.h:362
#define DG_DEVICE
Expands to __host__ __device__ if compiled with nvcc else is empty.
Definition dg_doc.h:378
Function discretization routines for mpi vectors.
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Arakawa's scheme for Poisson bracket .
Definition arakawa.h:35
void set_chi(const ContainerType0 &new_chi)
Change Chi.
Definition arakawa.h:93
ArakawaX(const Geometry &g)
Create Arakawa on a grid.
void construct(Params &&...ps)
Perfect forward parameters to one of the constructors.
Definition arakawa.h:63
ArakawaX(const Geometry &g, bc bcx, bc bcy)
Create Arakawa on a grid using different boundary conditions.
const Matrix & dy() const
Return internally used y - derivative.
Definition arakawa.h:112
Matrix matrix_type
Definition arakawa.h:37
Container container_type
Definition arakawa.h:38
void operator()(const ContainerType0 &lhs, const ContainerType1 &rhs, ContainerType2 &result)
Compute Poisson bracket.
Definition arakawa.h:81
const Matrix & dx() const
Return internally used x - derivative.
Definition arakawa.h:103
void operator()(value_type alpha, const ContainerType0 &lhs, const ContainerType1 &rhs, value_type beta, ContainerType2 &result)
Geometry geometry_type
Definition arakawa.h:36
get_value_type< Container > value_type
Definition arakawa.h:39