Rheolef  7.2
an efficient C++ finite element environment
stress.cc
Go to the documentation of this file.
1 #include "rheolef.h"
26 using namespace rheolef;
27 using namespace std;
28 int main(int argc, char** argv) {
29  environment rheolef (argc,argv);
30  Float inv_lambda;
31  field uh;
32  din >> catchmark("inv_lambda") >> inv_lambda
33  >> catchmark("u") >> uh;
34  const geo& omega = uh.get_geo();
35  const space& Xh = uh.get_space();
36  string grad_approx = "P" + to_string(Xh.degree()-1) + "d";
37  space Th (omega, grad_approx, "tensor");
38  size_t d = omega.dimension();
39  tensor I = tensor::eye (d);
40  field sigma_h;
41  if (inv_lambda == 0)
42  sigma_h = lazy_interpolate (Th, 2*D(uh));
43  else sigma_h = lazy_interpolate (Th, 2*D(uh) + (1/inv_lambda)*div(uh)*I);
44  dout << catchmark("s") << sigma_h;
45 }
see the Float page for the full documentation
see the field page for the full documentation
see the geo page for the full documentation
see the catchmark page for the full documentation
Definition: catchmark.h:67
see the environment page for the full documentation
Definition: environment.h:121
idiststream din(cin)
see the diststream page for the full documentation
Definition: diststream.h:464
odiststream dout(cout)
see the diststream page for the full documentation
Definition: diststream.h:467
see the space page for the full documentation
see the tensor page for the full documentation
This file is part of Rheolef.
solver_basic< Float > eye()
see the eye page for the full documentation
Definition: eye.h:74
field_basic< T, M > lazy_interpolate(const space_basic< T, M > &X2h, const field_basic< T, M > &u1h)
see the interpolate page for the full documentation
Definition: field.h:871
std::enable_if< details::has_field_rdof_interface< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::gradient >>::type D(const Expr &expr)
D(uh): see the expression page for the full documentation.
std::enable_if< details::has_field_rdof_interface< Expr >::value,details::field_expr_v2_nonlinear_terminal_field< typename Expr::scalar_type,typename Expr::memory_type,details::differentiate_option::divergence >>::type div(const Expr &expr)
div(uh): see the expression page for the full documentation
rheolef - reference manual
int main(int argc, char **argv)
Definition: stress.cc:28