Rheolef  7.1
an efficient C++ finite element environment
transport_tensor_dg.cc
Go to the documentation of this file.
1 #include "rheolef.h"
26 using namespace rheolef;
27 using namespace std;
29 int main(int argc, char**argv) {
30  environment rheolef (argc, argv);
31  geo omega (argv[1]);
32  space Xh (omega, argv[2], "tensor");
33  Float alpha = (argc > 3) ? atof(argv[3]) : 1;
34  Float nu = (argc > 4) ? atof(argv[4]) : 3;
35  Float t0 = (argc > 5) ? atof(argv[5]) : acos(-1.)/8;
36  Float a = 0;
37  trial sigma (Xh); test tau (Xh);
38  tensor ma = 0.5*((1-a)*grad_u - (1+a)*trans(grad_u));
39  auto beta_a = sigma*ma + trans(ma)*sigma;
40  form ah = integrate (ddot(grad_h(sigma)*u + beta_a + nu*sigma,tau))
41  + integrate ("boundary",
42  max(0, -dot(u,normal()))*ddot(sigma,tau))
43  + integrate ("internal_sides",
44  - dot(u,normal())*ddot(jump(sigma),average(tau))
45  + 0.5*alpha*abs(dot(u,normal()))
46  *ddot(jump(sigma),jump(tau)));
47  field lh = integrate (ddot(chi(nu,t0),tau))
48  + integrate ("boundary",
49  max(0, -dot(u,normal()))*ddot(sigma_g(nu,t0),tau));
50  field sigma_h(Xh);
51 #ifndef TO_CLEAN
52  odiststream aout ("a.mtx", io::nogz); aout << ah.uu(); aout.close();
53 #endif // TO_CLEAN
54  problem p (ah);
55  p.solve (lh, sigma_h);
56  dout << catchmark("nu") << nu << endl
57  << catchmark("t0") << t0 << endl
58  << catchmark("sigma") << sigma_h;
59 }
tensor
see the tensor page for the full documentation
form
see the form page for the full documentation
bdf::alpha
Float alpha[pmax+1][pmax+1]
Definition: bdf.icc:28
transport_tensor_exact.icc
The tensorial transport benchmark – right-hand-side and exact solution.
rheolef::catchmark
see the catchmark page for the full documentation
Definition: catchmark.h:67
rheolef::dot
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
dot(x,y): see the expression page for the full documentation
Definition: vec_expr_v2.h:415
chi
Definition: transport_tensor_exact.icc:65
field
see the field page for the full documentation
rheolef::normal
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
Definition: field_expr_terminal.h:439
nu
Definition: nu.h:26
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
sigma_g
sigma_exact sigma_g
Definition: transport_tensor_exact.icc:72
space
see the space page for the full documentation
rheolef::io::nogz
@ nogz
Definition: rheostream.h:170
rheolef.h
rheolef - reference manual
p
Definition: sphere.icc:25
rheolef::ddot
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
ddot(x,y): see the expression page for the full documentation
Definition: tensor.cc:278
a
Definition: diffusion_isotropic.h:25
rheolef::odiststream::close
void close()
Definition: diststream.cc:164
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
sigma
Definition: mosolov_exact_circle.h:40
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
test
see the test page for the full documentation
problem
see the problem page for the full documentation
u
Definition: leveque.h:25
rheolef::odiststream
odiststream: see the diststream page for the full documentation
Definition: diststream.h:126
Float
see the Float page for the full documentation
rheolef::grad_h
std::enable_if< details::is_field_convertible< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type grad_h(const Expr &expr)
grad_h(uh): see the expression page for the full documentation
Definition: field_expr_terminal.h:949
trial
see the test page for the full documentation
mkgeo_ball.a
int a
Definition: mkgeo_ball.sh:151
rheolef::dout
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
rheolef::trans
csr< T, sequential > trans(const csr< T, sequential > &a)
trans(a): see the form page for the full documentation
Definition: csr.h:455
main
int main(int argc, char **argv)
Definition: transport_tensor_dg.cc:29
rheolef::std
Definition: vec_expr_v2.h:402
grad_u
Definition: combustion_exact.icc:34
geo
see the geo page for the full documentation