|
OOFEM 3.0
|
#include <compcol.h>
Public Member Functions | |
| CompCol (int n=0) | |
| CompCol (const CompCol &S) | |
| Copy constructor. | |
| CompCol & | operator= (const CompCol &C) |
| Assignment operator. | |
| virtual | ~CompCol () |
| 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 &s) 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). | |
| 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. | |
| const char * | giveClassName () const override |
| SparseMtrxType | giveType () const override |
| Sparse matrix type identification. | |
| bool | isAsymmetric () const override |
| Returns true if asymmetric. | |
| 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 Attributes | |
| 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 |
Additional Inherited Members | |
| Public Types inherited from oofem::SparseMtrx | |
| typedef long | SparseMtrxVersionType |
Implementation of sparse matrix stored in compressed column storage.
| oofem::CompCol::CompCol | ( | int | n = 0 | ) |
Constructor. Before any operation an internal profile must be built.
Definition at line 88 of file compcol.C.
References base, colptr, nz, rowind, oofem::SparseMtrx::SparseMtrx(), and val.
Referenced by CompCol(), operator=(), oofem::SymCompCol::SymCompCol(), and oofem::SymCompCol::SymCompCol().
| oofem::CompCol::CompCol | ( | const CompCol & | S | ) |
Copy constructor.
Definition at line 97 of file compcol.C.
References base, colptr, CompCol(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, nz, rowind, S, oofem::SparseMtrx::SparseMtrx(), and val.
|
inlinevirtual |
|
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.
Reimplemented in oofem::SymCompCol.
Definition at line 275 of file compcol.C.
References colptr, oofem::FloatMatrix::giveNumberOfRows(), oofem::IntArray::giveSize(), oofem::SparseMtrx::nRows, OOFEM_ERROR, rowind, 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. |
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 318 of file compcol.C.
References colptr, oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), oofem::SparseMtrx::nRows, OOFEM_ERROR, rowind, val, and oofem::SparseMtrx::version.
|
overridevirtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 386 of file compcol.C.
References colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), OOFEM_ERROR, rowind, and val.
|
overridevirtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 372 of file compcol.C.
References colptr, OOFEM_ERROR, rowind, 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. |
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 174 of file compcol.C.
References 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, nz, OOFEM_LOG_DEBUG, rowind, val, and oofem::SparseMtrx::version.
|
inlineoverridevirtual |
Determines, whether receiver can be factorized.
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
|
overridevirtual |
Returns a newly allocated copy of receiver. Programmer must take care about proper deallocation of allocated space.
Reimplemented from oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
|
inline |
Definition at line 135 of file compcol.h.
References colptr.
Referenced by oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
inlineoverridevirtual |
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
|
inline |
Definition at line 128 of file compcol.h.
References colptr.
Referenced by oofem::MKLPardisoSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), and oofem::SuperLUSolver::solve().
|
inline |
Definition at line 131 of file compcol.h.
References nz.
Referenced by oofem::SuperLUSolver::solve().
|
inline |
Definition at line 127 of file compcol.h.
References rowind.
Referenced by oofem::MKLPardisoSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), and oofem::SuperLUSolver::solve().
|
inlineoverridevirtual |
Sparse matrix type identification.
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 122 of file compcol.h.
References oofem::SMT_CompCol.
|
inline |
Definition at line 126 of file compcol.h.
References val.
Referenced by oofem::MKLPardisoSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), and oofem::SuperLUSolver::solve().
|
inlineoverridevirtual |
|
protected |
implements 0-based access
Definition at line 418 of file compcol.C.
References colptr, OOFEM_ERROR, rowind, val, and oofem::SparseMtrx::version.
|
protected |
implements 0-based access
Definition at line 402 of file compcol.C.
References colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), OOFEM_ERROR, rowind, and val.
Assignment operator.
Definition at line 106 of file compcol.C.
References base, colptr, CompCol(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, nz, rowind, val, and oofem::SparseMtrx::version.
|
overridevirtual |
Prints receiver to stdout. Works only for relatively small matrices.
Reimplemented from oofem::SparseMtrx.
|
inline |
Definition at line 134 of file compcol.h.
References rowind.
Referenced by oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
overridevirtual |
Evaluates \( y = A \cdot x \)
| x | Array to be multiplied with receiver. |
| answer | y. |
Reimplemented from oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 128 of file compcol.C.
References colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), oofem::FloatArray::giveSize(), OOFEM_ERROR, oofem::FloatArray::resize(), rowind, val, and oofem::FloatArray::zero().
|
overridevirtual |
Multiplies receiver by scalar value.
| x | Value to multiply receiver. |
Reimplemented from oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 166 of file compcol.C.
References val, 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.
Reimplemented in oofem::SymCompCol.
Definition at line 146 of file compcol.C.
References colptr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::FloatArray::giveSize(), OOFEM_ERROR, oofem::FloatArray::resize(), rowind, val, and oofem::FloatArray::zero().
|
overridevirtual |
Converts receiving sparse matrix to a dense float matrix.
Reimplemented from oofem::SparseMtrx.
|
inline |
Definition at line 133 of file compcol.h.
References val.
Referenced by oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
overridevirtual |
Zeroes the receiver.
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 357 of file compcol.C.
References val, and oofem::SparseMtrx::version.
|
protected |
Definition at line 92 of file compcol.h.
Referenced by CompCol(), CompCol(), and operator=().
|
protected |
Definition at line 90 of file compcol.h.
Referenced by assemble(), assemble(), oofem::SymCompCol::assemble(), oofem::SymCompCol::assemble(), at(), at(), oofem::SymCompCol::at(), oofem::SymCompCol::at(), buildInternalStructure(), oofem::SymCompCol::buildInternalStructure(), col_ptr(), CompCol(), CompCol(), giveColPtr(), operator()(), operator()(), oofem::SymCompCol::operator()(), oofem::SymCompCol::operator()(), operator=(), times(), oofem::SymCompCol::times(), and timesT().
|
protected |
Definition at line 93 of file compcol.h.
Referenced by buildInternalStructure(), oofem::SymCompCol::buildInternalStructure(), CompCol(), CompCol(), giveNumberOfNonzeros(), and operator=().
|
protected |
Definition at line 89 of file compcol.h.
Referenced by assemble(), assemble(), oofem::SymCompCol::assemble(), oofem::SymCompCol::assemble(), at(), at(), oofem::SymCompCol::at(), oofem::SymCompCol::at(), buildInternalStructure(), oofem::SymCompCol::buildInternalStructure(), CompCol(), CompCol(), giveRowIndex(), operator()(), operator()(), oofem::SymCompCol::operator()(), oofem::SymCompCol::operator()(), operator=(), row_ind(), times(), oofem::SymCompCol::times(), and timesT().
|
protected |
Definition at line 88 of file compcol.h.
Referenced by assemble(), assemble(), oofem::SymCompCol::assemble(), oofem::SymCompCol::assemble(), at(), at(), oofem::SymCompCol::at(), oofem::SymCompCol::at(), buildInternalStructure(), oofem::SymCompCol::buildInternalStructure(), CompCol(), CompCol(), giveValues(), operator()(), operator()(), oofem::SymCompCol::operator()(), oofem::SymCompCol::operator()(), operator=(), times(), times(), oofem::SymCompCol::times(), oofem::SymCompCol::times(), timesT(), values(), zero(), and oofem::SymCompCol::zero().