continuation(3rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

✨ continuation β€” the nonlinear solver that follows the vibe of your solution πŸ’…

okay bestie, so this is continuation, from rheolef-7.2, a manual page in section 3. Sit down, hydrate, and let me tell you about the glow-up solver that chases a whole branch of solutions as your parameter moves. πŸ¦‹


🌸 SYNOPSIS 🌸

template<class Problem>
void continuation (
  Problem&                        F,
  typename Problem::value_type&   uh,
  odiststream*                    p_out,
  odiststream*                    p_err,
  const continuation_option& opts = continuation_option())

πŸ’– DESCRIPTION πŸ’–

This function is literally a generic damped Newton method, but make it ✨continuation✨. It solves this problem right here:

F(lambda,u) = 0

where lambda is a parameter, and u is the solution that goes with it β€” u depends on lambda, they're attached, it's giving soulmates fr fr. The whole idea is to follow a branch of solutions we call u(lambda) as the parameter lambda varies. So you don't just get one solution, you get the whole journey. 🫢

A simple call to the algorithm looks like this:

my_problem P;
field uh (Vh,0);
continuation (P, uh, &dout, &derr);

And if you wanna be extra, the optional argument continuation_option(3) lets you control some features of the algorithm. no cap. πŸŽ€

The continuation algorithm is based on the damped_newton(3) method. But here's the tea: on top of everything damped_newton(3) needs from you, the continuation one asks for a few more members. Requirements are:

class my_problem {
public:
  typedef float_type;
  typedef value_type;
  string parameter_name() const;
  float_type parameter() const;
  void set_parameter (float_type lambda);
  value_type residue          (const value_type& uh) const;
  void update_derivative      (const value_type& uh) const;
  csr<float_type> derivative  (const value_type& uh) const;
  value_type derivative_solve      (const value_type& mrh) const;
  value_type derivative_trans_mult (const value_type& mrh) const;
  value_type derivative_versus_parameter (const field& uh) const;
  bool stop (const value_type& xh) const;
  idiststream& get (idiststream& is,       value_type& uh);
  odiststream& put (odiststream& os, const value_type& uh) const;
  float_type space_norm (const value_type& uh) const;
  float_type dual_space_norm (const value_type& mrh) const;
  float_type space_dot (const value_type& xh, const value_type& yh) const;
  float_type dual_space_dot (const value_type& mrh, const value_type& msh) const;
  value_type massify   (const value_type& uh) const;
  value_type unmassify (const value_type& mrh) const;
};

like, yes, that's a lot of methods, but you asked for the branch-following lifestyle so this is the price of admission bestie πŸ’€


πŸ”₯ EXAMPLE πŸ”₯

Peep the combustion_continuation.cc example, and the usersguide if you want even more. both iconic, both worth your time. ⭐


🧚 ADAPTIVE MESH 🧚

There are two versions of this algorithm, and you don't get to pick, the code does:

  • one with an imbedded mesh adaptation loop πŸŒ€
  • one without this feature πŸ™ˆ

The algorithm is automatically selected when there's an adapt() method sitting in your problem definition. so basically if you wrote adapt(), you get the mesh-adapting one. periodt.


πŸ‘‘ IMPLEMENTATION πŸ‘‘

This documentation has been generated from file main/lib/continuation.h β€” go look if you want the source, iykyk.


🌈 AUTHOR 🌈

Pierre Saramito <Pierre.Saramito@imag.fr> β€” the main character who wrote all this 🫑


Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>

GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law. read it again, bestie, NO WARRANTY 😭

rheolef Β· Version 7.2 Β· this was continuation(3rheolef) β€” mwah, go solve something pretty πŸ’…βœ¨

πŸ“¦ where this page comes from