|
NEML2 2.1.0
|
Definition of a nonlinear system of equations, r(u) = 0. More...
Definition of a nonlinear system of equations, r(u) = 0.
Instead of directly defining a nonlinear system, we define the linearized system via its residual and Jacobian, evaluated at a given state u with given variables g, the linearized system is usually expressed as dr(u; g)/du * du = -r(u; g). Rewriting this in the more familiar form Au = b, we have A := dr(u; g)/du and b := -r(u; g).
Practically, this means that whenever u or g changes, we need to invalidate the system matrix A and RHS b, and recompute them when requested.
#include <NonlinearSystem.h>

Public Member Functions | |
| void | u_changed () override |
| Trigger when unknown variables changed. | |
| LinearSystem ()=default | |
| LinearSystem (const LinearSystem &)=default | |
| LinearSystem (LinearSystem &&) noexcept=default | |
| Public Member Functions inherited from LinearSystem | |
| LinearSystem ()=default | |
| LinearSystem (const LinearSystem &)=default | |
| LinearSystem (LinearSystem &&) noexcept=default | |
| LinearSystem & | operator= (const LinearSystem &)=default |
| LinearSystem & | operator= (LinearSystem &&) noexcept=default |
| virtual | ~LinearSystem ()=default |
| virtual void | init () |
| Setup axis layouts. | |
| virtual void | set_u (const AssembledVector &)=0 |
| Set the unknown u. | |
| virtual void | set_g (const AssembledVector &)=0 |
| Set the given variables g from the current step. | |
| virtual AssembledVector | u () const =0 |
| Get the unknown u. | |
| virtual AssembledVector | g () const =0 |
| Get the given variables g from the current step. | |
| virtual void | g_changed () |
| Trigger when given variables changed. | |
| AssembledMatrix | A () |
| Assemble and return the operator, A. | |
| AssembledVector | b () |
| Assemble and return the right-hand side, b. | |
| std::tuple< AssembledMatrix, AssembledVector > | A_and_b () |
| Assemble and return the right-hand side and operator. | |
| std::tuple< AssembledMatrix, AssembledMatrix > | A_and_B () |
| Assemble the auxiliary matrix B = dr/dg along with A. | |
| std::tuple< AssembledMatrix, AssembledMatrix, AssembledVector > | A_and_B_and_b () |
| Assemble the auxiliary matrix B = dr/dg along with A and b. | |
| AxisLayout | ulayout () const |
| Get the unknown-variable layout. | |
| AxisLayout | glayout () const |
| Get the given-variable layout. | |
| AxisLayout | blayout () const |
| Get the RHS variable layout. | |
Additional Inherited Members | |
| Protected Member Functions inherited from LinearSystem | |
| virtual std::shared_ptr< AxisLayout > | setup_ulayout ()=0 |
| Setup the unknown layout, partitioned by variable group. | |
| virtual std::shared_ptr< AxisLayout > | setup_glayout ()=0 |
| Setup the given variable layout. | |
| virtual std::shared_ptr< AxisLayout > | setup_blayout ()=0 |
| Setup the RHS variable layout. | |
| virtual void | assemble (AssembledMatrix *A, AssembledMatrix *B, AssembledVector *b)=0 |
| Compute the operator and right-hand side. | |
| virtual void | pre_assemble (bool A, bool B, bool b) |
| Callback before assembly to perform. | |
| virtual void | post_assemble (bool A, bool B, bool b) |
| Callback after assembly to perform. | |
| Protected Attributes inherited from LinearSystem | |
| bool | _A_up_to_date = false |
| Flag indicating if the system matrix is up to date. Setters invalidate this. | |
| bool | _B_up_to_date = false |
| Flag indicating if the auxiliary matrix is up to date. Setters invalidate this. | |
| bool | _b_up_to_date = false |
| Flag indicating if the system RHS is up to date. Setters invalidate this. | |
| std::shared_ptr< AxisLayout > | _ulayout |
| Layout of unknowns, partitioned by variable groups. | |
| std::shared_ptr< AxisLayout > | _glayout |
| Layout of given variables. | |
| std::shared_ptr< AxisLayout > | _blayout |
| Layout of RHS variables, partitioned by variable groups. | |
|
default |
|
default |
|
defaultnoexcept |
|
overridevirtual |
Trigger when unknown variables changed.
Reimplemented from LinearSystem.