transportproblem2.hh
Go to the documentation of this file.
1//===============================================================
2// We want to solve the PDE
3//
4// dc/dt + div( uc ) = 0 in Omega
5// c = b on Gamma_in
6// c = c0 for t<0
7//
8// We define functions for the parameters c0, u and b.
9//===============================================================
10
11#include <dune/common/fvector.hh>
12
13// the initial condition c0
14template<int dimworld, class ct>
15double c0 (const Dune::FieldVector<ct,dimworld>& x)
16{
17 if (x.two_norm()>0.125 && x.two_norm()<0.5)
18 return 1.0;
19 else
20 return 0.0;
21}
22
23// the boundary condition b on inflow boundary
24template<int dimworld, class ct>
25double b (const Dune::FieldVector<ct,dimworld>& x, double t)
26{
27 return 0.0;
28 if (x.two_norm()<t+0.125)
29 return 1.0;
30 else
31 return 0.0;
32}
33
34// the vector field u is returned in r
35template<int dimworld, class ct>
36Dune::FieldVector<double,dimworld> u (const Dune::FieldVector<ct,dimworld>& /*x*/, double /*t*/)
37{
38 Dune::FieldVector<double,dimworld> r(1.0);
39 return r;
40}
double b(const Dune::FieldVector< ct, dimworld > &x, double t)
Definition: transportproblem2.hh:25
double c0(const Dune::FieldVector< ct, dimworld > &x)
Definition: transportproblem2.hh:15
Dune::FieldVector< double, dimworld > u(const Dune::FieldVector< ct, dimworld > &, double)
Definition: transportproblem2.hh:36