Rheolef  7.1
an efficient C++ finite element environment
navier_stokes_dg1.icc
Go to the documentation of this file.
26  Float Re1, const geo& omega, string approx)
27  : Re(Re1), Xh(), Qh(), iopt(), a0(), b(), c(), mu(), mp(), lh0(), lh(), kh(),
28  pmu(), pmp(), a1(), stokes1()
29 {
30  Xh = space (omega, approx, "vector");
31  Qh = space (omega, approx);
32  iopt.set_family(integrate_option::gauss);
33  iopt.set_order(2*Xh.degree()+1);
34  stokes_dirichlet_dg (Xh, Qh, a0, b, c, mp, lh0, kh, iopt);
35  trial u (Xh); test v (Xh);
36  lh = lh0 + Re*inertia_fix_rhs (v, iopt);
37  mu = integrate (dot(u,v), iopt);
38  pmu = problem (mu);
39  pmp = problem (mp);
40 }
42 navier_stokes_dg::initial (string restart) const {
43  value_type xh = { field(Xh, 0), field(Qh, 0) };
44  Float Re0 = 0;
45  if (restart == "") {
46  problem_mixed stokes0 (a0, b, c);
47  stokes0.set_metric (mp);
48  stokes0.solve (lh0, kh, xh[0], xh[1]);
49  } else {
50  idiststream in (restart);
51  in >> catchmark("Re") >> Re0
52  >> catchmark("u") >> xh[0]
53  >> catchmark("p") >> xh[1];
54  check_macro (xh[1].get_space() == Qh, "unexpected "
55  << xh[0].get_space().name() << " approximation in file \""
56  << restart << "\" (" << Xh.name() << " expected)");
57  }
58  derr << "# continuation: from Re=" << Re0 << " to " << Re << endl;
59  return xh;
60 }
63  trial u (Xh); test v (Xh);
64  form a = a0 + Re*inertia(xh[0], u, v, iopt);
65  value_type mrh = { a*xh[0] + b.trans_mult(xh[1]) - lh,
66  b*xh[0] - c*xh[1] - kh};
67  return mrh;
68 }
70  trial u (Xh); test v (Xh);
71  a1 = a0 + Re*(inertia(xh[0], u, v, iopt) + inertia(u, xh[0], v, iopt));
72  stokes1 = problem_mixed (a1, b, c);
73  stokes1.set_metric (mp);
74 }
77  value_type delta_xh = { field(Xh, 0), field(Qh, 0) };
78  stokes1.solve (mrh[0], mrh[1], delta_xh[0], delta_xh[1]);
79  return delta_xh;
80 }
83  value_type rh = { field (Xh), field (Qh) };
84  pmu.solve (mrh[0], rh[0]);
85  pmp.solve (mrh[1], rh[1]);
86  value_type mgh = { a1.trans_mult(rh[0]) + b.trans_mult(rh[1]),
87  b*rh[0] - c*rh[1] };
88  return mgh;
89 }
form
see the form page for the full documentation
navier_stokes_dg::a0
form a0
Definition: navier_stokes_dg.h:39
check_macro
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
navier_stokes_dg::mp
form mp
Definition: navier_stokes_dg.h:39
navier_stokes_dg::update_derivative
void update_derivative(const value_type &uh) const
Definition: navier_stokes_dg1.icc:69
navier_stokes_dg::c
form c
Definition: navier_stokes_dg.h:39
field
see the field page for the full documentation
navier_stokes_dg::Qh
space Qh
Definition: navier_stokes_dg.h:37
navier_stokes_dg::pmu
problem pmu
Definition: navier_stokes_dg.h:41
rheolef::integrate
std::enable_if< details::is_field_expr_v2_nonlinear_arg< Expr >::value &&! is_undeterminated< Result >::value, Result >::type integrate(const geo_basic< T, M > &omega, const Expr &expr, const integrate_option &iopt, Result dummy=Result())
see the integrate page for the full documentation
Definition: integrate.h:202
navier_stokes_dg::stokes1
problem_mixed stokes1
Definition: navier_stokes_dg.h:43
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
navier_stokes_dg::a1
form a1
Definition: navier_stokes_dg.h:42
navier_stokes_dg::derivative_trans_mult
value_type derivative_trans_mult(const value_type &mrh) const
Definition: navier_stokes_dg1.icc:82
navier_stokes_dg::lh
field lh
Definition: navier_stokes_dg.h:40
navier_stokes_dg::lh0
field lh0
Definition: navier_stokes_dg.h:40
navier_stokes_dg::residue
value_type residue(const value_type &uh) const
Definition: navier_stokes_dg1.icc:62
navier_stokes_dg::mu
form mu
Definition: navier_stokes_dg.h:39
navier_stokes_dg::pmp
problem pmp
Definition: navier_stokes_dg.h:41
navier_stokes_dg::derivative_solve
value_type derivative_solve(const value_type &mrh) const
Definition: navier_stokes_dg1.icc:76
navier_stokes_dg::Re
Float Re
Definition: navier_stokes_dg.h:36
a
Definition: diffusion_isotropic.h:25
inertia
form inertia(W w, U u, V v, integrate_option iopt=integrate_option())
Definition: inertia.h:26
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
test
see the test page for the full documentation
problem
see the problem page for the full documentation
u
Definition: leveque.h:25
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
navier_stokes_dg::kh
field kh
Definition: navier_stokes_dg.h:40
u
Float u(const point &x)
Definition: transmission_error.cc:26
mkgeo_ball.b
b
Definition: mkgeo_ball.sh:152
navier_stokes_dg::b
form b
Definition: navier_stokes_dg.h:39
navier_stokes_dg::value_type
Eigen::Matrix< field, 2, 1 > value_type
Definition: navier_stokes_dg.h:27
navier_stokes_dg::navier_stokes_dg
navier_stokes_dg(Float Re, const geo &omega, string approx)
Definition: navier_stokes_dg1.icc:25
mkgeo_contraction.mu
mu
Definition: mkgeo_contraction.sh:193
trial
see the test page for the full documentation
navier_stokes_dg::initial
value_type initial(string restart) const
Definition: navier_stokes_dg1.icc:42
navier_stokes_dg::Xh
space Xh
Definition: navier_stokes_dg.h:37
mkgeo_contraction.name
name
Definition: mkgeo_contraction.sh:133
geo
see the geo page for the full documentation
rheolef::details::dot
rheolef::details::is_vec dot
navier_stokes_dg::iopt
integrate_option iopt
Definition: navier_stokes_dg.h:38