13template<
class real_type>
14std::vector<real_type>
fem_weights(
const DLT<real_type>& dlt)
16 std::vector<real_type>
x = dlt.abscissas();
17 std::vector<real_type> w =
x;
18 unsigned n =
x.size();
23 w[0] = 0.5*(
x[1] - (
x[n-1]-2));
24 w[n-1] = 0.5*((
x[0]+2) - x[n-2]);
25 for(
unsigned i=1; i<n-1; i++)
26 w[i] = 0.5*(x[i+1]-x[i-1]);
52template<
class real_type>
55 thrust::host_vector<real_type> v( g.
size());
57 for(
unsigned i=0; i<g.
N(); i++)
58 for(
unsigned j=0; j<g.
n(); j++)
59 v[i*g.
n() + j] = g.
h()/2.*w[j];
63template<
class real_type>
67 for(
unsigned i=0; i<g.
size(); i++)
73template<
class real_type>
76 thrust::host_vector<real_type> v( g.
size());
79 for(
unsigned i=0; i<g.
size(); i++)
80 v[i] = g.
hx()*g.
hy()/4.*
82 wy[(i/(g.
nx()*g.
Nx()))%g.
ny()];
86template<
class real_type>
90 for(
unsigned i=0; i<g.
size(); i++)
96template<
class real_type>
99 thrust::host_vector<real_type> v( g.
size());
103 for(
unsigned i=0; i<g.
size(); i++)
104 v[i] = g.
hx()*g.
hy()*g.
hz()/8.*
106 wy[(i/(g.
nx()*g.
Nx()))%g.
ny()]*
112template<
class real_type>
115 thrust::host_vector<real_type> v =
fem_weights( g);
116 for(
unsigned i=0; i<g.
size(); i++)
thrust::host_vector< real_type > fem_inv_weights(const RealGrid1d< real_type > &g)
inverse finite element weight coefficients
Definition: fem_weights.h:64
thrust::host_vector< real_type > fem_weights(const aRealTopology3d< real_type > &g)
finite element weight coefficients
Definition: fem_weights.h:97
thrust::host_vector< real_type > fem_weights(const RealGrid1d< real_type > &g)
finite element weight coefficients
Definition: fem_weights.h:53
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
Creation functions for integration weights and their inverse.