Rheolef  7.1
an efficient C++ finite element environment
elasticity_taylor_dg.cc

The elasticity problem with the Taylor benchmark and discontinuous Galerkin method

#include "rheolef.h"
using namespace rheolef;
using namespace std;
#include "taylor.h"
int main(int argc, char**argv) {
environment rheolef (argc, argv);
geo omega (argv[1]);
space Xh (omega, argv[2], "vector");
Float lambda = (argc > 3) ? atof(argv[3]) : 1;
size_t d = omega.dimension();
size_t k = Xh.degree();
Float beta = (k+1)*(k+d)/Float(d);
trial u (Xh); test v (Xh);
form a = integrate (lambda*div_h(u)*div_h(v) + 2*ddot(Dh(u),Dh(v)))
+ integrate (omega.sides(),
beta*penalty()*dot(jump(u),jump(v))
- lambda*dot(jump(u),average(div_h(v)*normal()))
- lambda*dot(jump(v),average(div_h(u)*normal()))
- 2*dot(jump(u),average(Dh(v)*normal()))
- 2*dot(jump(v),average(Dh(u)*normal())));
field lh = integrate (dot(f(),v))
+ integrate (omega.boundary(),
beta*penalty()*dot(g(),jump(v))
- lambda*dot(g(),average(div_h(v)*normal()))
- 2*dot(g(),average(Dh(v)*normal())));
field uh(Xh);
problem p (a);
p.solve (lh, uh);
dout << uh;
}
u_exact g
field lh(Float epsilon, Float t, const test &v)
see the Float page for the full documentation
see the field page for the full documentation
see the form page for the full documentation
see the geo page for the full documentation
see the problem page for the full documentation
double Float
see the Float page for the full documentation
Definition: Float.h:143
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:430
see the space page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
int main(int argc, char **argv)
This file is part of Rheolef.
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::divergence >>::type div_h(const Expr &expr)
div_h(uh): see the expression page for the full documentation
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 Dh(const Expr &expr)
Dh(uh): see the expression page for the full documentation.
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
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
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
details::field_expr_v2_nonlinear_terminal_function< details::penalty_pseudo_function< Float > > penalty()
penalty(): see the expression page for the full documentation
details::field_expr_v2_nonlinear_terminal_function< details::normal_pseudo_function< Float > > normal()
normal: see the expression page for the full documentation
Float beta[][pmax+1]
rheolef - reference manual
Definition: sphere.icc:25
Definition: leveque.h:25
The Taylor benchmark – right-hand-side and boundary condition.
Float u(const point &x)