|
OOFEM 3.0
|
#include <symcompcol.h>
Public Member Functions | |
| SymCompCol (int n=0) | |
| SymCompCol (const SymCompCol &S) | |
| Copy constructor. | |
| virtual | ~SymCompCol () |
| Destructor. | |
| std::unique_ptr< SparseMtrx > | clone () const override |
| void | times (const FloatArray &x, FloatArray &answer) const override |
| void | timesT (const FloatArray &x, FloatArray &answer) const override |
| void | times (double x) override |
| int | buildInternalStructure (EngngModel *, int, const UnknownNumberingScheme &) override |
| int | assemble (const IntArray &loc, const FloatMatrix &mat) override |
| int | assemble (const IntArray &rloc, const IntArray &cloc, const FloatMatrix &mat) override |
| bool | canBeFactorized () const override |
| Determines, whether receiver can be factorized. | |
| void | zero () override |
| Zeroes the receiver. | |
| double & | at (int i, int j) override |
| Returns coefficient at position (i,j). | |
| double | at (int i, int j) const override |
| Returns coefficient at position (i,j). | |
| const char * | giveClassName () const override |
| SparseMtrxType | giveType () const override |
| Sparse matrix type identification. | |
| bool | isAsymmetric () const override |
| Returns true if asymmetric. | |
| Public Member Functions inherited from oofem::CompCol | |
| CompCol (int n=0) | |
| CompCol (const CompCol &S) | |
| Copy constructor. | |
| CompCol & | operator= (const CompCol &C) |
| Assignment operator. | |
| virtual | ~CompCol () |
| Destructor. | |
| void | toFloatMatrix (FloatMatrix &answer) const override |
| Converts receiving sparse matrix to a dense float matrix. | |
| void | printYourself () const override |
| Prints receiver to stdout. Works only for relatively small matrices. | |
| FloatArray & | giveValues () |
| IntArray & | giveRowIndex () |
| IntArray & | giveColPtr () |
| const int | giveNumberOfNonzeros () |
| const double & | values (int i) const |
| const int & | row_ind (int i) const |
| const int & | col_ptr (int i) const |
| Public Member Functions inherited from oofem::SparseMtrx | |
| SparseMtrx (int n=0, int m=0) | |
| virtual | ~SparseMtrx () |
| Destructor. | |
| SparseMtrxVersionType | giveVersion () |
| Return receiver version. | |
| void | checkBounds (int i, int j) const |
| int | giveNumberOfRows () const |
| Returns number of rows of receiver. | |
| int | giveNumberOfColumns () const |
| Returns number of columns of receiver. | |
| bool | isSquare () const |
| Returns nonzero if receiver is square matrix. | |
| bool | isNotEmpty () const |
| Tests for empty matrix. | |
| virtual void | times (const FloatMatrix &B, FloatMatrix &answer) const |
| virtual void | timesT (const FloatMatrix &B, FloatMatrix &answer) const |
| virtual void | add (double x, SparseMtrx &m) |
| virtual void | addDiagonal (double x, FloatArray &m) |
| virtual int | buildInternalStructure (EngngModel *eModel, int n, int m, const IntArray &I, const IntArray &J) |
| virtual int | buildInternalStructure (EngngModel *eModel, int di, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s) |
| virtual int | assembleBegin () |
| Starts assembling the elements. | |
| virtual int | assembleEnd () |
| Returns when assemble is completed. | |
| virtual SparseMtrx * | factorized () |
| virtual FloatArray * | backSubstitutionWith (FloatArray &y) const |
| virtual double | computeNorm () const |
| Returns the norm of receiver. | |
| virtual std::unique_ptr< SparseMtrx > | giveSubMatrix (const IntArray &rows, const IntArray &cols) |
| virtual bool | isAllocatedAt (int i, int j) const |
| Checks whether memory is allocated at position (i,j). | |
| virtual void | printStatistics () const |
| Prints the receiver statistics (one-line) to stdout. | |
| virtual void | writeToFile (const char *fname) const |
| Helpful for debugging, writes the matrix to given file. | |
| std::string | errorInfo (const char *func) const |
| Error printing helper. | |
| FloatArray | operator* (const FloatArray &x) const |
| IML compatibility, \( A \cdot x\). | |
| FloatArray | trans_mult (const FloatArray &x) const |
| IML compatibility, \( A^{\mathrm{T}} \cdot x\). | |
Protected Member Functions | |
| double | operator() (int i, int j) const |
| implements 0-based access | |
| double & | operator() (int i, int j) |
| implements 0-based access | |
| Protected Member Functions inherited from oofem::CompCol | |
| double | operator() (int i, int j) const |
| implements 0-based access | |
| double & | operator() (int i, int j) |
| implements 0-based access | |
Additional Inherited Members | |
| Public Types inherited from oofem::SparseMtrx | |
| typedef long | SparseMtrxVersionType |
| Protected Attributes inherited from oofem::CompCol | |
| FloatArray | val |
| IntArray | rowind |
| IntArray | colptr |
| int | base |
| int | nz |
| Protected Attributes inherited from oofem::SparseMtrx | |
| int | nRows |
| Number of rows. | |
| int | nColumns |
| Number of columns. | |
| SparseMtrxVersionType | version |
Implementation of symmetric sparse matrix stored using compressed column/row storage. Only the lower part is stored.
Definition at line 81 of file symcompcol.h.
| oofem::SymCompCol::SymCompCol | ( | int | n = 0 | ) |
Constructor. Before any operation an internal profile must be built.
| n | Size of matrix |
Definition at line 84 of file symcompcol.C.
References oofem::CompCol::CompCol().
Referenced by SymCompCol().
| oofem::SymCompCol::SymCompCol | ( | const SymCompCol & | S | ) |
Copy constructor.
Definition at line 88 of file symcompcol.C.
References oofem::CompCol::CompCol(), S, and SymCompCol().
|
inlinevirtual |
Destructor.
Definition at line 94 of file symcompcol.h.
|
overridevirtual |
Assembles sparse matrix from contribution of local elements. This method for each element adds its contribution to itself. Mapping between local element contribution and its global position is given by local code numbers of element.
| loc | Location array. The values corresponding to zero loc array value are not assembled. |
| mat | Contribution to be assembled using loc array. |
Reimplemented from oofem::CompCol.
Definition at line 232 of file symcompcol.C.
References oofem::CompCol::colptr, oofem::FloatMatrix::giveNumberOfRows(), oofem::IntArray::giveSize(), oofem::SparseMtrx::nRows, OOFEM_ERROR, oofem::CompCol::rowind, oofem::CompCol::val, and oofem::SparseMtrx::version.
|
overridevirtual |
Assembles sparse matrix from contribution of local elements. This method for each element adds its contribution to itself. Mapping between local element contribution and its global position is given by row and column local code numbers.
| rloc | Row location array. The values corresponding to zero loc array value are not assembled. |
| cloc | Column location array. The values corresponding to zero loc array value are not assembled. |
| mat | Contribution to be assembled using rloc and cloc arrays. The rloc position determines the row, the cloc position determines the corresponding column. |
Reimplemented from oofem::CompCol.
Definition at line 275 of file symcompcol.C.
References oofem::CompCol::colptr, oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), oofem::SparseMtrx::nRows, OOFEM_ERROR, oofem::CompCol::rowind, oofem::CompCol::val, and oofem::SparseMtrx::version.
|
overridevirtual |
Returns coefficient at position (i,j).
Reimplemented from oofem::CompCol.
Definition at line 339 of file symcompcol.C.
References oofem::CompCol::colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), OOFEM_ERROR, oofem::CompCol::rowind, and oofem::CompCol::val.
|
overridevirtual |
Returns coefficient at position (i,j).
Reimplemented from oofem::CompCol.
Definition at line 321 of file symcompcol.C.
References oofem::CompCol::colptr, OOFEM_ERROR, oofem::CompCol::rowind, oofem::CompCol::val, and oofem::SparseMtrx::version.
|
overridevirtual |
Builds internal structure of receiver. This method determines the internal profile of sparse matrix, allocates necessary space for storing nonzero coefficients and initializes receiver. In general, the profile of sparse matrix is determined using one (or more) loop over local code numbers of elements. This method must be called before any operation, like assembly, zeroing, or multiplication.
| eModel | Pointer to corresponding engineering model. |
| di | Domain index specify which domain to use. |
| s | Determines unknown numbering scheme. |
Reimplemented from oofem::CompCol.
Definition at line 98 of file symcompcol.C.
References oofem::CompCol::colptr, oofem::Domain::giveBcs(), oofem::EngngModel::giveDomain(), oofem::Domain::giveElement(), oofem::Domain::giveElements(), oofem::ActiveBoundaryCondition::giveLocationArrays(), oofem::EngngModel::giveNumberOfDomainEquations(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, oofem::CompCol::nz, OOFEM_LOG_INFO, oofem::CompCol::rowind, oofem::CompCol::val, and oofem::SparseMtrx::version.
|
inlineoverridevirtual |
Determines, whether receiver can be factorized.
Reimplemented from oofem::CompCol.
Definition at line 103 of file symcompcol.h.
|
overridevirtual |
Returns a newly allocated copy of receiver. Programmer must take care about proper deallocation of allocated space.
Reimplemented from oofem::CompCol.
Definition at line 92 of file symcompcol.C.
|
inlineoverridevirtual |
Reimplemented from oofem::CompCol.
Definition at line 107 of file symcompcol.h.
|
inlineoverridevirtual |
Sparse matrix type identification.
Reimplemented from oofem::CompCol.
Definition at line 108 of file symcompcol.h.
References oofem::SMT_SymCompCol.
|
inlineoverridevirtual |
Returns true if asymmetric.
Reimplemented from oofem::CompCol.
Definition at line 109 of file symcompcol.h.
|
protected |
implements 0-based access
Definition at line 377 of file symcompcol.C.
References oofem::CompCol::colptr, OOFEM_ERROR, oofem::CompCol::rowind, oofem::CompCol::val, and oofem::SparseMtrx::version.
|
protected |
implements 0-based access
Definition at line 358 of file symcompcol.C.
References oofem::CompCol::colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), OOFEM_ERROR, oofem::CompCol::rowind, and oofem::CompCol::val.
|
overridevirtual |
Evaluates \( y = A \cdot x \)
| x | Array to be multiplied with receiver. |
| answer | y. |
Reimplemented from oofem::CompCol.
Definition at line 201 of file symcompcol.C.
References oofem::CompCol::colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), oofem::FloatArray::giveSize(), OOFEM_ERROR, oofem::FloatArray::resize(), oofem::CompCol::rowind, oofem::sum(), oofem::CompCol::val, and oofem::FloatArray::zero().
Referenced by timesT().
|
overridevirtual |
Multiplies receiver by scalar value.
| x | Value to multiply receiver. |
Reimplemented from oofem::CompCol.
Definition at line 224 of file symcompcol.C.
References oofem::CompCol::val, and oofem::SparseMtrx::version.
|
inlineoverridevirtual |
Evaluates \( y = A^{\mathrm{T}} \cdot x \)
| x | Array to be multiplied with transpose of the receiver. |
| answer | y. |
Reimplemented from oofem::CompCol.
Definition at line 98 of file symcompcol.h.
References times().
|
overridevirtual |
Zeroes the receiver.
Reimplemented from oofem::CompCol.
Definition at line 313 of file symcompcol.C.
References oofem::CompCol::val, and oofem::SparseMtrx::version.