47 void print(std::ostream& os)
const;
51 const char* heading =
nullptr)
const
54 os <<
"\n"<< heading <<
":";
55 for (
int inod = 1; inod <=
nnod; inod++)
56 for (
int jdof =
madof[inod-1]; jdof <
madof[inod]; jdof++)
59 os <<
"\nNode "<< inod <<
":";
60 for (
int idof =
madof[inod-1]; idof <
madof[inod]; idof++)
107 const Matrix& eK,
int iel = 0,
108 RealArray* reactionForces =
nullptr)
const;
127 const Matrix& eK,
int iel = 0,
128 RealArray* reactionForces =
nullptr)
const;
138 RealArray* reactionForces =
nullptr)
const;
147 const Real* nS,
int inod = 0,
148 RealArray* reactionForces =
nullptr)
const;
156 const std::pair<int,int>& dof)
const;
186 {
return inod-- > 0 && inod < (int)
nodeType.size() ?
nodeType[inod] :
' '; }
257 {
return sqrt(this->
dot(x,x,dofType)); }
277 const IntVec* nodes =
nullptr)
const;
290 virtual bool merge(
const SAM*,
const std::map<int,int>*) {
return false; }
321 void printCEQ(std::ostream& os,
int iceq)
const;
std::vector< int > IntVec
General integer vector.
Definition: ASMbase.h:25
std::set< int > IntSet
General integer set.
Definition: ASMunstruct.h:22
#define Real
The floating point type to use.
Definition: ImmersedBoundaries.h:18
std::vector< Real > RealArray
A real-valued array without algebraic operations.
Definition: ImmersedBoundaries.h:29
Global algebraic operations on index 1-based matrices and vectors.
Class for representing a dense system matrix.
Definition: DenseMatrix.h:27
Class for representing a diagonal system matrix.
Definition: DiagMatrix.h:25
Class for representing the system matrix in PETSc format.
Definition: PETScMatrix.h:172
This class contains data and functions for the assembly of FE matrices.
Definition: SAM.h:39
void addToRHS(SystemVector &sysRHS, const RealArray &S) const
Adds a global load vector into the system load vector.
Definition: SAM.C:593
virtual Real dot(const Vector &x, const Vector &y, char dofType='D') const
Computes the dot-product of two vectors of length NDOF.
Definition: SAM.C:842
virtual bool expandSolution(const SystemVector &solVec, Vector &dofVec, Real scaleSD=Real(1)) const
Expands a solution vector from equation-ordering to DOF-ordering.
Definition: SAM.C:768
void printVector(T &os, const RealArray &vec, const char *heading=nullptr) const
Prints out a nodal DOF vector to the given stream.
Definition: SAM.h:50
void assembleReactions(RealArray &rf, const RealArray &eS, int iel) const
Assembles reaction forces for the fixed and prescribed DOFs.
Definition: SAM.C:620
int & nnod
Number of nodes.
Definition: SAM.h:330
void printCEQ(std::ostream &os, int iceq) const
Prints out a constraint equation to the given stream.
Definition: SAM.C:127
bool assembleSystem(SystemMatrix &sysK, SystemVector &sysRHS, const Matrix &eK, int iel=0, RealArray *reactionForces=nullptr) const
Adds an element stiffness matrix into the system stiffness matrix.
Definition: SAM.C:430
SAM()
The constructor initializes an empty object.
Definition: SAM.C:66
int getNoSpecifiedDOFs() const
Returns the number of specified DOFs in the model.
Definition: SAM.h:75
Real norm2(const Vector &x, char dofType='D') const
Computes the l2-norm of a vector of length NDOF.
Definition: SAM.h:256
int mpar[50]
Matrix of parameters.
Definition: SAM.h:326
std::pair< int, int > getNodeAndLocalDof(int idof, bool eqno=false) const
Returns the internal node number and local index for a global DOF.
Definition: SAM.C:101
int * madof
Matrix of accumulated DOFs.
Definition: SAM.h:344
Real * ttcc
Table of tables of constraint equation coefficients.
Definition: SAM.h:348
int & nspdof
Number of specified DOFs.
Definition: SAM.h:333
bool getNodalReactions(int inod, const RealArray &rf, RealArray &nrf) const
Returns a vector of reaction forces for a given node.
Definition: SAM.C:976
virtual ~SAM()
The destructor frees the dynamically allocated arrays.
Definition: SAM.C:86
int * minex
Matrix of internal to external node numbers.
Definition: SAM.h:349
int & neq
Number of system equations.
Definition: SAM.h:335
virtual Real normInf(const Vector &x, size_t &comp, char dofType='D') const
Computes the L_infinity-norm of a vector of length NDOF.
Definition: SAM.C:883
bool getElmNodes(IntVec &mnpc, int iel) const
Finds the matrix of nodal point correspondance for an element.
Definition: SAM.C:635
void printStatusCodes(std::ostream &os) const
Prints out the DOF status codes to the given stream.
Definition: SAM.C:208
std::vector< char > nodeType
Nodal DOF classification.
Definition: SAM.h:352
int & nel
Number of elements.
Definition: SAM.h:331
int getEquation(int inod, int ldof) const
Finds the equation number corresponding to a local nodal DOF.
Definition: SAM.C:746
int * msc
Matrix of status codes.
Definition: SAM.h:345
std::vector< char > dof_type
Individual DOF classification.
Definition: SAM.h:353
int getNoElms() const
Returns the number of elements in the model.
Definition: SAM.h:68
IntSet getEquations(char dType, int dof=0) const
Returns the equations numbers for a given DOF type.
Definition: SAM.C:1002
int * mmnpc
Matrix of matrices of nodal point correspondances.
Definition: SAM.h:343
int & nmmceq
Number of elements in MMCEQ.
Definition: SAM.h:337
int * mpmceq
Matrix of pointers to MCEQs in MMCEQ.
Definition: SAM.h:346
char getNodeType(int inod) const
Returns the DOF classification of a given node.
Definition: SAM.h:185
Real getReaction(int dir, const RealArray &rf, const IntVec *nodes=nullptr) const
Returns the total reaction force in the given coordinate direction.
Definition: SAM.C:956
void getDofCouplings(IntVec &irow, IntVec &jcol) const
Computes the sparse structure (DOF couplings) in the system matrix.
Definition: SAM.C:354
const int * getMADOF() const
Returns the Matrix of Accumulated DOFs.
Definition: SAM.h:85
bool getElmEqns(IntVec &meen, int iel, size_t nedof=0) const
Finds the matrix of equation numbers for an element.
Definition: SAM.C:655
bool getNodeEqns(IntVec &mnen, int inod) const
Finds the matrix of equation numbers for a node.
Definition: SAM.C:721
int getNoNodes(char dofType='A') const
Returns the number of FE nodes in the model.
Definition: SAM.C:339
void getUniqueEqns(IntSet &meen, int iel) const
Finds the set of unique equation numbers for an element.
Definition: SAM.C:699
int & nmmnpc
Number of elements in MMNPC.
Definition: SAM.h:336
int getNoEquations() const
Returns the number of equations (free DOFs) in the model.
Definition: SAM.h:79
int * mpmnpc
Matrix of pointers to MNPCs in MMNPC.
Definition: SAM.h:342
bool haveReaction(int dir, const IntVec *nodes=nullptr) const
Checks for total reaction force in the given coordinate direction.
Definition: SAM.C:943
Real getDofVal(const RealArray &dofVec, int inod, int ldof) const
Returns specified solution component from a global solution vector.
Definition: SAM.C:758
std::pair< int, int > getNodeDOFs(int inod) const
Returns the first and last DOFs for a node.
Definition: SAM.C:738
bool expandVector(const Vector &solVec, Vector &dofVec) const
Expands a solution vector from equation-ordering to DOF-ordering.
Definition: SAM.C:777
int * mmceq
Matrix of matrices of constraint equation definitions.
Definition: SAM.h:347
int getNoConstraints() const
Returns the total number of constraint equations in the model.
Definition: SAM.h:77
void assembleRHS(Real *RHS, Real value, int ieq) const
Adds a scalar value into a system right hand-side vector.
Definition: SAM.C:605
bool getSolVec(RealArray &solVec, const RealArray &dofVec) const
Extracts equation-ordered solution vector from DOF-ordered vector.
Definition: SAM.C:812
bool initSystemEquations()
Initializes the DOF-to-equation connectivity array MEQN.
Definition: SAM.C:225
int getNoDOFs() const
Returns the total number of DOFs in the model.
Definition: SAM.h:73
void printMEQN(std::ostream &os) const
Prints out the equation number mapping to the given stream.
Definition: SAM.C:180
void print(std::ostream &os) const
Prints out the key data to the given stream.
Definition: SAM.C:144
bool applyDirichlet(Vector &dofVec) const
Applies the non-homogenous Dirichlet BCs to the given vector.
Definition: SAM.C:825
int & nceq
Number of constraint equations.
Definition: SAM.h:334
const int * getMEQN() const
Returns the Matrix of EQuation Numbers.
Definition: SAM.h:87
virtual Real normL2(const Vector &x, char dofType='D') const
Computes the L2-norm of a vector of length NDOF.
Definition: SAM.C:860
virtual Real normReact(const RealArray &u, const RealArray &rf) const
Computes the energy norm contributions from nodal reaction forces.
Definition: SAM.C:923
int * meqn
Matrix of equation numbers.
Definition: SAM.h:350
virtual bool merge(const SAM *, const std::map< int, int > *)
Merges the assembly data from another SIM object with this.
Definition: SAM.h:290
int & ndof
Number of DOFs.
Definition: SAM.h:332
Class for representing the system matrix on the SPR-format.
Definition: SPRMatrix.h:37
Class for representing a system matrix on an unstructured sparse form.
Definition: SparseMatrix.h:38
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
T trunc(T v)
Truncate a value to zero when it is less than a given threshold.
Definition: matrix.h:1765