Loading...
Searching...
No Matches
problem_mixed

linear solver

# Description

The problem_mixed class solves a given linear mixed system for PDEs in variational formulation.

Mixed problem appear in many applications such as the Stokes or the nearly incompressible elasticity. Let Xh and Qh be two finite element space. Let a: Xh*Xh --> IR, b: Xh*Qh --> IR and c: Xh*Qh --> IR be three bilinear form. The system writes:

        [ 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. The c bilinear form is called the stabilization, and could be zero.

The degrees of freedom are split between unknown degrees of freedom and blocked one. See also form and space. 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 are move to the right-hand-side of the system that 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

This writes:

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

When c is zero, the last c argument could be omitted, as:

        problem_mixed p (a, b);

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. This is also true for ph when ph.b is non-empty. The previous linear system is solved via the solver_abtb class: the problem_mixed class is simply a convenient wrapper around the solver_abtb one.

# Example

See stokes_cavity.cc

# Options

The solver_abtb could be customized via the constructor optional solver_option argument:

        problem p (a, b, sopt);

or

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

This solver_abtb is used to switch between a direct and an iterative method for solving the mixed system.

# 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.

When using a direct solver 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.

When using an iterative solver method, this metric is used as a Schur complement preconditionner, see solver_abtb for details. The solver associated to this Schur preconditionner could be customized by specifying the solver associated to the problem 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.

# Inner solver

When using an iterative solver_abtb, the inner problem related to the a operator could also be customized by specifying its solver :

        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.

# 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);
};