problem_mixed(2rheolef)

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

🌸 problem_mixed β€” the manual, but make it make sense 🌸

okay bestie, we're talking about problem_mixed from the rheolef family, and honestly? it's giving "quietly carrying the whole PDE department on its back." this is the problem_mixed(2rheolef) page, so pour a lil something and let's get into it πŸ’–


✨ NAME ✨

problem_mixed β€” the linear solver, no cap πŸ”₯


πŸ’… DESCRIPTION πŸ’…

okay so. the problem_mixed class solves a given linear mixed system for PDEs in variational formulation. that's the whole vibe.

Mixed problems show up literally everywhere, like in Stokes or nearly incompressible elasticity β€” iconic behavior, honestly. so let's set the stage: let Xh and Qh be two finite element space(2). let a: Xh*Xh --> IR, b: Xh*Qh --> IR and c: Xh*Qh --> IR be three bilinear form(2). the system writes itself as:

[ A  B^T ] [ uh ]   [ lh ]
[        ] [    ] = [    ]
[ B  -C  ] [ ph ]   [ kh ]

where A, B and C are the three operators associated to a, b and c, respectively, and lh in Xh and kh in Qh are the two given right-hand-sides. and the c bilinear form? that one is called the stabilization, and it could be zero. slay, flexible queen 🫢

the degrees of freedom are split between unknown degrees of freedom and blocked ones. see also form(2) and space(2). the linear system expands as:

[ a.uu  a.ub   b.uu^T b.bu^T ] [ uh.u ]   [ lh.u ]
[                            ] [      ] = [      ]
[ a.bu  a.bb   b.ub^T b.bb^T ] [ uh.b ]   [ lh.b ]
[                            ] [      ] = [      ]
[ b.uu  b.ub  -c.uu  -c.ub   ] [ ph.u ]   [ kh.u ]
[                            ] [      ] = [      ]
[ b.bu  a.bb  -c.bu  -c.bb   ] [ ph.b ]   [ kh.b ]

both the uh.b and ph.b are blocked degrees of freedom β€” their values are prescribed, and the corresponding values get moved to the right-hand-side of the system, which then reduces to:

a.uu*uh.u + b.uu^T*ph.u = lh.u - a.ub*uh.b - b.bu^T*ph.b

b.uu*uh.u -   c.uu*ph.u = kh.u - b.ub*uh.b +   c.ub*ph.b

which writes as, bestie:

problem_mixed p (a, b, c);
p.solve (lh, kh, uh, ph);

and when c is zero? you can just drop that last c argument, like:

problem_mixed p (a, b);

not me being obsessed with how clean that is 😭 observe that, during the p.solve call, uh is both an input variable (for the uh.b contribution to the right-hand-side) and an output variable, with uh.u. main character energy fr fr. this is also true for ph when ph.b is non-empty.

the previous linear system gets solved via the solver_abtb(4) class: the problem_mixed class is simply a convenient wrapper around the solver_abtb(4) one. periodt.


🌈 EXAMPLE 🌈

see stokes_cavity.cc β€” go look, it's right there πŸ’œ


πŸŽ€ OPTIONS πŸŽ€

the solver_abtb(4) could be customized via the constructor optional solver_option(4) argument:

problem p (a, b, sopt);

or

problem p (a, b, c, sopt);

this solver_abtb(4) is used to switch between a direct and an iterative method for solving the mixed system. choose your fighter πŸ’…


πŸ¦‹ METRIC πŸ¦‹

a metric in the Qh space could also be provided:

p.set_metric (mp);

by default, when nothing has been specified, this metric is the L2 scalar product for the Qh space. lowkey a sensible default.

when using a direct solver(4) method, this metric is used to add a constraint when the multiplier is known up to a constant. for instance, when the pressure is known up to a constant, a constraint for a zero average pressure is automatically added to the linear system. cute, right?

when using an iterative solver(4) method, this metric is used as a Schur complement preconditionner β€” see solver_abtb(4) for details. the solver(4) associated to this Schur preconditionner could be customized by specifying the solver(4) associated to the problem(2) related to the mp operator:

p.set_preconditionner (pmp);
note: this preconditionner subproblem could be solved either by a direct or an iterative method, while the whole mixed problem solver is iterative. yes, they can differ. it's giving range 🌸

πŸ‘‘ INNER SOLVER πŸ‘‘

when using an iterative solver_abtb(4), the inner problem(2) related to the a operator could also be customized by specifying its solver(4):

p.set_inner_problem (pa);
note: this inner subproblem could be solved either by a direct or an iterative method, while the whole mixed problem solver is iterative. same energy as above, iconic πŸ’–

⭐ IMPLEMENTATION ⭐

this documentation has been generated from file main/lib/problem_mixed.h

the problem_mixed class is simply an alias to the problem_mixed_basic class

typedef problem_mixed_basic<Float> problem_mixed;

the problem_mixed_basic class provides a generic interface:

template <class T, class M = rheo_default_memory_model>
class problem_mixed_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_mixed_basic();

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

  problem_mixed_basic(
      const form_basic<T,M>& a,
      const form_basic<T,M>& b,
      const form_basic<T,M>& c,
      const solver_option& sopt = solver_option());

// accessor:

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

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

// modifiers:

  void set_metric          (const form& mp);
  void set_preconditionner (const problem& pmp);
  void set_inner_problem   (const problem& pa);

};

πŸ’œ AUTHOR πŸ’œ

Pierre Saramito <Pierre.Saramito@imag.fr> β€” thank you king 🫑


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.


and that's the whole page, bestie πŸŽ€ this was rheolef Version 7.2, dated right alongside problem_mixed(2rheolef) β€” go forth and solve those mixed systems, you absolute icon βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from