Rheolef  7.2
an efficient C++ finite element environment
lambda2alpha.h
Go to the documentation of this file.
1 #include "lambda_c.h"
26 Float lambda2alpha (Float lambda, bool up = false) {
27  static const Float ac = alpha_c();
29  size_t max_iter = 1000;
30  Float a_min = up ? ac : 0;
31  Float a_max = up ? 100 : ac;
32  for (size_t k = 0; abs(a_max - a_min) > tol; ++k) {
33  Float a1 = (a_max + a_min)/2;
34  Float lambda1 = 8*sqr(a1/cosh(a1));
35  if ((up && lambda > lambda1) || (!up && lambda < lambda1))
36  { a_max = a1; }
37  else { a_min = a1; }
38  check_macro (k < max_iter, "lambda2alpha: max_iter=" << k
39  << " reached and err=" << a_max - a_min);
40  }
41  return(a_max + a_min)/2;
42 };
see the Float page for the full documentation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
Float lambda2alpha(Float lambda, bool up=false)
Definition: lambda2alpha.h:26
The combustion problem – the critical parameter value as a function.
Float alpha_c()
Definition: lambda_c.h:36
Float epsilon