Changes
Page history
laplace identity
authored
Aug 11, 2019
by
Praetorius, Simon
Show whitespace changes
Inline
Side-by-side
examples/navier-stokes.md
View page @
8335d7e3
...
...
@@ -64,14 +64,15 @@ Implementation
We split the implementation into three parts, 1. the time derivative, 2. the stokes
operator and 3. any external forces. For addressing the different components of
the Taylor-Hood basis, we introduce the treepaths
`
auto
_v = Dune::Indices::_0`
and
`
auto
_p = Dune::Indices::_1`
for velocity and pressure, respectively.
the Taylor-Hood basis, we introduce the treepaths
`_v = Dune::Indices::_0`
and
`_p = Dune::Indices::_1`
for velocity and pressure, respectively.
### Problem framework
We have an instationary problem consist
ent
ing of a sequence of stationary equations
We have an in
-
stationary problem consisting of a sequence of stationary equations
for each timestep, thus we combine a
`ProblemInstat`
with a
`Problemstat`
.
```
c++
using
namespace
AMDiS
;
ProblemStat
prob
(
"stokes"
,
grid
,
basis
);
prob
.
initialize
(
INIT_ALL
);
...
...
@@ -99,7 +100,7 @@ prob.addMatrixOperator(opTime, _v, _v);
// <1/tau * u^old, v>
auto
opTimeOld
=
makeOperator
(
tag
::
testvec
{},
density
*
invTau
*
prob
.
s
olution
(
_v
));
density
*
invTau
*
prob
Instat
.
oldS
olution
(
_v
));
prob
.
addVectorOperator
(
opTimeOld
,
_v
);
for
(
int
i
=
0
;
i
<
Grid
::
dimensionworld
;
++
i
)
{
...
...
@@ -137,3 +138,7 @@ prob.addMatrixOperator(opP, _v, _p);
auto
opDiv
=
makeOperator
(
tag
::
test_divtrialvec
{},
1.0
);
prob
.
addMatrixOperator
(
opDiv
,
_p
,
_v
);
```
where we have used the identity
```
math
\nabla\mathbf{u}:\nabla\mathbf{v} = \sum_i \nabla u_i\cdot\nabla v_i
```
\ No newline at end of file