13template<
class real_type>
28 return do_compute_jacobian();
43 return do_compute_metric();
56 std::vector<thrust::host_vector<real_type> >
map()
const{
57 return do_compute_map();
76 virtual std::vector<thrust::host_vector<real_type> > do_compute_map()
const{
77 std::vector<thrust::host_vector<real_type> >
map(2);
87template<
class real_type>
104 return do_compute_jacobian();
121 return do_compute_metric();
135 std::vector<thrust::host_vector<real_type> >
map()
const{
136 return do_compute_map();
155 virtual std::vector<thrust::host_vector<real_type> > do_compute_map()
const{
156 std::vector<thrust::host_vector<real_type> >
map(3);
178template<
class real_type>
188 return do_perp_grid();
213template<
class real_type>
217 RealCartesianGrid2d( real_type
x0, real_type
x1, real_type
y0, real_type
y1,
unsigned n,
unsigned Nx,
unsigned Ny,
bc bcx =
PER,
bc bcy =
PER):
dg::
aRealGeometry2d<real_type>({
x0,
x1,
n,
Nx,
bcx},{
y0,
y1,
n,
Ny,
bcy}){}
230 virtual void do_set(
unsigned nx,
unsigned Nx,
unsigned ny,
unsigned Ny)
override final{
238template<
class real_type>
244 RealCartesianGrid3d( 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 =
PER,
bc bcy =
PER,
bc bcz =
PER):
dg::
aRealProductGeometry3d<real_type>({
x0,
x1,
n,
Nx,
bcx}, {
y0,
y1,
n,
Ny,
bcy},{
z0,
z1,1,
Nz,
bcz}){}
260 virtual void do_set(
unsigned nx,
unsigned Nx,
unsigned ny,
unsigned Ny,
unsigned nz,
unsigned Nz)
override final{
269template<
class real_type>
276 RealCylindricalGrid3d( 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 =
PER,
bc bcy =
PER,
bc bcz =
PER):
dg::
aRealProductGeometry3d<real_type>({
x0,
x1,
n,
Nx,
bcx},{
y0,
y1,
n,
Ny,
bcy},{
z0,
z1,1,
Nz,
bcz}){}
286 virtual SparseTensor<thrust::host_vector<real_type> > do_compute_metric()const override final{
287 SparseTensor<thrust::host_vector<real_type> >
metric(*
this);
289 for(
unsigned i = 0; i<this->
size(); i++)
292 metric.values().push_back( R);
295 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
CartesianMPIGrid3d CartesianGrid3d
Definition: mpi_base.h:269
aMPIGeometry3d aGeometry3d
Definition: mpi_base.h:266
CylindricalMPIGrid3d CylindricalGrid3d
Definition: mpi_base.h:270
CartesianMPIGrid2d CartesianGrid2d
Definition: mpi_base.h:268
aProductMPIGeometry3d aProductGeometry3d
Definition: mpi_base.h:267
aMPIGeometry2d aGeometry2d
Definition: mpi_base.h:265
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
RealCartesianGrid2d(RealGrid1d< real_type > gx, RealGrid1d< real_type > gy)
Construct a 2d grid as the product of two 1d grids.
Definition: base_geometry.h:220
RealCartesianGrid2d(real_type x0, real_type x1, real_type y0, real_type y1, unsigned n, unsigned Nx, unsigned Ny, bc bcx=PER, bc bcy=PER)
Equal polynomial coefficients.
Definition: base_geometry.h:217
virtual RealCartesianGrid2d< real_type > * clone() const override final
Geometries are cloneable.
Definition: base_geometry.h:226
RealCartesianGrid2d(const dg::RealGrid2d< real_type > &g)
Construct from existing topology.
Definition: base_geometry.h:225
three-dimensional Grid with Cartesian metric
Definition: base_geometry.h:240
RealCartesianGrid3d(RealGrid1d< real_type > gx, RealGrid1d< real_type > gy, RealGrid1d< real_type > gz)
Construct a 3d topology as the product of three 1d grids.
Definition: base_geometry.h:247
RealCartesianGrid3d(const dg::RealGrid3d< real_type > &g)
Implicit type conversion from Grid3d.
Definition: base_geometry.h:252
virtual RealCartesianGrid3d * clone() const override final
Geometries are cloneable.
Definition: base_geometry.h:253
RealCartesianGrid3d(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=PER, bc bcy=PER, bc bcz=PER)
Equal polynomial coefficients.
Definition: base_geometry.h:244
three-dimensional Grid with Cylindrical metric
Definition: base_geometry.h:271
virtual RealCylindricalGrid3d * clone() const override final
Geometries are cloneable.
Definition: base_geometry.h:279
RealCylindricalGrid3d(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=PER, bc bcy=PER, bc bcz=PER)
Equal polynomial coefficients.
Definition: base_geometry.h:276
RealCylindricalGrid3d(RealGrid1d< real_type > gx, RealGrid1d< real_type > gy, RealGrid1d< real_type > gz)
Construct a 3d topology as the product of three 1d grids.
Definition: base_geometry.h:278
1D grid
Definition: grid.h:80
The simplest implementation of aRealTopology2d.
Definition: grid.h:818
The simplest implementation of aRealTopology3d.
Definition: grid.h:844
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
SparseTensor< thrust::host_vector< real_type > > jacobian() const
The Jacobian of the coordinate transformation from physical to computational space.
Definition: base_geometry.h:27
std::vector< thrust::host_vector< real_type > > map() const
The coordinate map from computational to physical space.
Definition: base_geometry.h:56
aRealGeometry2d & operator=(const aRealGeometry2d &src)=default
virtual aRealGeometry2d * clone() const =0
Geometries are cloneable.
virtual ~aRealGeometry2d()=default
allow deletion through base class pointer
aRealGeometry2d(const aRealGeometry2d &src)=default
SparseTensor< thrust::host_vector< real_type > > metric() const
The (inverse) metric tensor of the coordinate system.
Definition: base_geometry.h:42
This is the abstract interface class for a three-dimensional Geometry.
Definition: base_geometry.h:89
SparseTensor< thrust::host_vector< real_type > > jacobian() const
The Jacobian of the coordinate transformation from physical to computational space.
Definition: base_geometry.h:103
aRealGeometry3d(const aRealGeometry3d &src)=default
aRealGeometry3d & operator=(const aRealGeometry3d &src)=default
SparseTensor< thrust::host_vector< real_type > > metric() const
The (inverse) metric tensor of the coordinate system.
Definition: base_geometry.h:120
virtual aRealGeometry3d * clone() const =0
Geometries are cloneable.
virtual ~aRealGeometry3d()=default
allow deletion through base class pointer
std::vector< thrust::host_vector< real_type > > map() const
The coordinate map from computational to physical space.
Definition: base_geometry.h:135
A 3d product space Geometry .
Definition: base_geometry.h:180
aRealProductGeometry3d & operator=(const aRealProductGeometry3d &src)=default
aRealGeometry2d< real_type > * perp_grid() const
The grid made up by the first two dimensions.
Definition: base_geometry.h:187
virtual aRealProductGeometry3d * clone() const =0
Geometries are cloneable.
aRealProductGeometry3d(const aRealProductGeometry3d &src)=default
virtual ~aRealProductGeometry3d()=default
allow deletion through base class pointer
An abstract base class for two-dimensional grids.
Definition: grid.h:277
unsigned n() const
number of polynomial coefficients in x
Definition: grid.h:336
real_type x0() const
Left boundary in x.
Definition: grid.h:288
real_type y1() const
Right boundary in y.
Definition: grid.h:306
const RealGrid1d< real_type > & gy() const
The y-axis grid.
Definition: grid.h:379
unsigned ny() const
number of polynomial coefficients in y
Definition: grid.h:340
bc bcx() const
boundary conditions in x
Definition: grid.h:358
real_type y0() const
left boundary in y
Definition: grid.h:300
unsigned Nx() const
number of cells in x
Definition: grid.h:346
bc bcy() const
boundary conditions in y
Definition: grid.h:364
real_type x1() const
Right boundary in x.
Definition: grid.h:294
virtual void do_set(unsigned new_nx, unsigned new_Nx, unsigned new_ny, unsigned new_Ny)=0
const RealGrid1d< real_type > & gx() const
The x-axis grid.
Definition: grid.h:377
unsigned nx() const
number of polynomial coefficients in x
Definition: grid.h:338
unsigned Ny() const
number of cells in y
Definition: grid.h:352
An abstract base class for three-dimensional grids.
Definition: grid.h:523
real_type y0() const
left boundary in y
Definition: grid.h:547
unsigned size() const
The total number of points.
Definition: grid.h:670
const RealGrid1d< real_type > & gz() const
The z-axis grid.
Definition: grid.h:664
unsigned nz() const
number of polynomial coefficients in z
Definition: grid.h:616
bc bcz() const
boundary conditions in z
Definition: grid.h:652
unsigned Nx() const
number of points in x
Definition: grid.h:622
unsigned ny() const
number of polynomial coefficients in y
Definition: grid.h:614
const RealGrid1d< real_type > & gx() const
The x-axis grid.
Definition: grid.h:660
real_type x0() const
left boundary in x
Definition: grid.h:534
real_type y1() const
right boundary in y
Definition: grid.h:553
const RealGrid1d< real_type > & gy() const
The y-axis grid.
Definition: grid.h:662
real_type z0() const
left boundary in z
Definition: grid.h:560
virtual void do_set(unsigned new_nx, unsigned new_Nx, unsigned new_ny, unsigned new_Ny, unsigned new_nz, unsigned new_Nz)=0
unsigned n() const
number of polynomial coefficients in x
Definition: grid.h:610
real_type x1() const
right boundary in x
Definition: grid.h:540
unsigned Ny() const
number of points in y
Definition: grid.h:628
bc bcy() const
boundary conditions in y
Definition: grid.h:646
bc bcx() const
boundary conditions in x
Definition: grid.h:640
real_type z1() const
right boundary in z
Definition: grid.h:566
unsigned Nz() const
number of points in z
Definition: grid.h:634
unsigned nx() const
number of polynomial coefficients in x
Definition: grid.h:612