Rheolef  7.1
an efficient C++ finite element environment
yield_slip_augmented_lagrangian.icc
Go to the documentation of this file.
1 #include "projection.h"
27  geo boundary, field lh, field& lambda_h, field& uh,
28  Float tol, size_t max_iter, Float r)
29 {
30  const space& Xh = uh.get_space();
31  const space& Wh = lambda_h.get_space();
32  trial u(Xh), lambda(Wh);
33  test v(Xh), mu(Wh);
34  form m = integrate (u*v),
35  a0 = integrate (dot(grad(u),grad(v))),
36  a = a0 + integrate (boundary, r*u*v),
37  mb = integrate (lambda*mu),
38  b = integrate (boundary, u*mu);
39  problem pa (a);
40  derr << "# k residue" << endl;
41  Float residue0 = 0;
42  for (size_t k = 0; true; ++k) {
43  field gamma_h = interpolate(Wh,
44  compose(projection(S,n,Cf,r), lambda_h + r*uh["boundary"]));
45  field delta_lambda_h = r*(uh["boundary"] - gamma_h);
46  lambda_h += delta_lambda_h;
47  Float residue = delta_lambda_h.max_abs();
48  derr << k << " " << residue << endl;
49  if (residue <= tol || k >= max_iter) return (residue <= tol) ? 0 : 1;
50  field rhs = lh + b.trans_mult(r*gamma_h - lambda_h);
51  pa.solve (rhs, uh);
52  }
53 }
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
see the space page for the full documentation
see the test page for the full documentation
see the test page for the full documentation
class rheolef::details::field_expr_v2_nonlinear_node_unary compose
rheolef::details::is_vec dot
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(const Expr &expr)
grad(uh): see the expression page for the full documentation
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
field_basic< T, M > interpolate(const space_basic< T, M > &V2h, const field_basic< T, M > &u1h)
see the interpolate page for the full documentation
Definition: interpolate.cc:233
field residue(Float p, const field &uh)
The projection for yield-stress rheologies e.g. the yield slip problem.
Definition: leveque.h:25
Float u(const point &x)
int yield_slip_augmented_lagrangian(Float S, Float n, Float Cf, geo boundary, field lh, field &lambda_h, field &uh, Float tol, size_t max_iter, Float r)