|
OOFEM 3.0
|
#include <dyncompcol.h>
Public Member Functions | |
| DynCompCol (int n=0) | |
| DynCompCol (const DynCompCol &S) | |
| Copy constructor. | |
| DynCompCol & | operator= (const DynCompCol &C) |
| Assignment operator. | |
| virtual | ~DynCompCol () |
| 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. | |
| const char * | giveClassName () const override |
| SparseMtrxType | giveType () const override |
| Sparse matrix type identification. | |
| bool | isAsymmetric () const override |
| Returns true if asymmetric. | |
| 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). | |
| void | printStatistics () const override |
| Prints the receiver statistics (one-line) to stdout. | |
| const IntArray & | row_ind (int i) const |
| Returns row index for i-th column. | |
| const FloatArray & | column (int i) const |
| Returns column values. | |
| 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 | toFloatMatrix (FloatMatrix &answer) const |
| Converts receiving sparse matrix to a dense float matrix. | |
| virtual void | printYourself () const |
| Prints receiver to stdout. Works only for relatively small matrices. | |
| 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. | |
| int | giveRowIndx (int col, int row) const |
| Returns the row index of given row at given column, else returns zero. | |
| int | insertRowInColumn (int col, int row) |
| Insert row entry into column, preserving order of row indexes, returns the index of new row. | |
| void | checkSizeTowards (IntArray &) |
| void | checkSizeTowards (const IntArray &rloc, const IntArray &cloc) |
| void | growTo (int) |
Protected Attributes | |
| std::vector< FloatArray > | columns |
| std::vector< IntArray > | rowind |
| int | base |
| Protected Attributes inherited from oofem::SparseMtrx | |
| int | nRows |
| Number of rows. | |
| int | nColumns |
| Number of columns. | |
| SparseMtrxVersionType | version |
Additional Inherited Members | |
| Public Types inherited from oofem::SparseMtrx | |
| typedef long | SparseMtrxVersionType |
Implementation of sparse matrix stored in compressed column storage. Designed to allow simple dynamic runtime grow of receiver.
Definition at line 57 of file dyncompcol.h.
| oofem::DynCompCol::DynCompCol | ( | int | n = 0 | ) |
Constructor. Before any operation an internal profile must be built.
Definition at line 54 of file dyncompcol.C.
References base, and oofem::SparseMtrx::SparseMtrx().
Referenced by DynCompCol(), and operator=().
| oofem::DynCompCol::DynCompCol | ( | const DynCompCol & | S | ) |
Copy constructor.
Definition at line 59 of file dyncompcol.C.
References base, columns, DynCompCol(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, rowind, S, oofem::SparseMtrx::SparseMtrx(), and oofem::SparseMtrx::version.
|
inlinevirtual |
Destructor.
Definition at line 75 of file dyncompcol.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. |
Implements oofem::SparseMtrx.
Definition at line 197 of file dyncompcol.C.
References at(), oofem::FloatMatrix::at(), oofem::IntArray::at(), oofem::FloatMatrix::giveNumberOfRows(), oofem::IntArray::giveSize(), OOFEM_ERROR, 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. |
Implements oofem::SparseMtrx.
Definition at line 224 of file dyncompcol.C.
References at(), oofem::FloatMatrix::at(), oofem::IntArray::at(), checkSizeTowards(), columns, oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), oofem::IntArray::giveSize(), growTo(), insertRowInColumn(), oofem::max(), and oofem::SparseMtrx::version.
|
overridevirtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Definition at line 312 of file dyncompcol.C.
References columns, giveRowIndx(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, and OOFEM_ERROR.
|
overridevirtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Definition at line 298 of file dyncompcol.C.
References columns, giveRowIndx(), OOFEM_ERROR, and oofem::SparseMtrx::version.
Referenced by assemble(), assemble(), giveRowIndx(), and insertRowInColumn().
|
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. |
Implements oofem::SparseMtrx.
Definition at line 112 of file dyncompcol.C.
References columns, oofem::Domain::giveBcs(), oofem::EngngModel::giveDomain(), oofem::Domain::giveElement(), oofem::Domain::giveElements(), oofem::ActiveBoundaryCondition::giveLocationArrays(), oofem::EngngModel::giveNumberOfDomainEquations(), growTo(), insertRowInColumn(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, OOFEM_LOG_DEBUG, rowind, and oofem::SparseMtrx::version.
|
inlineoverridevirtual |
Determines, whether receiver can be factorized.
Implements oofem::SparseMtrx.
Definition at line 85 of file dyncompcol.h.
Definition at line 400 of file dyncompcol.C.
References oofem::IntArray::giveSize(), growTo(), insertRowInColumn(), and oofem::max().
|
protected |
Definition at line 375 of file dyncompcol.C.
References oofem::IntArray::giveSize(), growTo(), insertRowInColumn(), and oofem::max().
Referenced by assemble().
|
overridevirtual |
Returns a newly allocated copy of receiver. Programmer must take care about proper deallocation of allocated space.
Reimplemented from oofem::SparseMtrx.
Definition at line 81 of file dyncompcol.C.
|
inline |
Returns column values.
Definition at line 100 of file dyncompcol.h.
References columns.
Referenced by oofem::CompCol_ILUPreconditioner::initialize(), times(), and zero().
|
inlineoverridevirtual |
Implements oofem::SparseMtrx.
Definition at line 87 of file dyncompcol.h.
|
protected |
Returns the row index of given row at given column, else returns zero.
Definition at line 444 of file dyncompcol.C.
Referenced by at(), at(), operator()(), and operator()().
|
inlineoverridevirtual |
Sparse matrix type identification.
Implements oofem::SparseMtrx.
Definition at line 88 of file dyncompcol.h.
References oofem::SMT_DynCompCol.
|
protected |
Definition at line 434 of file dyncompcol.C.
References columns, oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, and rowind.
Referenced by assemble(), buildInternalStructure(), checkSizeTowards(), and checkSizeTowards().
|
protected |
Insert row entry into column, preserving order of row indexes, returns the index of new row.
Definition at line 478 of file dyncompcol.C.
References at(), columns, DynCompCol_CHUNK, and rowind.
Referenced by assemble(), buildInternalStructure(), checkSizeTowards(), and checkSizeTowards().
|
inlineoverridevirtual |
Returns true if asymmetric.
Implements oofem::SparseMtrx.
Definition at line 89 of file dyncompcol.h.
|
protected |
Implements 0-based access.
Definition at line 342 of file dyncompcol.C.
References columns, giveRowIndx(), OOFEM_ERROR, and oofem::SparseMtrx::version.
|
protected |
Implements 0-based access.
Definition at line 327 of file dyncompcol.C.
References columns, giveRowIndx(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, and OOFEM_ERROR.
| DynCompCol & oofem::DynCompCol::operator= | ( | const DynCompCol & | C | ) |
Assignment operator.
Definition at line 68 of file dyncompcol.C.
References base, columns, DynCompCol(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, rowind, and oofem::SparseMtrx::version.
|
overridevirtual |
Prints the receiver statistics (one-line) to stdout.
Reimplemented from oofem::SparseMtrx.
Definition at line 287 of file dyncompcol.C.
References oofem::SparseMtrx::nColumns, OOFEM_LOG_DEBUG, and rowind.
|
inline |
Returns row index for i-th column.
Definition at line 98 of file dyncompcol.h.
References rowind.
Referenced by oofem::CompCol_ILUPreconditioner::initialize().
|
overridevirtual |
Evaluates \( y = A \cdot x \)
| x | Array to be multiplied with receiver. |
| answer | y. |
Reimplemented from oofem::SparseMtrx.
Definition at line 86 of file dyncompcol.C.
References columns, oofem::FloatArray::giveSize(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, OOFEM_ERROR, oofem::FloatArray::resize(), rowind, and oofem::FloatArray::zero().
|
overridevirtual |
Multiplies receiver by scalar value.
| x | Value to multiply receiver. |
Reimplemented from oofem::SparseMtrx.
Definition at line 103 of file dyncompcol.C.
References column(), columns, and oofem::SparseMtrx::version.
|
overridevirtual |
Evaluates \( y = A^{\mathrm{T}} \cdot x \)
| x | Array to be multiplied with transpose of the receiver. |
| answer | y. |
Reimplemented from oofem::SparseMtrx.
Definition at line 356 of file dyncompcol.C.
References columns, oofem::FloatArray::giveSize(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, OOFEM_ERROR, oofem::FloatArray::resize(), rowind, and oofem::FloatArray::zero().
|
overridevirtual |
Zeroes the receiver.
Implements oofem::SparseMtrx.
Definition at line 277 of file dyncompcol.C.
References column(), columns, and oofem::SparseMtrx::version.
|
protected |
Definition at line 63 of file dyncompcol.h.
Referenced by DynCompCol(), DynCompCol(), and operator=().
|
protected |
Definition at line 60 of file dyncompcol.h.
Referenced by assemble(), at(), at(), buildInternalStructure(), column(), DynCompCol(), growTo(), insertRowInColumn(), operator()(), operator()(), operator=(), times(), times(), timesT(), and zero().
|
protected |
Definition at line 61 of file dyncompcol.h.
Referenced by buildInternalStructure(), DynCompCol(), giveRowIndx(), growTo(), insertRowInColumn(), operator=(), printStatistics(), row_ind(), times(), and timesT().