16template<
class real_type>
21 return do_compute_jacobian();
25 return do_compute_metric();
28 std::vector<MPI_Vector<thrust::host_vector<real_type>> >
map()
const{
29 return do_compute_map();
50 virtual std::vector<MPI_Vector<thrust::host_vector<real_type>> > do_compute_map()
const{
51 std::vector<MPI_Vector<thrust::host_vector<real_type>>>
map(2);
61template<
class real_type>
66 return do_compute_jacobian();
70 return do_compute_metric();
73 std::vector<MPI_Vector<thrust::host_vector<real_type>> >
map()
const{
74 return do_compute_map();
95 virtual std::vector<MPI_Vector<thrust::host_vector<real_type>> > do_compute_map()
const{
96 std::vector<MPI_Vector<thrust::host_vector<real_type>>>
map(3);
105template<
class real_type>
115 return do_perp_grid();
139template<
class real_type>
144 RealCartesianMPIGrid2d( real_type
x0, real_type
x1, real_type
y0, real_type
y1,
unsigned n,
unsigned Nx,
unsigned Ny, MPI_Comm comm):
aRealMPIGeometry2d<real_type>( {
x0,
x1,
n,
Nx,
dg::PER}, {
y0,
y1,
n,
Ny,
dg::PER}, comm){}
149 RealCartesianMPIGrid2d( real_type
x0, real_type
x1, real_type
y0, real_type
y1,
unsigned n,
unsigned Nx,
unsigned Ny,
bc bcx,
bc bcy, MPI_Comm comm):
dg::
aRealMPIGeometry2d<real_type>( {
x0,
x1,
n,
Nx,
bcx}, {
y0,
y1,
n,
Ny,
bcy}, comm){}
162 virtual void do_set(
unsigned nx,
unsigned Nx,
unsigned ny,
unsigned Ny)
override final{
171template<
class real_type>
177 RealCartesianMPIGrid3d( real_type
x0, real_type
x1, real_type
y0, real_type
y1, real_type
z0, real_type
z1,
unsigned n,
unsigned Nx,
unsigned Ny,
unsigned Nz, MPI_Comm comm):
aRealProductMPIGeometry3d<real_type>( {
x0,
x1,
n,
Nx,
dg::PER}, {
y0,
y1,
n,
Ny,
dg::PER}, {
z0,
z1, 1,
Nz,
dg::PER}, comm){}
182 RealCartesianMPIGrid3d( real_type
x0, real_type
x1, real_type
y0, real_type
y1, real_type
z0, real_type
z1,
unsigned n,
unsigned Nx,
unsigned Ny,
unsigned Nz,
bc bcx,
bc bcy,
bc bcz, MPI_Comm comm):
aRealProductMPIGeometry3d<real_type>( {
x0,
x1,
n,
Nx,
bcx}, {
y0,
y1,
n,
Ny,
bcy}, {
z0,
z1, 1,
Nz,
bcz}, comm){}
202 virtual void do_set(
unsigned nx,
unsigned Nx,
unsigned ny,
unsigned Ny,
unsigned nz,
unsigned Nz)
override final{
210template<
class real_type>
218 RealCylindricalMPIGrid3d( real_type
x0, real_type
x1, real_type
y0, real_type
y1, real_type
z0, real_type
z1,
unsigned n,
unsigned Nx,
unsigned Ny,
unsigned Nz,
bc bcx,
bc bcy,
bc bcz, MPI_Comm comm):
aRealProductMPIGeometry3d<real_type>( {
x0,
x1,
n,
Nx,
bcx}, {
y0,
y1,
n,
Ny,
bcy}, {
z0,
z1, 1,
Nz,
bcz}, comm){}
224 RealCylindricalMPIGrid3d( real_type
x0, real_type
x1, real_type
y0, real_type
y1, real_type
z0, real_type
z1,
unsigned n,
unsigned Nx,
unsigned Ny,
unsigned Nz,
bc bcx,
bc bcy, MPI_Comm comm):
aRealProductMPIGeometry3d<real_type>( {
x0,
x1,
n,
Nx,
bcx}, {
y0,
y1,
n,
Ny,
bcy}, {
z0,
z1, 1,
Nz,
dg::PER}, comm){}
241 virtual SparseTensor<MPI_Vector<thrust::host_vector<real_type>> > do_compute_metric()const override final{
242 SparseTensor<MPI_Vector<thrust::host_vector<real_type>>>
metric(*
this);
244 for(
unsigned i = 0; i<this->
local().size(); i++)
245 R.data()[i] = 1./R.data()[i]/R.data()[i];
247 metric.values().push_back(R);
250 virtual void do_set(
unsigned nx,
unsigned Nx,
unsigned ny,
unsigned Ny,
unsigned nz,
unsigned Nz)
override final{
static DG_DEVICE double cooY2d(double x, double y)
Definition: functions.h:45
static DG_DEVICE double cooZ3d(double x, double y, double z)
Definition: functions.h:49
static DG_DEVICE double cooY3d(double x, double y, double z)
Definition: functions.h:47
static DG_DEVICE double cooX2d(double x, double y)
Definition: functions.h:40
static DG_DEVICE double cooX3d(double x, double y, double z)
Definition: functions.h:42
bc
Switch between boundary conditions.
Definition: enums.h:15
@ PER
periodic boundaries
Definition: enums.h:16
thrust::host_vector< real_type > evaluate(UnaryOp f, const RealGrid1d< real_type > &g)
Evaluate a 1d function on grid coordinates.
Definition: evaluation.h:67
dg::aRealProductMPIGeometry3d< double > aProductMPIGeometry3d
Definition: mpi_base.h:260
dg::RealCartesianMPIGrid3d< double > CartesianMPIGrid3d
Definition: mpi_base.h:262
dg::RealCartesianMPIGrid2d< double > CartesianMPIGrid2d
Definition: mpi_base.h:261
dg::aRealMPIGeometry2d< double > aMPIGeometry2d
Definition: mpi_base.h:258
dg::RealCylindricalMPIGrid3d< double > CylindricalMPIGrid3d
Definition: mpi_base.h:263
dg::aRealMPIGeometry3d< double > aMPIGeometry3d
Definition: mpi_base.h:259
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
two-dimensional Grid with Cartesian metric
Definition: base_geometry.h:215
three-dimensional Grid with Cartesian metric
Definition: base_geometry.h:240
The mpi version of RealCartesianGrid2d.
Definition: mpi_base.h:141
virtual RealCartesianMPIGrid2d * clone() const override final
Geometries are cloneable.
Definition: mpi_base.h:156
RealCartesianMPIGrid2d(real_type x0, real_type x1, real_type y0, real_type y1, unsigned n, unsigned Nx, unsigned Ny, bc bcx, bc bcy, MPI_Comm comm)
Equal polynomial coefficients.
Definition: mpi_base.h:149
RealCartesianMPIGrid2d(real_type x0, real_type x1, real_type y0, real_type y1, unsigned n, unsigned Nx, unsigned Ny, MPI_Comm comm)
Equal polynomial coefficients.
Definition: mpi_base.h:144
virtual RealCartesianGrid2d< real_type > * global_geometry() const override final
Construct the global non-MPI geometry.
Definition: mpi_base.h:157
RealCartesianMPIGrid2d(const dg::RealMPIGrid2d< real_type > &g)
Implicit type conversion from MPIGrid2d.
Definition: mpi_base.h:155
RealCartesianMPIGrid2d(RealGrid1d< real_type > gx, RealGrid1d< real_type > gy, MPI_Comm comm)
Construct a 2d grid as the product of two 1d grids.
Definition: mpi_base.h:152
The mpi version of RealCartesianGrid3d.
Definition: mpi_base.h:173
RealCartesianMPIGrid3d(real_type x0, real_type x1, real_type y0, real_type y1, real_type z0, real_type z1, unsigned n, unsigned Nx, unsigned Ny, unsigned Nz, MPI_Comm comm)
Equal polynomial coefficients.
Definition: mpi_base.h:177
virtual RealCartesianMPIGrid3d * clone() const override final
Geometries are cloneable.
Definition: mpi_base.h:187
RealCartesianMPIGrid3d(real_type x0, real_type x1, real_type y0, real_type y1, real_type z0, real_type z1, unsigned n, unsigned Nx, unsigned Ny, unsigned Nz, bc bcx, bc bcy, bc bcz, MPI_Comm comm)
Equal polynomial coefficients.
Definition: mpi_base.h:182
RealCartesianMPIGrid3d(RealGrid1d< real_type > gx, RealGrid1d< real_type > gy, RealGrid1d< real_type > gz, MPI_Comm comm)
Construct a 3d topology as the product of three 1d grids.
Definition: mpi_base.h:192
virtual RealCartesianGrid3d< real_type > * global_geometry() const override final
Construct the global non-MPI geometry.
Definition: mpi_base.h:193
RealCartesianMPIGrid3d(const dg::RealMPIGrid3d< real_type > &g)
Implicit type conversion from RealMPIGrid3d.
Definition: mpi_base.h:186
three-dimensional Grid with Cylindrical metric
Definition: base_geometry.h:271
the mpi version of RealCylindricalGrid3d
Definition: mpi_base.h:212
virtual RealCylindricalGrid3d< real_type > * global_geometry() const override final
Construct the global non-MPI geometry.
Definition: mpi_base.h:233
RealCylindricalMPIGrid3d(real_type x0, real_type x1, real_type y0, real_type y1, real_type z0, real_type z1, unsigned n, unsigned Nx, unsigned Ny, unsigned Nz, bc bcx, bc bcy, bc bcz, MPI_Comm comm)
Equal polynomial coefficients.
Definition: mpi_base.h:218
virtual RealCylindricalMPIGrid3d< real_type > * clone() const override final
Geometries are cloneable.
Definition: mpi_base.h:230
RealCylindricalMPIGrid3d(RealGrid1d< real_type > gx, RealGrid1d< real_type > gy, RealGrid1d< real_type > gz, MPI_Comm comm)
Construct a 3d topology as the product of three 1d grids.
Definition: mpi_base.h:228
RealCylindricalMPIGrid3d(real_type x0, real_type x1, real_type y0, real_type y1, real_type z0, real_type z1, unsigned n, unsigned Nx, unsigned Ny, unsigned Nz, bc bcx, bc bcy, MPI_Comm comm)
Equal polynomial coefficients.
Definition: mpi_base.h:224
1D grid
Definition: grid.h:80
The simplest implementation of aRealMPITopology2d.
Definition: mpi_grid.h:691
The simplest implementation of aRealMPITopology3d.
Definition: mpi_grid.h:727
Class for 2x2 and 3x3 matrices sharing elements.
Definition: tensor.h:66
This is the abstract interface class for a two-dimensional Geometry.
Definition: base_geometry.h:15
This is the abstract interface class for a three-dimensional Geometry.
Definition: base_geometry.h:89
This is the abstract interface class for a two-dimensional Geometry.
Definition: mpi_base.h:18
virtual aRealMPIGeometry2d * clone() const =0
Geometries are cloneable.
SparseTensor< MPI_Vector< thrust::host_vector< real_type > > > jacobian() const
The Jacobian of the coordinate transformation from physical to computational space.
Definition: mpi_base.h:20
aRealMPIGeometry2d & operator=(const aRealMPIGeometry2d &src)=default
aRealMPIGeometry2d(const aRealMPIGeometry2d &src)=default
SparseTensor< MPI_Vector< thrust::host_vector< real_type > > > metric() const
The (inverse) metric tensor of the coordinate system.
Definition: mpi_base.h:24
std::vector< MPI_Vector< thrust::host_vector< real_type > > > map() const
The coordinate map from computational to physical space.
Definition: mpi_base.h:28
virtual ~aRealMPIGeometry2d()=default
allow deletion through base class pointer
virtual aRealGeometry2d< real_type > * global_geometry() const =0
Construct the global non-MPI geometry.
This is the abstract interface class for a three-dimensional MPIGeometry.
Definition: mpi_base.h:63
aRealMPIGeometry3d(const aRealMPIGeometry3d &src)=default
aRealMPIGeometry3d & operator=(const aRealMPIGeometry3d &src)=default
SparseTensor< MPI_Vector< thrust::host_vector< real_type > > > jacobian() const
The Jacobian of the coordinate transformation from physical to computational space.
Definition: mpi_base.h:65
virtual aRealMPIGeometry3d * clone() const =0
Geometries are cloneable.
virtual aRealGeometry3d< real_type > * global_geometry() const =0
Construct the global non-MPI geometry.
SparseTensor< MPI_Vector< thrust::host_vector< real_type > > > metric() const
The (inverse) metric tensor of the coordinate system.
Definition: mpi_base.h:69
virtual ~aRealMPIGeometry3d()=default
allow deletion through base class pointer
std::vector< MPI_Vector< thrust::host_vector< real_type > > > map() const
The coordinate map from computational to physical space.
Definition: mpi_base.h:73
2D MPI abstract grid class
Definition: mpi_grid.h:45
real_type x1() const
Return global x1.
Definition: mpi_grid.h:62
unsigned n() const
Return n.
Definition: mpi_grid.h:104
bc bcy() const
global y boundary
Definition: mpi_grid.h:132
unsigned nx() const
number of polynomial coefficients in x
Definition: mpi_grid.h:106
unsigned ny() const
number of polynomial coefficients in y
Definition: mpi_grid.h:108
real_type y0() const
Return global y0.
Definition: mpi_grid.h:68
unsigned Nx() const
Return the global number of cells.
Definition: mpi_grid.h:114
unsigned Ny() const
Return the global number of cells.
Definition: mpi_grid.h:120
real_type y1() const
Return global y1.
Definition: mpi_grid.h:74
virtual void do_set(unsigned new_nx, unsigned new_Nx, unsigned new_ny, unsigned new_Ny)=0
This function has an implementation.
MPI_Comm communicator() const
Return mpi cartesian communicator that is used in this grid.
Definition: mpi_grid.h:138
const RealGrid2d< real_type > & global() const
Return the global non-MPI grid.
Definition: mpi_grid.h:262
real_type x0() const
Return global x0.
Definition: mpi_grid.h:56
bc bcx() const
global x boundary
Definition: mpi_grid.h:126
3D MPI Grid class
Definition: mpi_grid.h:329
bc bcz() const
global z boundary
Definition: mpi_grid.h:454
MPI_Comm get_perp_comm() const
MPI Cartesian communicator in the first two dimensions (x and y)
Definition: mpi_grid.h:464
unsigned nz() const
number of polynomial coefficients in z
Definition: mpi_grid.h:418
unsigned Nz() const
Return the global number of cells.
Definition: mpi_grid.h:436
real_type x1() const
Return global x1.
Definition: mpi_grid.h:346
unsigned Ny() const
Return the global number of cells.
Definition: mpi_grid.h:430
MPI_Comm communicator() const
Return mpi cartesian communicator that is used in this grid.
Definition: mpi_grid.h:459
real_type y1() const
Return global y1.
Definition: mpi_grid.h:358
bc bcy() const
global y boundary
Definition: mpi_grid.h:448
const RealGrid3d< real_type > & global() const
Return the global non-MPI grid.
Definition: mpi_grid.h:562
real_type z1() const
Return global z1.
Definition: mpi_grid.h:370
unsigned n() const
Return n.
Definition: mpi_grid.h:412
bc bcx() const
global x boundary
Definition: mpi_grid.h:442
virtual void do_set(unsigned new_nx, unsigned new_Nx, unsigned new_ny, unsigned new_Ny, unsigned new_nz, unsigned new_Nz)=0
unsigned ny() const
number of polynomial coefficients in y
Definition: mpi_grid.h:416
real_type z0() const
Return global z0.
Definition: mpi_grid.h:364
const RealGrid3d< real_type > & local() const
Return a non-MPI grid local for the calling process.
Definition: mpi_grid.h:560
unsigned Nx() const
Return the global number of cells.
Definition: mpi_grid.h:424
unsigned nx() const
number of polynomial coefficients in x
Definition: mpi_grid.h:414
real_type y0() const
Return global y0.
Definition: mpi_grid.h:352
real_type x0() const
Return global x0.
Definition: mpi_grid.h:340
A 3d product space Geometry .
Definition: mpi_base.h:107
aRealProductMPIGeometry3d & operator=(const aRealProductMPIGeometry3d &src)=default
virtual ~aRealProductMPIGeometry3d()=default
allow deletion through base class pointer
virtual aRealProductMPIGeometry3d * clone() const =0
Geometries are cloneable.
aRealProductMPIGeometry3d(const aRealProductMPIGeometry3d &src)=default
aRealMPIGeometry2d< real_type > * perp_grid() const
The grid made up by the first two dimensions.
Definition: mpi_base.h:114