logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

problem - linear solver (rheolef-7.2)

Author

Pierre Saramito <Pierre.Saramito@imag.fr>

Customization

The solver(4) could be customized via the constructor optional solver_option(4) argument: problem p (a, sopt); When using a direct solver(4), the determinant of the linear system matrix is also available as p.det(). When using an iterative solver(4), the preconditionner could be customized: p.set_preconditionner (m);

Description

The degrees of freedom are splitting between unknown degrees of freedom and blocked one. See also form(2) and space(2). Let a be a bilinear form(2) and lh be the right-hand-side, as in the previous example. The linear system expands as: [ a.uu a.ub ] [ uh.u ] [ lh.u ] [ ] [ ] = [ ] [ a.bu a.bb ] [ uh.b ] [ lh.b ] The uh.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 = lh.u - a.ub*uh.b This writes: problem p (a); p.solve (lh, uh); 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. When using an iterative resolution, the details about its convergence, e.g. the number of iterations and the final residue, can be obtain via the p.option() member function, see solver_option(4). Finally, the previous linear system is solved via the solver(4) class: the problem class is simply a convenient wrapper around the solver(4) one.

Example

See dirichlet.cc

Implementation

This documentation has been generated from file main/lib/problem.h The problem class is simply an alias to the problem_basicclass typedef problem_basic<Float> problem; The problem_basicclassprovidesagenericinterface: 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; };

Name

problem - linear solver (rheolef-7.2)

Todo

The solve method could return a boolean when success.

See Also