|
NEML2 2.1.0
|
Definition of a linear system of equations, Au = b. More...
Definition of a linear system of equations, Au = b.
#include <LinearSystem.h>

Public Member Functions | |
| 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 () |
| std::size_t | m () const |
| Number of rows in the matrix. | |
| std::size_t | n () const |
| Number of columns in the matrix. | |
| std::size_t | p () const |
| Number of columns in the auxiliary matrix. | |
| virtual void | set_u (const SparseTensorList &)=0 |
| Set the unknown u. | |
| virtual void | set_g (const SparseTensorList &)=0 |
| Set the given variables g from the current step. | |
| virtual SparseTensorList | u () const =0 |
| Get the unknown u. | |
| virtual SparseTensorList | g () const =0 |
| Get the given variables g from the current step. | |
| virtual void | u_changed () |
| Trigger when unknown variables changed. | |
| virtual void | g_changed () |
| Trigger when given variables changed. | |
| SparseTensorList | A () |
| Assemble and return the operator, A. | |
| SparseTensorList | b () |
| Assemble and return the right-hand side, b. | |
| std::tuple< SparseTensorList, SparseTensorList > | A_and_b () |
| Assemble and return the right-hand side and operator. | |
| std::tuple< SparseTensorList, SparseTensorList > | A_and_B () |
| Assemble the auxiliary matrix B = dr/dg along with A. | |
| std::tuple< SparseTensorList, SparseTensorList, SparseTensorList > | A_and_B_and_b () |
| Assemble the auxiliary matrix B = dr/dg along with A and b. | |
| const std::vector< LabeledAxisAccessor > & | umap () const |
| Get the ID-to-unknown mapping for assembly. | |
| const std::vector< TensorShape > & | intmd_ulayout () const |
| Get the ID-to-unknown-intermediate-shape mapping for assembly. | |
| const std::vector< TensorShape > & | ulayout () const |
| Get the ID-to-unknown-base-shape mapping for assembly. | |
| const std::vector< LabeledAxisAccessor > & | gmap () const |
| Get the ID-to-prescribed-variable mapping for assembly. | |
| const std::vector< TensorShape > & | intmd_glayout () const |
| Get the ID-to-prescribed-variable-intermediate-shape mapping for assembly. | |
| const std::vector< TensorShape > & | glayout () const |
| Get the ID-to-prescribed-variable-base-shape mapping for assembly. | |
| const std::vector< LabeledAxisAccessor > & | bmap () const |
| Get the ID-to-RHS mapping for assembly. | |
| const std::vector< TensorShape > & | intmd_blayout () const |
| Get the ID-to-RHS-intermediate-shape mapping for assembly. | |
| const std::vector< TensorShape > & | blayout () const |
| Get the ID-to-RHS-base-shape mapping for assembly. | |
Protected Member Functions | |
| virtual std::vector< LabeledAxisAccessor > | setup_umap ()=0 |
| Setup the unknown map. | |
| virtual std::vector< TensorShape > | setup_intmd_ulayout ()=0 |
| Setup the unknown intermediate layout. | |
| virtual std::vector< TensorShape > | setup_ulayout ()=0 |
| Setup the unknown layout. | |
| virtual std::vector< LabeledAxisAccessor > | setup_gmap ()=0 |
| Setup the given variable map. | |
| virtual std::vector< TensorShape > | setup_intmd_glayout ()=0 |
| Setup the given variable intermediate layout. | |
| virtual std::vector< TensorShape > | setup_glayout ()=0 |
| Setup the given variable base layout. | |
| virtual std::vector< LabeledAxisAccessor > | setup_bmap ()=0 |
| Setup the RHS map. | |
| virtual std::vector< TensorShape > | setup_intmd_blayout ()=0 |
| Setup the RHS intermediate layout. | |
| virtual std::vector< TensorShape > | setup_blayout ()=0 |
| Setup the RHS layout. | |
| virtual void | assemble (SparseTensorList *A, SparseTensorList *B, SparseTensorList *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 | |
| 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::vector< LabeledAxisAccessor > | _umap |
| The ID-to-unknown mapping. | |
| std::optional< std::vector< TensorShape > > | _intmd_ulayout |
| ID-to-unknown intermediate shape mapping. | |
| std::vector< TensorShape > | _ulayout |
| ID-to-unknown base shape mapping. | |
| std::vector< LabeledAxisAccessor > | _gmap |
| The ID-to-given-variable mapping. | |
| std::optional< std::vector< TensorShape > > | _intmd_glayout |
| ID-to-given intermediate shape mapping. | |
| std::vector< TensorShape > | _glayout |
| ID-to-given base shape mapping. | |
| std::vector< LabeledAxisAccessor > | _bmap |
| The ID-to-RHS mapping. | |
| std::optional< std::vector< TensorShape > > | _intmd_blayout |
| ID-to-RHS intermediate shape mapping. | |
| std::vector< TensorShape > | _blayout |
| ID-to-RHS shape mapping. | |
|
default |
|
default |
|
defaultnoexcept |
|
virtualdefault |
| SparseTensorList A | ( | ) |
Assemble and return the operator, A.
| std::tuple< SparseTensorList, SparseTensorList > A_and_B | ( | ) |
Assemble the auxiliary matrix B = dr/dg along with A.
| std::tuple< SparseTensorList, SparseTensorList > A_and_b | ( | ) |
Assemble and return the right-hand side and operator.
| std::tuple< SparseTensorList, SparseTensorList, SparseTensorList > A_and_B_and_b | ( | ) |
Assemble the auxiliary matrix B = dr/dg along with A and b.
|
protectedpure virtual |
Compute the operator and right-hand side.
| A | Pointer to the operator matrix – nullptr if not requested |
| B | Pointer to the auxiliary matrix – nullptr if not requested |
| b | Pointer to the RHS vector – nullptr if not requested |
Implemented in ModelNonlinearSystem.
| SparseTensorList b | ( | ) |
Assemble and return the right-hand side, b.
| const std::vector< TensorShape > & blayout | ( | ) | const |
Get the ID-to-RHS-base-shape mapping for assembly.
| const std::vector< LabeledAxisAccessor > & bmap | ( | ) | const |
Get the ID-to-RHS mapping for assembly.
|
pure virtual |
Get the given variables g from the current step.
Implemented in ModelNonlinearSystem.
|
virtual |
Trigger when given variables changed.
| const std::vector< TensorShape > & glayout | ( | ) | const |
Get the ID-to-prescribed-variable-base-shape mapping for assembly.
| const std::vector< LabeledAxisAccessor > & gmap | ( | ) | const |
Get the ID-to-prescribed-variable mapping for assembly.
|
virtual |
| const std::vector< TensorShape > & intmd_blayout | ( | ) | const |
Get the ID-to-RHS-intermediate-shape mapping for assembly.
| const std::vector< TensorShape > & intmd_glayout | ( | ) | const |
Get the ID-to-prescribed-variable-intermediate-shape mapping for assembly.
| const std::vector< TensorShape > & intmd_ulayout | ( | ) | const |
Get the ID-to-unknown-intermediate-shape mapping for assembly.
| std::size_t m | ( | ) | const |
Number of rows in the matrix.
| std::size_t n | ( | ) | const |
Number of columns in the matrix.
|
default |
|
defaultnoexcept |
| std::size_t p | ( | ) | const |
Number of columns in the auxiliary matrix.
|
protectedvirtual |
Callback after assembly to perform.
This is useful, for example, to collect information that isn't available after the first assembly
| A | Whether the operator matrix was assembled |
| B | Whether the auxiliary matrix was assembled |
| b | Whether the RHS vector was assembled |
Reimplemented in ModelNonlinearSystem.
|
protectedvirtual |
Callback before assembly to perform.
This is useful, for example, to clear obsolete data structures
| A | Whether the operator matrix was assembled |
| B | Whether the auxiliary matrix was assembled |
| b | Whether the RHS vector was assembled |
Reimplemented in ModelNonlinearSystem.
|
pure virtual |
Set the given variables g from the current step.
Implemented in ModelNonlinearSystem.
|
pure virtual |
Set the unknown u.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the RHS layout.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the RHS map.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the given variable base layout.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the given variable map.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the RHS intermediate layout.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the given variable intermediate layout.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the unknown intermediate layout.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the unknown layout.
Implemented in ModelNonlinearSystem.
|
protectedpure virtual |
Setup the unknown map.
Implemented in ModelNonlinearSystem.
|
pure virtual |
Get the unknown u.
Implemented in ModelNonlinearSystem.
|
virtual |
Trigger when unknown variables changed.
Reimplemented in NonlinearSystem.
| const std::vector< TensorShape > & ulayout | ( | ) | const |
Get the ID-to-unknown-base-shape mapping for assembly.
| const std::vector< LabeledAxisAccessor > & umap | ( | ) | const |
Get the ID-to-unknown mapping for assembly.
|
protected |
Flag indicating if the system matrix is up to date. Setters invalidate this.
|
protected |
Flag indicating if the auxiliary matrix is up to date. Setters invalidate this.
|
protected |
Flag indicating if the system RHS is up to date. Setters invalidate this.
|
protected |
ID-to-RHS shape mapping.
|
protected |
The ID-to-RHS mapping.
The RHS is ordered according to this mapping. This mapping is used by assemble() to collect values in a consistent order.
|
protected |
ID-to-given base shape mapping.
|
protected |
The ID-to-given-variable mapping.
The vector of given variables is ordered according to this mapping.
|
protected |
ID-to-RHS intermediate shape mapping.
|
protected |
ID-to-given intermediate shape mapping.
|
protected |
ID-to-unknown intermediate shape mapping.
|
protected |
ID-to-unknown base shape mapping.
|
protected |
The ID-to-unknown mapping.
The solution vector is ordered according to this mapping. This mapping is used by assemble() to collect values in a consistent order.