Rheolef  7.1
an efficient C++ finite element environment
navier_stokes_taylor_cks_dg.cc
Go to the documentation of this file.
1 #include "rheolef.h"
26 using namespace rheolef;
27 using namespace std;
28 #include "taylor.h"
29 #include "stokes_dirichlet_dg.icc"
30 #include "inertia_cks.icc"
31 int main(int argc, char**argv) {
32  environment rheolef (argc, argv);
33  geo omega (argv[1]);
34  space Xh (omega, argv[2], "vector");
35  space Qh (omega, argv[2]);
36  Float Re = (argc > 3) ? atof(argv[3]) : 1;
37  size_t max_iter = (argc > 4) ? atoi(argv[4]) : 1;
38  form a, b, c, mp;
39  field lh, kh;
40  stokes_dirichlet_dg (Xh, Qh, a, b, c, mp, lh, kh);
41  field uh (Xh, 0), ph (Qh, 0);
42  problem_mixed stokes (a, b, c);
43  stokes.set_metric (mp);
44  stokes.solve (lh, kh, uh, ph);
45  trial u (Xh); test v (Xh);
46  form a1 = a + Re*inertia (uh, u, v);
47  lh += Re*inertia_fix_rhs (v);
48  derr << "#k r as" << endl;
49  for (size_t k = 0; k < max_iter; ++k) {
50  stokes = problem_mixed (a1, b, c);
51  stokes.set_metric (mp);
52  stokes.solve (lh, kh, uh, ph);
53  form th = inertia (uh, u, v);
54  a1 = a + Re*th;
55  field rh = a1*uh + b.trans_mult(ph) - lh;
56  derr << k << " " << rh.max_abs() << " " << th(uh,uh) << endl;
57  }
58  dout << catchmark("Re") << Re << endl
59  << catchmark("u") << uh
60  << catchmark("p") << ph;
61 }
form
see the form page for the full documentation
rheolef::catchmark
see the catchmark page for the full documentation
Definition: catchmark.h:67
main
int main(int argc, char **argv)
Definition: navier_stokes_taylor_cks_dg.cc:31
taylor.h
The Taylor benchmark – right-hand-side and boundary condition.
field
see the field page for the full documentation
rheolef::problem_mixed
problem_mixed_basic< Float > problem_mixed
see the problem_mixed page for the full documentation
Definition: problem_mixed.h:236
problem_mixed
see the problem_mixed page for the full documentation
space
see the space page for the full documentation
mkgeo_ball.c
c
Definition: mkgeo_ball.sh:153
rheolef.h
rheolef - reference manual
stokes_dirichlet_dg.icc
The Stokes problem with Dirichlet boundary condition by the discontinuous Galerkin method – solver fu...
a
Definition: diffusion_isotropic.h:25
inertia
form inertia(W w, U u, V v, integrate_option iopt=integrate_option())
Definition: inertia.h:26
rheolef::environment
see the environment page for the full documentation
Definition: environment.h:115
lh
field lh(Float epsilon, Float t, const test &v)
Definition: burgers_diffusion_operators.icc:25
stokes_dirichlet_dg
void stokes_dirichlet_dg(const space &Xh, const space &Qh, form &a, form &b, form &c, form &mp, field &lh, field &kh, integrate_option iopt=integrate_option())
Definition: stokes_dirichlet_dg.icc:25
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
test
see the test page for the full documentation
u
Definition: leveque.h:25
inertia_cks.icc
The inertia term of the Navier-Stokes equation with the discontinuous Galerkin method – Cockburn,...
rheolef::derr
odiststream derr(cerr)
see the diststream page for the full documentation
Definition: diststream.h:436
Float
see the Float page for the full documentation
inertia_fix_rhs
field inertia_fix_rhs(test v, integrate_option iopt=integrate_option())
Definition: inertia.h:37
u
Float u(const point &x)
Definition: transmission_error.cc:26
mkgeo_ball.b
b
Definition: mkgeo_ball.sh:152
mkgeo_ball.a
a
Definition: mkgeo_ball.sh:151
trial
see the test page for the full documentation
rheolef::dout
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
rheolef::std
Definition: vec_expr_v2.h:391
geo
see the geo page for the full documentation