|
| ArakawaX ()=default |
|
| ArakawaX (const Geometry &g) |
| Create Arakawa on a grid. More...
|
|
| ArakawaX (const Geometry &g, bc bcx, bc bcy) |
| Create Arakawa on a grid using different boundary conditions. More...
|
|
template<class ... Params> |
void | construct (Params &&...ps) |
| Perfect forward parameters to one of the constructors. More...
|
|
template<class ContainerType0 , class ContainerType1 , class ContainerType2 > |
void | operator() (const ContainerType0 &lhs, const ContainerType1 &rhs, ContainerType2 &result) |
| Compute Poisson bracket. More...
|
|
template<class ContainerType0 , class ContainerType1 , class ContainerType2 > |
void | operator() (value_type alpha, const ContainerType0 &lhs, const ContainerType1 &rhs, value_type beta, ContainerType2 &result) |
|
template<class ContainerType0 > |
void | set_chi (const ContainerType0 &new_chi) |
| Change Chi. More...
|
|
const Matrix & | dx () const |
| Return internally used x - derivative. More...
|
|
const Matrix & | dy () const |
| Return internally used y - derivative. More...
|
|
template<class Geometry, class Matrix, class Container>
struct dg::ArakawaX< Geometry, Matrix, Container >
Arakawa's scheme for Poisson bracket \( \{ f,g\} \).
Computes
\[ \{f,g\} := \chi/\sqrt{g_{2d}}\left(\partial_x f\partial_y g - \partial_y f\partial_x g\right) \]
where \( g_{2d} = g/g_{zz}\) is the two-dimensional volume element of the plane in 2x1 product space and \( \chi\) is an optional factor. If \( \chi=1\), then the discretization conserves, mass, energy and enstrophy.
const double lx = 2*
M_PI;
const double ly = 2*
M_PI;
double left( double x, double y) {
return sin(x)*cos(y);
}
double right( double x, double y) {
return sin(y)*cos(x);
}
double jacobian( double x, double y) {
return cos(x)*cos(y)*cos(x)*cos(y) - sin(x)*sin(y)*sin(x)*sin(y);
}
#define M_PI
M_PI is non-standard ... so MSVC complains.
Definition: functors.h:6
bc
Switch between boundary conditions.
Definition: enums.h:15
@ PER
periodic boundaries
Definition: enums.h:16
arakawa( lhs, rhs, jac);
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
Evaluate a 1d function on grid coordinates.
Definition: evaluation.h:67
thrust::device_vector< double > DVec
Device Vector. The device can be an OpenMP parallelized cpu or a gpu. This depends on the value of th...
Definition: typedefs.h:23
Arakawa's scheme for Poisson bracket .
Definition: arakawa.h:36
two-dimensional Grid with Cartesian metric
Definition: base_geometry.h:215
- Note
- This is the algorithm published in L. Einkemmer, M. Wiesenberger A conservative discontinuous Galerkin scheme for the 2D incompressible Navier-Stokes equations Computer Physics Communications 185, 2865-2873 (2014)
- See also
- A discussion of this and other advection schemes can also be found here https://mwiesenberger.github.io/advection
- 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
|
template<class Geometry , class Matrix , class Container >
template<class ContainerType0 , class ContainerType1 , class ContainerType2 >
void dg::ArakawaX< Geometry, Matrix, Container >::operator() |
( |
const ContainerType0 & |
lhs, |
|
|
const ContainerType1 & |
rhs, |
|
|
ContainerType2 & |
result |
|
) |
| |
|
inline |
Compute Poisson bracket.
Computes
\[ [f,g] := 1/\sqrt{g_{2d}}\left(\partial_x f\partial_y g - \partial_y f\partial_x g\right) \]
where \( g_{2d} = g/g_{zz}\) is the two-dimensional volume element of the plane in 2x1 product space.
- Parameters
-
lhs | left hand side in x-space |
rhs | rights hand side in x-space |
result | Poisson's bracket in x-space |
- Note
- memops: 30
- Template Parameters
-