|
IFEM
90A354
|
Class for storage of general algebraic system of equations. More...
#include <AlgEqSystem.h>


Classes | |
| struct | SysMatrixPair |
| Struct defining a coefficient matrix and an associated RHS-vector. More... | |
Public Member Functions | |
| AlgEqSystem (const SAM &s, const ProcessAdm *a=nullptr) | |
| The constructor sets its reference to SAM and ProcessAdm objects. | |
| AlgEqSystem (const AlgEqSystem &a) | |
| Copy constructor. | |
| virtual | ~AlgEqSystem () |
| The destructor frees the dynamically allocated objects. | |
| AlgEqSystem & | operator= (const AlgEqSystem &s) |
| Assignment operator. | |
| AlgEqSystem & | copy (const AlgEqSystem &that) |
| Makes *this a copy of that. | |
| AlgEqSystem & | add (const AlgEqSystem &that) |
| Adds that to *this (assuming similar structure). | |
| bool | init (LinAlg::MatrixType mtype, const LinSolParams *spar=nullptr, size_t nmat=1, size_t nvec=1, size_t nscl=0, bool reactions=false, int num_threads_SLU=1, bool forcePreAss=false) |
| Allocates the system matrices of the specified format. More... | |
| void | clear () |
| Erases the system matrices and frees dynamically allocated storage. | |
| bool | setAssociatedVector (size_t imat, size_t ivec) |
| Associates a system vector to a system matrix. More... | |
| virtual void | initialize (char initLHS) |
| Initializes the system matrices to zero. More... | |
| virtual bool | finalize (bool newLHS) |
| Finalizes the system matrices after element assembly. More... | |
| virtual bool | assemble (const LocalIntegral *elmObj, int elmId) |
| Adds a set of element matrices into the algebraic equation system. More... | |
| size_t | getNoRHS () const |
| Returns the number of right-hand-side vectors allocated. | |
| const SAM & | getSAM () const |
| Returns a const reference to the SAM object. | |
| SystemMatrix * | getMatrix (size_t i=0) |
| Returns the i'th matrix of the equation system. | |
| SystemVector * | getVector (size_t i=0) |
| Returns the i'th right-hand-side vector of the equation system. | |
| double | getScalar (size_t i=0) |
| Returns the i'th scalar quantity. | |
| void | addScalar (double s, size_t i=0) |
| Adds the value s to the i'th scalar quantity. | |
| const std::vector< double > & | getScalars () const |
| Returns a const reference to the assembled scalars. | |
| const std::vector< double > * | getReactions () const |
| Returns a pointer to the nodal reaction forces, if any. | |
| bool | staticCondensation (Matrix &Ared, Vector &bred, const std::vector< int > &extNodes, size_t imat=0, const char *recmatFile=nullptr) const |
| Performs static condensation of the indicated equation system. More... | |
| bool | recoverInternals (const Matrix &Rmat, const std::vector< int > &extNodes, const Vector &xe, Vector &xFull) const |
| Performs recovery of internal DOF values from the external DOFs. More... | |
Public Member Functions inherited from GlobalIntegral | |
| GlobalIntegral () | |
| The default constructor. | |
| virtual | ~GlobalIntegral () |
| Empty destructor. | |
| virtual bool | threadSafe () const |
| Returns true if all elements can be assembled in parallel. | |
| virtual bool | haveContributions (size_t, const std::vector< Property > &) const |
| Returns false if no contributions from a specified patch. | |
Static Public Member Functions | |
| static bool | readRecoveryMatrix (Matrix &Rmat, const char *recmatFile) |
| Reads the recovery matrix from file. More... | |
Private Attributes | |
| std::vector< SysMatrixPair > | A |
| The actual coefficient matrices. | |
| std::vector< SystemVector * > | b |
| The actual right-hand-side vectors. | |
| std::vector< double > | c |
| Global scalar quantities. | |
| std::vector< double > * | d |
| Multithreading buffer for the scalar values. | |
| std::vector< double > | R |
| Nodal reaction forces. | |
| const SAM & | sam |
| Data for FE assembly management. | |
| const ProcessAdm * | adm |
| Parallel process administrator. | |
Class for storage of general algebraic system of equations.
|
virtual |
Adds a set of element matrices into the algebraic equation system.
| [in] | elmObj | Pointer to the element matrices to add into *this |
| [in] | elmId | Global number of the element associated with *elmObj |
Reimplemented from GlobalIntegral.
References A, ElmMats::A, SAM::assembleSystem(), b, ElmMats::b, c, ElmMats::c, d, ElmMats::empty(), ElmMats::getNewtonMatrix(), ElmMats::getRHSVector(), ElmMats::printMat(), ElmMats::printScl(), ElmMats::printVec(), R, ElmMats::rhsOnly, sam, and ElmMats::withLHS.
Referenced by SIMmodal::assembleModalSystem().
|
virtual |
Finalizes the system matrices after element assembly.
| [in] | newLHS | If false, only right-hand-side vectors was assembled |
Reimplemented from GlobalIntegral.
References A, b, c, d, SAM::expandSolution(), SAM::printVector(), and sam.
Referenced by SIMmodal::assembleModalSystem(), and SIMbase::assembleSystem().
| bool AlgEqSystem::init | ( | LinAlg::MatrixType | mtype, |
| const LinSolParams * | spar = nullptr, |
||
| size_t | nmat = 1, |
||
| size_t | nvec = 1, |
||
| size_t | nscl = 0, |
||
| bool | reactions = false, |
||
| int | num_threads_SLU = 1, |
||
| bool | forcePreAss = false |
||
| ) |
Allocates the system matrices of the specified format.
| [in] | mtype | The matrix format to use for all matrices |
| [in] | spar | Input parameters for the linear equation solver |
| [in] | nmat | Number of system matrices to allocate |
| [in] | nvec | Number of system vectors to allocate |
| [in] | nscl | Number of scalar quantities to allocate |
| [in] | reactions | If false, no reaction forces will be computed |
| [in] | num_threads_SLU | Number of threads for SuperLU_MT |
| [in] | forcePreAss | If true, force preassembly for sparse matrices |
References A, adm, b, c, SystemMatrix::create(), SystemVector::create(), SAM::getNoEquations(), SAM::getNoSpecifiedDOFs(), PROFILE, R, and sam.
Referenced by SIMmodal::assembleModalSystem(), and SIMbase::initSystem().
|
virtual |
Initializes the system matrices to zero.
| [in] | initLHS | If false, only initialize right-hand-side vectors |
Reimplemented from GlobalIntegral.
Referenced by SIMmodal::assembleModalSystem(), and SIMbase::assembleSystem().
|
static |
Reads the recovery matrix from file.
| [out] | Rmat | The recovery matrix, xi = Rmat*xe |
| [in] | recmatFile | Name of recovery matrix file |
References c, utl::matrixBase< T >::ptr(), and utl::matrix< T >::resize().
| bool AlgEqSystem::recoverInternals | ( | const Matrix & | Rmat, |
| const std::vector< int > & | extNodes, | ||
| const Vector & | xe, | ||
| Vector & | xFull | ||
| ) | const |
Performs recovery of internal DOF values from the external DOFs.
| [in] | Rmat | Recovery matrix |
| [in] | extNodes | List of external nodes whose DOFs were retained |
| [in] | xe | External DOF values |
| [out] | xFull | Expanded solution vector with all DOFs |
References SAM::expandVector(), SAM::getNodeEqns(), SAM::getNoEquations(), utl::matrix< T >::multiply(), sam, and utl::vector< T >::size().
| bool AlgEqSystem::setAssociatedVector | ( | size_t | imat, |
| size_t | ivec | ||
| ) |
Associates a system vector to a system matrix.
| [in] | imat | Index of a coefficient matrix |
| [in] | ivec | Index of the system vector to associate with the matrix |
The purpose of this method is to define which right-hand-side vector (if any) should receive contributions when assembling a coefficient matrix, when the system to be assembled has explicit constraint equations for which the dependent DOFs have been eliminated.
Referenced by SIMbase::setAssociatedRHS().
| bool AlgEqSystem::staticCondensation | ( | Matrix & | Ared, |
| Vector & | bred, | ||
| const std::vector< int > & | extNodes, | ||
| size_t | imat = 0, |
||
| const char * | recmatFile = nullptr |
||
| ) | const |
Performs static condensation of the indicated equation system.
| [out] | Ared | Reduced System matrix |
| [out] | bred | Associated reduced right-hand-side vector |
| [in] | extNodes | List of external nodes whose DOFs to retain |
| [in] | imat | Index of the system matrix-vector pair to condensate |
| [in] | recmatFile | Name of recovery matrix file |
References A, IFEM::cout, utl::matrix< T >::fillColumn(), SAM::getNodeEqns(), utl::vector< T >::ptr(), utl::matrix< T >::resize(), SparseMatrix::rows(), sam, eig::solve(), and SparseMatrix::split().