OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
#include <compcol.h>
Public Member Functions | |
CompCol (int n) | |
Constructor. More... | |
CompCol () | |
Constructor. More... | |
CompCol (const CompCol &S) | |
Copy constructor. More... | |
CompCol & | operator= (const CompCol &C) |
Assignment operator. More... | |
virtual | ~CompCol () |
Destructor. More... | |
SparseMtrx * | GiveCopy () const |
Returns a newly allocated copy of receiver. More... | |
virtual void | times (const FloatArray &x, FloatArray &answer) const |
Evaluates . More... | |
virtual void | timesT (const FloatArray &x, FloatArray &answer) const |
Evaluates . More... | |
virtual void | times (double x) |
Multiplies receiver by scalar value. More... | |
virtual int | buildInternalStructure (EngngModel *, int, const UnknownNumberingScheme &s) |
Builds internal structure of receiver. More... | |
virtual int | assemble (const IntArray &loc, const FloatMatrix &mat) |
Assembles sparse matrix from contribution of local elements. More... | |
virtual int | assemble (const IntArray &rloc, const IntArray &cloc, const FloatMatrix &mat) |
Assembles sparse matrix from contribution of local elements. More... | |
virtual bool | canBeFactorized () const |
Determines, whether receiver can be factorized. More... | |
virtual void | zero () |
Zeroes the receiver. More... | |
virtual double & | at (int i, int j) |
Returns coefficient at position (i,j). More... | |
virtual double | at (int i, int j) const |
Returns coefficient at position (i,j). More... | |
virtual void | toFloatMatrix (FloatMatrix &answer) const |
Converts receiving sparse matrix to a dense float matrix. More... | |
virtual void | printYourself () const |
Prints receiver to stdout. Works only for relatively small matrices. More... | |
virtual const char * | giveClassName () const |
virtual SparseMtrxType | giveType () const |
Sparse matrix type identification. More... | |
virtual bool | isAsymmetric () const |
Returns true if asymmetric. More... | |
FloatArray & | giveValues () |
IntArray & | giveRowIndex () |
IntArray & | giveColPtr () |
const int | giveNumberOfNonzeros () |
const double & | val (int i) const |
const int & | row_ind (int i) const |
const int & | col_ptr (int i) const |
int | dim (int i) const |
Public Member Functions inherited from oofem::SparseMtrx | |
SparseMtrx (int n, int m) | |
Constructor, creates (n,m) sparse matrix. More... | |
SparseMtrx () | |
Constructor. More... | |
virtual | ~SparseMtrx () |
Destructor. More... | |
SparseMtrxVersionType | giveVersion () |
Return receiver version. More... | |
void | checkBounds (int i, int j) const |
Checks size of receiver towards requested bounds. More... | |
int | giveNumberOfRows () const |
Returns number of rows of receiver. More... | |
int | giveNumberOfColumns () const |
Returns number of columns of receiver. More... | |
bool | isSquare () const |
Returns nonzero if receiver is square matrix. More... | |
bool | isNotEmpty () const |
Tests for empty matrix. More... | |
virtual void | times (const FloatMatrix &B, FloatMatrix &answer) const |
Evaluates . More... | |
virtual void | timesT (const FloatMatrix &B, FloatMatrix &answer) const |
Evaluates . More... | |
virtual void | add (double x, SparseMtrx &m) |
Adds x * m. More... | |
virtual void | addDiagonal (double x, FloatArray &m) |
Adds x * m (treats m as a diagonal matrix, stored as an array) More... | |
virtual int | buildInternalStructure (EngngModel *eModel, int n, int m, const IntArray &I, const IntArray &J) |
Builds internal structure of receiver based on I and J. More... | |
virtual int | buildInternalStructure (EngngModel *eModel, int di, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s) |
Build internal structure of receiver. More... | |
virtual int | assembleBegin () |
Starts assembling the elements. More... | |
virtual int | assembleEnd () |
Returns when assemble is completed. More... | |
virtual SparseMtrx * | factorized () |
Returns the receiver factorized. More... | |
virtual FloatArray * | backSubstitutionWith (FloatArray &y) const |
Computes the solution of linear system where A is receiver. More... | |
virtual double | computeNorm () const |
Returns the norm of receiver. More... | |
virtual 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). More... | |
virtual void | printStatistics () const |
Prints the receiver statistics (one-line) to stdout. More... | |
virtual void | writeToFile (const char *fname) const |
Helpful for debugging, writes the matrix to given file. More... | |
std::string | errorInfo (const char *func) const |
Error printing helper. More... | |
FloatArray | operator* (const FloatArray &x) const |
IML compatibility, . More... | |
FloatArray | trans_mult (const FloatArray &x) const |
IML compatibility, . More... | |
Protected Member Functions | |
double & | val (int i) |
int & | row_ind (int i) |
int & | col_ptr (int i) |
int | size (int i) const |
int | NumNonzeros () const |
int | base () const |
double | operator() (int i, int j) const |
implements 0-based access More... | |
double & | operator() (int i, int j) |
implements 0-based access More... | |
Protected Attributes | |
FloatArray | val_ |
IntArray | rowind_ |
IntArray | colptr_ |
int | base_ |
int | nz_ |
int | dim_ [2] |
Protected Attributes inherited from oofem::SparseMtrx | |
int | nRows |
Number of rows. More... | |
int | nColumns |
Number of columns. More... | |
SparseMtrxVersionType | version |
Allows to track if receiver changes. More... | |
Additional Inherited Members | |
Public Types inherited from oofem::SparseMtrx | |
typedef long | SparseMtrxVersionType |
oofem::CompCol::CompCol | ( | int | n | ) |
Constructor.
Before any operation an internal profile must be built.
Definition at line 93 of file compcol.C.
References dim_.
oofem::CompCol::CompCol | ( | void | ) |
Constructor.
Before any operation an internal profile must be built.
Definition at line 86 of file compcol.C.
References dim_.
Referenced by GiveCopy().
oofem::CompCol::CompCol | ( | const CompCol & | S | ) |
Copy constructor.
Definition at line 104 of file compcol.C.
References dim_, oofem::SparseMtrx::nColumns, and oofem::SparseMtrx::nRows.
|
inlinevirtual |
|
virtual |
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 257 of file compcol.C.
References colptr_, dim(), oofem::FloatMatrix::giveNumberOfRows(), oofem::IntArray::giveSize(), oofem::SparseMtrx::nRows, OOFEM_ERROR, rowind_, val_, and oofem::SparseMtrx::version.
|
virtual |
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 300 of file compcol.C.
References colptr_, oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), oofem::SparseMtrx::nRows, OOFEM_ERROR, rowind_, val_, and oofem::SparseMtrx::version.
|
virtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 359 of file compcol.C.
References colptr_, OOFEM_ERROR, rowind_, val_, and oofem::SparseMtrx::version.
|
virtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 375 of file compcol.C.
References colptr_, dim_, OOFEM_ERROR, rowind_, and val_.
|
virtual |
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 175 of file compcol.C.
References colptr_, dim_, oofem::Domain::giveBcs(), oofem::EngngModel::giveDomain(), oofem::Domain::giveElements(), oofem::ActiveBoundaryCondition::giveLocationArrays(), oofem::EngngModel::giveNumberOfDomainEquations(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, nz_, OOFEM_LOG_DEBUG, oofem::IntArray::resize(), oofem::FloatArray::resize(), rowind_, val_, oofem::SparseMtrx::version, and oofem::FloatArray::zero().
|
inlinevirtual |
Determines, whether receiver can be factorized.
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
|
inline |
Definition at line 140 of file compcol.h.
Referenced by oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
inline |
Definition at line 141 of file compcol.h.
Referenced by assemble(), oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
inlinevirtual |
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
|
inline |
Definition at line 133 of file compcol.h.
Referenced by oofem::MKLPardisoSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), and oofem::SuperLUSolver::solve().
|
virtual |
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.
Definition at line 139 of file compcol.C.
References CompCol().
|
inline |
Definition at line 136 of file compcol.h.
Referenced by oofem::SuperLUSolver::solve().
|
inline |
Definition at line 132 of file compcol.h.
Referenced by oofem::MKLPardisoSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), and oofem::SuperLUSolver::solve().
|
inlinevirtual |
Sparse matrix type identification.
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 127 of file compcol.h.
References oofem::SMT_CompCol.
|
inline |
Definition at line 131 of file compcol.h.
Referenced by oofem::MKLPardisoSolver::solve(), oofem::PardisoProjectOrgSolver::solve(), and oofem::SuperLUSolver::solve().
|
inlinevirtual |
|
protected |
|
protected |
implements 0-based access
Definition at line 407 of file compcol.C.
References colptr_, OOFEM_ERROR, rowind_, val_, and oofem::SparseMtrx::version.
Assignment operator.
Definition at line 120 of file compcol.C.
References base_, colptr_, dim_, oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, nz_, rowind_, val_, and oofem::SparseMtrx::version.
|
virtual |
Prints receiver to stdout. Works only for relatively small matrices.
Reimplemented from oofem::SparseMtrx.
|
inline |
Definition at line 139 of file compcol.h.
Referenced by oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
virtual |
Evaluates .
x | Array to be multiplied with receiver. |
answer | y. |
Reimplemented from oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 146 of file compcol.C.
References colptr_, dim_, oofem::FloatArray::giveSize(), N, OOFEM_ERROR, oofem::FloatArray::resize(), rowind_, val_, and oofem::FloatArray::zero().
|
virtual |
Multiplies receiver by scalar value.
x | Value to multiply receiver. |
Reimplemented from oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 167 of file compcol.C.
References oofem::FloatArray::times(), val_, and oofem::SparseMtrx::version.
|
virtual |
Evaluates .
x | Array to be multiplied with transpose of the receiver. |
answer | y. |
Reimplemented from oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 422 of file compcol.C.
References colptr_, dim_, oofem::FloatArray::giveSize(), N, OOFEM_ERROR, oofem::FloatArray::resize(), rowind_, val_, and oofem::FloatArray::zero().
|
virtual |
Converts receiving sparse matrix to a dense float matrix.
Reimplemented from oofem::SparseMtrx.
|
inline |
Definition at line 138 of file compcol.h.
Referenced by oofem::CompCol_ICPreconditioner::initialize(), and oofem::CompCol_ILUPreconditioner::initialize().
|
virtual |
Zeroes the receiver.
Implements oofem::SparseMtrx.
Reimplemented in oofem::SymCompCol.
Definition at line 340 of file compcol.C.
References val_, oofem::SparseMtrx::version, and oofem::FloatArray::zero().
|
protected |
Definition at line 92 of file compcol.h.
Referenced by operator=().
|
protected |
Definition at line 90 of file compcol.h.
Referenced by oofem::SymCompCol::assemble(), assemble(), oofem::SymCompCol::at(), at(), oofem::SymCompCol::buildInternalStructure(), buildInternalStructure(), oofem::SymCompCol::operator()(), operator()(), operator=(), oofem::SymCompCol::times(), times(), and timesT().
|
protected |
Definition at line 94 of file compcol.h.
Referenced by oofem::SymCompCol::at(), at(), oofem::SymCompCol::buildInternalStructure(), buildInternalStructure(), CompCol(), oofem::SymCompCol::operator()(), operator()(), operator=(), oofem::SymCompCol::times(), times(), and timesT().
|
protected |
Definition at line 93 of file compcol.h.
Referenced by oofem::SymCompCol::buildInternalStructure(), buildInternalStructure(), and operator=().
|
protected |
Definition at line 89 of file compcol.h.
Referenced by oofem::SymCompCol::assemble(), assemble(), oofem::SymCompCol::at(), at(), oofem::SymCompCol::buildInternalStructure(), buildInternalStructure(), oofem::SymCompCol::operator()(), operator()(), operator=(), oofem::SymCompCol::times(), times(), and timesT().
|
protected |
Definition at line 88 of file compcol.h.
Referenced by oofem::SymCompCol::assemble(), assemble(), oofem::SymCompCol::at(), at(), oofem::SymCompCol::buildInternalStructure(), buildInternalStructure(), oofem::SymCompCol::operator()(), operator()(), operator=(), oofem::SymCompCol::times(), times(), timesT(), oofem::SymCompCol::zero(), and zero().