laplace identity authored by Praetorius, Simon's avatar Praetorius, Simon
...@@ -64,14 +64,15 @@ Implementation ...@@ -64,14 +64,15 @@ Implementation
We split the implementation into three parts, 1. the time derivative, 2. the stokes 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 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 the Taylor-Hood basis, we introduce the treepaths `_v = Dune::Indices::_0` and
`auto _p = Dune::Indices::_1` for velocity and pressure, respectively. `_p = Dune::Indices::_1` for velocity and pressure, respectively.
### Problem framework ### Problem framework
We have an instationary problem consistenting 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`. for each timestep, thus we combine a `ProblemInstat` with a `Problemstat`.
```c++ ```c++
using namespace AMDiS;
ProblemStat prob("stokes", grid, basis); ProblemStat prob("stokes", grid, basis);
prob.initialize(INIT_ALL); prob.initialize(INIT_ALL);
...@@ -99,7 +100,7 @@ prob.addMatrixOperator(opTime, _v, _v); ...@@ -99,7 +100,7 @@ prob.addMatrixOperator(opTime, _v, _v);
// <1/tau * u^old, v> // <1/tau * u^old, v>
auto opTimeOld = makeOperator(tag::testvec{}, auto opTimeOld = makeOperator(tag::testvec{},
density * invTau * prob.solution(_v)); density * invTau * probInstat.oldSolution(_v));
prob.addVectorOperator(opTimeOld, _v); prob.addVectorOperator(opTimeOld, _v);
for (int i = 0; i < Grid::dimensionworld; ++i) { for (int i = 0; i < Grid::dimensionworld; ++i) {
...@@ -137,3 +138,7 @@ prob.addMatrixOperator(opP, _v, _p); ...@@ -137,3 +138,7 @@ prob.addMatrixOperator(opP, _v, _p);
auto opDiv = makeOperator(tag::test_divtrialvec{}, 1.0); auto opDiv = makeOperator(tag::test_divtrialvec{}, 1.0);
prob.addMatrixOperator(opDiv, _p, _v); 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