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
14 template<int dimworld, class ct>
15 double 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
24 template<int dimworld, class ct>
25 double 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
35 template<int dimworld, class ct>
36 Dune::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 }
Dune::FieldVector< double, dimworld > u(const Dune::FieldVector< ct, dimworld > &, double)
Definition: transportproblem2.hh:36
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