Loading...
Searching...
No Matches
mosolov_augmented_lagrangian.cc
Go to the documentation of this file.
#include "rheolef.h"
using namespace std;
using namespace rheolef;
#include "mosolov_augmented_lagrangian.h"
int main(int argc, char**argv) {
environment rheolef (argc,argv);
mosolov_augmented_lagrangian pb;
geo omega (argv[1]);
string approx = (argc > 2) ? argv[2] : "P1";
pb.Bi = (argc > 3) ? atof(argv[3]) : 0.2;
pb.n = (argc > 4) ? atof(argv[4]) : 1;
size_t n_adapt = (argc > 5) ? atoi(argv[5]) : 0;
pb.max_iter = (argc > 6) ? atoi(argv[6]) : 10000;
pb.err = (argc > 7) ? atof(argv[7]) : 1e-4;
pb.r = 100;
pb.tol = 1e-10;
pb.hmin = 1e-4;
pb.hmax = 1e-1;
pb.ratio = 3;
pb.additional = "-AbsError";
field sigma_h, uh;
for (size_t i = 0; true; i++) {
pb.reset (omega, approx);
pb.initial (sigma_h, uh);
int status = pb.solve (sigma_h, uh);
odiststream out (omega.name(), "field");
pb.put (out, sigma_h, uh);
if (i == n_adapt) break;
space T0h (sigma_h.get_geo(), "P"+to_string(sigma_h.get_space().degree())+"d");
field ch = lazy_interpolate (T0h, sqrt(abs(dot(sigma_h, grad(uh)))));
omega = adapt (ch, pb);
omega.save();
}
}
field
see the field page for the full documentation
geo
see the geo page for the full documentation
rheolef::environment
see the environment page for the full documentation
Definition environment.h:121
rheolef::odiststream
odiststream: see the diststream page for the full documentation
Definition diststream.h:137
space
see the space page for the full documentation
main
int main()
Definition field2bb.cc:58
mosolov_augmented_lagrangian.h
The Mossolov problem by the augmented Lagrangian method – solver class header.
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
rheolef::grad
std::enable_if< details::has_field_rdof_interface< Expr >::value, details::field_expr_v2_nonlinear_terminal_field< typenameExpr::scalar_type, typenameExpr::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:930
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:179
rheolef::lazy_interpolate
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
rheolef::dot
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
Definition vec_expr_v2.h:415
std
STL namespace.
rheolef.h
rheolef - reference manual
mosolov_augmented_lagrangian
Definition mosolov_augmented_lagrangian.h:25
mosolov_augmented_lagrangian::Bi
Float Bi
Definition mosolov_augmented_lagrangian.h:32
mosolov_augmented_lagrangian::n
Float n
Definition mosolov_augmented_lagrangian.h:32
mosolov_augmented_lagrangian::reset
void reset(geo omega, string approx)
Definition mosolov_augmented_lagrangian2.icc:29
mosolov_augmented_lagrangian::solve
int solve(field &sigma_h, field &uh) const
Definition mosolov_augmented_lagrangian1.icc:26
mosolov_augmented_lagrangian::tol
Float tol
Definition mosolov_augmented_lagrangian.h:32
mosolov_augmented_lagrangian::r
Float r
Definition mosolov_augmented_lagrangian.h:32
mosolov_augmented_lagrangian::put
void put(odiststream &out, field &sigma_h, field &uh) const
Definition mosolov_augmented_lagrangian2.icc:53
mosolov_augmented_lagrangian::initial
void initial(field &sigma_h, field &uh) const
Definition mosolov_augmented_lagrangian2.icc:45
mosolov_augmented_lagrangian::max_iter
size_t max_iter
Definition mosolov_augmented_lagrangian.h:33