Rheolef  7.1
an efficient C++ finite element environment
mosolov_augmented_lagrangian.cc
Go to the documentation of this file.
1 #include "rheolef.h"
26 using namespace std;
27 using namespace rheolef;
29 int main(int argc, char**argv) {
30  environment rheolef (argc,argv);
32  geo omega (argv[1]);
33  string approx = (argc > 2) ? argv[2] : "P1";
34  pb.Bi = (argc > 3) ? atof(argv[3]) : 0.2;
35  pb.n = (argc > 4) ? atof(argv[4]) : 1;
36  size_t n_adapt = (argc > 5) ? atoi(argv[5]) : 0;
37  pb.max_iter = (argc > 6) ? atoi(argv[6]) : 10000;
38  pb.err = (argc > 7) ? atof(argv[7]) : 1e-4;
39  pb.r = 100;
40  pb.tol = 1e-10;
41  pb.hmin = 1e-4;
42  pb.hmax = 1e-1;
43  pb.ratio = 3;
44  pb.additional = "-AbsError";
45  field sigma_h, uh;
46  for (size_t i = 0; true; i++) {
47  pb.reset (omega, approx);
48  pb.initial (sigma_h, uh);
49  int status = pb.solve (sigma_h, uh);
50  odiststream out (omega.name(), "field");
51  pb.put (out, sigma_h, uh);
52  if (i == n_adapt) break;
53  space T0h (sigma_h.get_geo(), "P"+itos(sigma_h.get_space().degree())+"d");
54  field ch = interpolate (T0h, sqrt(abs(dot(sigma_h, grad(uh)))));
55  omega = adapt (ch, pb);
56  omega.save();
57  }
58 }
mosolov_augmented_lagrangian::Bi
Float Bi
Definition: mosolov_augmented_lagrangian.h:32
mosolov_augmented_lagrangian::reset
void reset(geo omega, string approx)
Definition: mosolov_augmented_lagrangian2.icc:29
rheolef::io::out
@ out
Definition: rheostream.h:167
rheolef::adapt
geo_basic< T, M > adapt(const field_basic< T, M > &uh, const adapt_option &opts)
adapt(uh,opts): see the adapt page for the full documentation
Definition: adapt.cc:172
mosolov_augmented_lagrangian::n
Float n
Definition: mosolov_augmented_lagrangian.h:32
field
see the field page for the full documentation
mosolov_augmented_lagrangian::max_iter
size_t max_iter
Definition: mosolov_augmented_lagrangian.h:33
mosolov_augmented_lagrangian::put
void put(odiststream &out, field &sigma_h, field &uh) const
Definition: mosolov_augmented_lagrangian2.icc:53
space
see the space page for the full documentation
rheolef::grad
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
Definition: field_expr_terminal.h:911
rheolef.h
rheolef - reference manual
rheolef::interpolate
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
mosolov_augmented_lagrangian::initial
void initial(field &sigma_h, field &uh) const
Definition: mosolov_augmented_lagrangian2.icc:45
rheolef::environment
see the environment page for the full documentation
Definition: environment.h:115
rheolef
This file is part of Rheolef.
Definition: compiler_eigen.h:37
main
int main(int argc, char **argv)
Definition: mosolov_augmented_lagrangian.cc:29
rheolef::odiststream
odiststream: see the diststream page for the full documentation
Definition: diststream.h:126
mosolov_augmented_lagrangian
Definition: mosolov_augmented_lagrangian.h:25
mosolov_augmented_lagrangian::tol
Float tol
Definition: mosolov_augmented_lagrangian.h:32
mosolov_augmented_lagrangian.h
The Mossolov problem by the augmented Lagrangian method – solver class header.
rheolef::itos
std::string itos(std::string::size_type i)
itos: see the rheostream page for the full documentation
mosolov_augmented_lagrangian::solve
int solve(field &sigma_h, field &uh) const
Definition: mosolov_augmented_lagrangian1.icc:26
rheolef::std
Definition: vec_expr_v2.h:402
mkgeo_contraction.status
status
Definition: mkgeo_contraction.sh:290
geo
see the geo page for the full documentation
rheolef::details::dot
rheolef::details::is_vec dot
mosolov_augmented_lagrangian::r
Float r
Definition: mosolov_augmented_lagrangian.h:32