35template<
class real_type>
52 a_bound_left += 0.5*t*l;
54 a_bound_left -= 0.5*t*l;
57 a_bound_right -= 0.5*t*r;
59 a_bound_right += 0.5*t*r;
61 a_bound_left = a_bound_right = a;
75 for(
int i=0; i<n; i++)
76 for(
int j=0; j<n; j++)
78 A.
data[(0*n+i)*n+j] = bp(i,j);
79 A.
data[(1*n+i)*n+j] = a(i,j);
80 A.
data[(2*n+i)*n+j] = b(i,j);
81 A.
data[(3*n+i)*n+j] = a_bound_left(i,j);
82 A.
data[(4*n+i)*n+j] = a_bound_right(i,j);
83 A.
data[(5*n+i)*n+j] = 0;
91 for(
int i=1; i<N-1; i++)
92 for(
int d=0; d<3; d++)
109 for(
int i=0; i<n; i++)
110 for(
int j=0; j<n; j++)
112 A.
data[(0*n+i)*n+j] = bp(i,j);
113 A.
data[(1*n+i)*n+j] = a(i,j);
114 A.
data[(2*n+i)*n+j] = b(i,j);
116 for(
int i=0; i<N; i++)
117 for(
int d=0; d<3; d++)
137template<
class real_type>
155 a_bound_right = t*(d);
167 for(
int i=0; i<n; i++)
168 for(
int j=0; j<n; j++)
170 A.
data[(0*n+i)*n+j] = a(i,j);
171 A.
data[(1*n+i)*n+j] = b(i,j);
172 A.
data[(2*n+i)*n+j] = a_bound_left(i,j);
173 A.
data[(3*n+i)*n+j] = a_bound_right(i,j);
174 A.
data[(4*n+i)*n+j] = 0;
180 for(
int i=1; i<N-1; i++)
181 for(
int d=0; d<2; d++)
196 for(
int i=0; i<n; i++)
197 for(
int j=0; j<n; j++)
199 A.
data[(0*n+i)*n+j] = a(i,j);
200 A.
data[(1*n+i)*n+j] = b(i,j);
202 for(
int i=0; i<N; i++)
203 for(
int d=0; d<2; d++)
223template<
class real_type>
253 for(
int i=0; i<n; i++)
254 for(
int j=0; j<n; j++)
256 A.
data[(0*n+i)*n+j] = bp(i,j);
257 A.
data[(1*n+i)*n+j] = a(i,j);
258 A.
data[(2*n+i)*n+j] = a_bound_left(i,j);
259 A.
data[(3*n+i)*n+j] = a_bound_right(i,j);
260 A.
data[(4*n+i)*n+j] = 0;
266 for(
int i=1; i<N-1; i++)
267 for(
int d=0; d<2; d++)
282 for(
int i=0; i<n; i++)
283 for(
int j=0; j<n; j++)
285 A.
data[(0*n+i)*n+j] = bp(i,j);
286 A.
data[(1*n+i)*n+j] = a(i,j);
288 for(
int i=0; i<N; i++)
289 for(
int d=0; d<2; d++)
309template<
class real_type>
338 for(
int i=0; i<n; i++)
339 for(
int j=0; j<n; j++)
341 A.
data[(0*n+i)*n+j] = bp(i,j);
342 A.
data[(1*n+i)*n+j] = a(i,j);
343 A.
data[(2*n+i)*n+j] = b(i,j);
344 A.
data[(3*n+i)*n+j] = a_bound_left(i,j);
345 A.
data[(4*n+i)*n+j] = a_bound_right(i,j);
346 A.
data[(5*n+i)*n+j] = 0;
354 for(
int i=1; i<N-1; i++)
355 for(
int d=0; d<3; d++)
372 for(
int i=0; i<n; i++)
373 for(
int j=0; j<n; j++)
375 A.
data[(0*n+i)*n+j] = bp(i,j);
376 A.
data[(1*n+i)*n+j] = a(i,j);
377 A.
data[(2*n+i)*n+j] = b(i,j);
379 for(
int i=0; i<N; i++)
380 for(
int d=0; d<3; d++)
401template<
class real_type>
426template<
class real_type>
442template<
class real_type>
445 return dx( g, g.
bcx(), dir);
457template<
class real_type>
460 return jump( g.
n(), g.
N(), g.
h(), bcx);
471template<
class real_type>
Operator transpose() const
Transposition.
Definition: operator.h:152
Some utility functions for the dg::evaluate routines.
EllSparseBlockMat< real_type > dx(const aRealTopology2d< real_type > &g, bc bcx, direction dir=centered)
Create 2d derivative in x-direction.
Definition: derivatives.h:33
bc
Switch between boundary conditions.
Definition: enums.h:15
direction
Direction of a discrete derivative.
Definition: enums.h:97
@ NEU_DIR
Neumann on left, Dirichlet on right boundary.
Definition: enums.h:19
@ PER
periodic boundaries
Definition: enums.h:16
@ NEU
Neumann on both boundaries.
Definition: enums.h:20
@ DIR
homogeneous dirichlet boundaries
Definition: enums.h:17
@ DIR_NEU
Dirichlet on left, Neumann on right boundary.
Definition: enums.h:18
@ backward
backward derivative (cell to the left and current cell)
Definition: enums.h:99
@ forward
forward derivative (cell to the right and current cell)
Definition: enums.h:98
@ centered
centered derivative (cell to the left and right and current cell)
Definition: enums.h:100
EllSparseBlockMat< real_type > dx_normed(int n, int N, real_type h, bc bcx, direction dir)
Create and assemble a host Matrix for normed derivative in 1d.
Definition: dx.h:402
EllSparseBlockMat< real_type > dx_plus(int n, int N, real_type h, bc bcx)
Create and assemble a host Matrix for the forward 1d single derivative.
Definition: dx.h:138
EllSparseBlockMat< real_type > dx_symm(int n, int N, real_type h, bc bcx)
Create and assemble a host Matrix for the centered 1d single derivative.
Definition: dx.h:36
EllSparseBlockMat< real_type > jump(int n, int N, real_type h, bc bcx)
Create and assemble a host Matrix for the jump terms in 1d.
Definition: dx.h:310
EllSparseBlockMat< real_type > dx_minus(int n, int N, real_type h, bc bcx)
Create and assemble a host Matrix for the backward 1d single derivative.
Definition: dx.h:224
This is the namespace for all functions and classes defined and used by the discontinuous Galerkin li...
Ell Sparse Block Matrix format.
Definition: sparseblockmat.h:46
thrust::host_vector< int > data_idx
has the same size as cols_idx and contains indices into the data array, i.e. the block number
Definition: sparseblockmat.h:128
thrust::host_vector< value_type > data
The data array is of size n*n*num_different_blocks and contains the blocks. The first block is contai...
Definition: sparseblockmat.h:126
thrust::host_vector< int > cols_idx
is of size num_rows*num_blocks_per_line and contains the column indices % n into the vector
Definition: sparseblockmat.h:127
1D grid
Definition: grid.h:80
real_type h() const
cell size
Definition: grid.h:129
bc bcx() const
boundary conditions
Definition: grid.h:147
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 N() const
number of cells
Definition: grid.h:135
Creation functions for integration weights and their inverse.