problem(2rheolef)

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

πŸ’– problem πŸ’– (from the 2rheolef manual, bestie)

okay so like. you know how sometimes you've got a PDE in variational formulation and you just need the linear system solved? yeah. that's this. problem is your girl. she's the linear solver class in rheolef-7.2 and she's literally just here to make your life cute and easy. no cap. ✨


πŸŽ€ NAME πŸŽ€

problem β€” linear solver (rheolef-7.2). she solves. she's a solver. iconic behavior honestly.


🌸 DESCRIPTION 🌸

The problem class solves a given linear system for PDEs in variational formulation. that's it, that's the job, and she does it flawlessly. πŸ’…


🌸 DESCRIPTION 🌸 (yes bestie, there's another one, she's thorough like that)

okay so here's the tea. the degrees of freedom get split into two groups: the unknown ones and the blocked ones. also go look at form(2) and space(2) if you want the lore. πŸ¦‹

so let a be a bilinear form(2) and let lh be the right-hand-side, exactly like in the previous example. the linear system expands like this:

[ a.uu  a.ub ] [ uh.u ]   [ lh.u ]
[            ] [      ] = [      ]
[ a.bu  a.bb ] [ uh.b ]   [ lh.b ]

the uh.b entries are the blocked degrees of freedom: their values are prescribed already, so we yeet them over to the right-hand-side and the whole thing collapses down to:

a.uu*uh.u =  lh.u - a.ub*uh.b

and that is what you actually write, like so:

problem p (a);
p.solve (lh, uh);

now pay attention bestie, this part is lowkey important: during that p.solve call, uh is both an input variable β€” because of the uh.b contribution to the right-hand-side β€” and an output variable, carrying uh.u. she's doing double duty, main character energy fr fr. πŸ‘‘

if you're using an iterative resolution, all the deets about its convergence β€” like the number of iterations and the final residue β€” are available through the p.option() member function, see solver_option(4). obsessed with that for you.

and finally, that linear system from before gets solved via the solver(4) class. because here's the thing: the problem class is simply a convenient wrapper around the solver(4) one. that's her whole vibe. a pretty little wrapper. πŸŽ€


🌈 EXAMPLE 🌈

See dirichlet.cc β€” go look, it's giving tutorial, it's giving slay.


✨ CUSTOMIZATION ✨

you can customize the solver(4) via the constructor's optional solver_option(4) argument:

problem p (a, sopt);

when you're using a direct solver(4), the determinant of the linear system matrix is also available as p.det(). cute right?

when you're using an iterative solver(4), the preconditionner can be customized instead:

p.set_preconditionner (m);

πŸ’€ TODO πŸ’€

the solve method could return a boolean when success. like, it could. she hasn't yet. we're manifesting. πŸ™ˆ


πŸ‘‘ IMPLEMENTATION πŸ‘‘

this documentation has been generated from file main/lib/problem.h. ok so here's the source-level lore, don't skip it:

the problem class is simply an alias to the problem_basic class:

typedef problem_basic<Float> problem;

and the problem_basic class provides a generic interface:

template <class T, class M = rheo_default_memory_model>
class problem_basic {
public:

// typedefs:

  typedef typename solver_basic<T,M>::size_type         size_type;
  typedef typename solver_basic<T,M>::determinant_type  determinant_type;

// allocators:

  problem_basic ();
  problem_basic (const form_basic<T,M>& a,
                 const solver_option& sopt = solver_option());

  void update_value (const form_basic<T,M>& a);

  void set_preconditioner (const solver_basic<T,M>&);

// accessor:

  void solve       (const field_basic<T,M>& lh, field_basic<T,M>& uh) const;
  void trans_solve (const field_basic<T,M>& lh, field_basic<T,M>& uh) const;

  determinant_type det() const;
  const solver_option& option() const;
  bool initialized() const;

};

πŸ’œ AUTHOR πŸ’œ

Pierre Saramito <Pierre.Saramito@imag.fr> β€” the actual icon 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. (say it louder for the people in the back β€” no warranty bestie, she said what she said 😭)

okay that's the whole page!! this was rheolef, Version 7.2, and the page is problem(2rheolef). mwah, go solve something gorgeous. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from