14 #ifndef _ALG_EQ_SYSTEM_H
15 #define _ALG_EQ_SYSTEM_H
60 size_t nmat = 1,
size_t nvec = 1,
size_t nscl = 0,
61 bool reactions =
false,
int num_threads_SLU = 1,
62 bool forcePreAss =
false);
99 double getScalar(
size_t i = 0) {
return i <
c.size() ?
c[i] : 0.0; }
101 void addScalar(
double s,
size_t i = 0) {
if (i <
c.size())
c[i] += s; }
115 const std::vector<int>& extNodes,
117 const char* recmatFile =
nullptr)
const;
129 const std::vector<int>& extNodes,
143 std::vector<SysMatrixPair>
A;
144 std::vector<SystemVector*>
b;
145 std::vector<double>
c;
146 std::vector<double>*
d;
147 std::vector<double>
R;
Abstract interface for classes representing integrated quantities.
Various enums for linear algebra scope.
Global algebraic operations on index 1-based matrices and vectors.
Class for storage of general algebraic system of equations.
Definition: AlgEqSystem.h:33
AlgEqSystem & operator=(const AlgEqSystem &s)
Assignment operator.
Definition: AlgEqSystem.h:43
size_t getNoRHS() const
Returns the number of right-hand-side vectors allocated.
Definition: AlgEqSystem.h:90
AlgEqSystem(const SAM &s, const ProcessAdm *a=nullptr)
The constructor sets its reference to SAM and ProcessAdm objects.
Definition: AlgEqSystem.C:27
AlgEqSystem(const AlgEqSystem &a)
Copy constructor.
Definition: AlgEqSystem.h:38
const std::vector< double > * getReactions() const
Returns a pointer to the nodal reaction forces, if any.
Definition: AlgEqSystem.h:106
void addScalar(double s, size_t i=0)
Adds the value s to the i'th scalar quantity.
Definition: AlgEqSystem.h:101
AlgEqSystem & add(const AlgEqSystem &that)
Adds that to *this (assuming similar structure).
Definition: AlgEqSystem.C:136
const ProcessAdm * adm
Parallel process administrator.
Definition: AlgEqSystem.h:150
void clear()
Erases the system matrices and frees dynamically allocated storage.
Definition: AlgEqSystem.C:156
static bool readRecoveryMatrix(Matrix &Rmat, const char *recmatFile)
Reads the recovery matrix from file.
Definition: AlgEqSystem.C:476
virtual ~AlgEqSystem()
The destructor frees the dynamically allocated objects.
Definition: AlgEqSystem.h:40
virtual bool finalize(bool newLHS)
Finalizes the system matrices after element assembly.
Definition: AlgEqSystem.C:307
SystemMatrix * getMatrix(size_t i=0)
Returns the i'th matrix of the equation system.
Definition: AlgEqSystem.h:95
std::vector< double > * d
Multithreading buffer for the scalar values.
Definition: AlgEqSystem.h:146
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.
Definition: AlgEqSystem.C:33
std::vector< SysMatrixPair > A
The actual coefficient matrices.
Definition: AlgEqSystem.h:143
virtual void initialize(char initLHS)
Initializes the system matrices to zero.
Definition: AlgEqSystem.C:188
const std::vector< double > & getScalars() const
Returns a const reference to the assembled scalars.
Definition: AlgEqSystem.h:103
std::vector< double > c
Global scalar quantities.
Definition: AlgEqSystem.h:145
const SAM & getSAM() const
Returns a const reference to the SAM object.
Definition: AlgEqSystem.h:92
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.
Definition: AlgEqSystem.C:523
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.
Definition: AlgEqSystem.C:355
SystemVector * getVector(size_t i=0)
Returns the i'th right-hand-side vector of the equation system.
Definition: AlgEqSystem.h:97
double getScalar(size_t i=0)
Returns the i'th scalar quantity.
Definition: AlgEqSystem.h:99
std::vector< SystemVector * > b
The actual right-hand-side vectors.
Definition: AlgEqSystem.h:144
bool setAssociatedVector(size_t imat, size_t ivec)
Associates a system vector to a system matrix.
Definition: AlgEqSystem.C:177
virtual bool assemble(const LocalIntegral *elmObj, int elmId)
Adds a set of element matrices into the algebraic equation system.
Definition: AlgEqSystem.C:216
AlgEqSystem & copy(const AlgEqSystem &that)
Makes *this a copy of that.
Definition: AlgEqSystem.C:101
const SAM & sam
Data for FE assembly management.
Definition: AlgEqSystem.h:149
std::vector< double > R
Nodal reaction forces.
Definition: AlgEqSystem.h:147
Abstract base class representing a system level integrated quantity.
Definition: GlobalIntegral.h:29
Class for linear solver parameters.
Definition: LinSolParams.h:67
Abstract base class representing an element level integrated quantity.
Definition: LocalIntegral.h:25
Class for administration of MPI processes in IFEM library.
Definition: ProcessAdm.h:33
This class contains data and functions for the assembly of FE matrices.
Definition: SAM.h:39
Base class for representing a system matrix on different formats.
Definition: SystemMatrix.h:220
Base class for representing a system vector on different formats.
Definition: SystemMatrix.h:32
A vector class with some added algebraic operations.
Definition: matrix.h:64
MatrixType
The available system matrix formats and associated solvers.
Definition: LinAlgenums.h:22
Struct defining a coefficient matrix and an associated RHS-vector.
Definition: AlgEqSystem.h:135
SystemVector * _b
Pointer to the associated right-hand-side vector.
Definition: AlgEqSystem.h:137
SysMatrixPair()
Constructor initializing the pointers to zero.
Definition: AlgEqSystem.h:140
SystemMatrix * _A
The coefficient matrix.
Definition: AlgEqSystem.h:136