3#include <thrust/host_vector.h>
40template<
class real_type>
43 thrust::host_vector<real_type> v( g.
size());
44 for(
unsigned i=0; i<g.
N(); i++)
45 for(
unsigned j=0; j<g.
n(); j++)
46 v[i*g.
n() + j] = g.
h()/2.*g.
dlt().weights()[j];
50template<
class real_type>
53 thrust::host_vector<real_type> v =
weights( g);
54 for(
unsigned i=0; i<g.
size(); i++)
61template<
class real_type>
64 thrust::host_vector<real_type> v( g.
size());
65 for(
unsigned i=0; i<g.
size(); i++)
66 v[i] = g.
hx()*g.
hy()/4.*
67 g.
dlty().weights()[(i/(g.
nx()*g.
Nx()))%g.
ny()]*
68 g.
dltx().weights()[i%g.
nx()];
72template<
class real_type>
75 thrust::host_vector<real_type> v =
weights( g);
76 for(
unsigned i=0; i<g.
size(); i++)
82template<
class real_type>
85 thrust::host_vector<real_type> w( g.
size());
87 for(
unsigned i=0; i<g.
size(); i++)
88 w[i] = g.
hx()/2.* g.
dltx().weights()[i%g.
nx()];
91 for(
unsigned i=0; i<g.
size(); i++)
92 w[i] = g.
hy()/2.* g.
dlty().weights()[(i/(g.
nx()*g.
Nx()))%g.
ny()];
100template<
class real_type>
104 thrust::host_vector<real_type> v( g.
size());
105 for(
unsigned i=0; i<g.
size(); i++)
106 v[i] = g.
hx()*g.
hy()*g.
hz()/4.*
107 (g.
dltz().weights()[(i/(g.
nx()*g.
ny()*g.
Nx()*g.
Ny()))%g.
nz()]/2.)*
108 g.
dlty().weights()[(i/(g.
nx()*g.
Nx()))%g.
ny()]*
109 g.
dltx().weights()[i%g.
nx()];
114template<
class real_type>
117 thrust::host_vector<real_type> v =
weights( g);
118 for(
unsigned i=0; i<g.
size(); i++)
124template<
class real_type>
127 thrust::host_vector<real_type> w( g.
size());
129 for(
unsigned i=0; i<g.
size(); i++)
130 w[i] = g.
hx()/2.* g.
dltx().weights()[i%g.
nx()];
133 for(
unsigned i=0; i<g.
size(); i++)
134 w[i] = g.
hy()/2.* g.
dlty().weights()[(i/(g.
nx()*g.
Nx()))%g.
ny()];
137 for(
unsigned i=0; i<g.
size(); i++)
138 w[i] = g.
hz()/2.* g.
dltz().weights()[(i/(g.
nx()*g.
Nx()*g.
ny()*g.
Ny()))%g.
nz()];
141 for(
unsigned i=0; i<g.
size(); i++)
143 w[i] = g.
hx()/2.* g.
dltx().weights()[i%g.
nx()];
144 w[i]*= g.
hy()/2.* g.
dlty().weights()[(i/(g.
nx()*g.
Nx()))%g.
ny()];
148 for(
unsigned i=0; i<g.
size(); i++)
150 w[i] = g.
hy()/2.* g.
dlty().weights()[(i/(g.
nx()*g.
Nx()))%g.
ny()];
151 w[i]*= g.
hz()/2.* g.
dltz().weights()[(i/(g.
nx()*g.
Nx()*g.
ny()*g.
Ny()))%g.
nz()];
155 for(
unsigned i=0; i<g.
size(); i++)
157 w[i] = g.
hx()/2.* g.
dltx().weights()[i%g.
nx()];
158 w[i]*= g.
hz()/2.* g.
dltz().weights()[(i/(g.
nx()*g.
Nx()*g.
ny()*g.
Ny()))%g.
nz()];
coo3d
3d contra- and covariant coordinates
Definition: enums.h:177
coo2d
2d coordinates
Definition: enums.h:171
MPI_Vector< thrust::host_vector< real_type > > weights(const aRealMPITopology2d< real_type > &g)
Nodal weight coefficients.
Definition: mpi_weights.h:22
MPI_Vector< thrust::host_vector< real_type > > inv_weights(const aRealMPITopology2d< real_type > &g)
inverse nodal weight coefficients
Definition: mpi_weights.h:29
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
1D grid
Definition: grid.h:80
real_type h() const
cell size
Definition: grid.h:129
unsigned n() const
number of polynomial coefficients
Definition: grid.h:141
const DLT< real_type > & dlt() const
the discrete legendre transformation
Definition: grid.h:197
unsigned size() const
n()*N() (Total number of grid points)
Definition: grid.h:191
unsigned N() const
number of cells
Definition: grid.h:135
An abstract base class for two-dimensional grids.
Definition: grid.h:277
const DLT< real_type > & dltx() const
discrete legendre trafo
Definition: grid.h:372
const DLT< real_type > & dlty() const
discrete legendre transformation in y
Definition: grid.h:374
real_type hy() const
cell size in y
Definition: grid.h:330
unsigned ny() const
number of polynomial coefficients in y
Definition: grid.h:340
unsigned size() const
The total number of points.
Definition: grid.h:424
real_type hx() const
cell size in x
Definition: grid.h:324
unsigned Nx() const
number of cells in x
Definition: grid.h:346
unsigned nx() const
number of polynomial coefficients in x
Definition: grid.h:338
An abstract base class for three-dimensional grids.
Definition: grid.h:523
unsigned size() const
The total number of points.
Definition: grid.h:670
const DLT< real_type > & dltz() const
discrete legendre transformation in z
Definition: grid.h:658
const DLT< real_type > & dltx() const
discrete legendre transformation in x
Definition: grid.h:654
unsigned nz() const
number of polynomial coefficients in z
Definition: grid.h:616
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 DLT< real_type > & dlty() const
discrete legendre transformation in y
Definition: grid.h:656
real_type hy() const
cell size in y
Definition: grid.h:598
real_type hx() const
cell size in x
Definition: grid.h:592
unsigned Ny() const
number of points in y
Definition: grid.h:628
real_type hz() const
cell size in z
Definition: grid.h:604
unsigned nx() const
number of polynomial coefficients in x
Definition: grid.h:612