|
OOFEM 3.0
|
#include <skyline.h>
Public Member Functions | |
| Skyline (int n=0) | |
| Skyline (const Skyline &s) | |
| Skyline (int n, FloatArray mtrx, IntArray adr) | |
| virtual | ~Skyline () |
| 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 |
| void | add (double x, SparseMtrx &m) override |
| int | buildInternalStructure (EngngModel *, int, const UnknownNumberingScheme &) override |
| std::unique_ptr< SparseMtrx > | giveSubMatrix (const IntArray &rows, const IntArray &cols) override |
| int | setInternalStructure (IntArray a) |
| 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. | |
| SparseMtrx * | factorized () override |
| FloatArray * | backSubstitutionWith (FloatArray &) const override |
| void | zero () override |
| Zeroes the receiver. | |
| void | rbmodes (FloatMatrix &r, int &nse, IntArray &se, double limit, int tc) |
| void | ldl_feti_sky (FloatArray &x, FloatArray &y, int nse, double limit, IntArray &se) |
| double & | at (int, int) override |
| Returns coefficient at position (i,j). | |
| double | at (int i, int j) const override |
| Returns coefficient at position (i,j). | |
| bool | isAllocatedAt (int i, int j) const override |
| Checks whether memory is allocated at position (i,j). | |
| int | giveNumberOfNonZeros () const |
| 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. | |
| void | writeToFile (const char *fname) const override |
| Helpful for debugging, writes the matrix to given file. | |
| int | giveAllocatedSize () |
| SparseMtrxType | giveType () const override |
| Sparse matrix type identification. | |
| bool | isAsymmetric () const override |
| Returns true if asymmetric. | |
| const char * | giveClassName () const override |
| 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 | 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 double | computeNorm () const |
| Returns the norm of receiver. | |
| virtual void | printStatistics () const |
| Prints the receiver statistics (one-line) to stdout. | |
| 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 Attributes | |
| FloatArray | mtrx |
| Vector of stored coefficients. | |
| IntArray | adr |
| Integer array holding addresses of diagonal members. | |
| int | isFactorized |
| Flag indicating whether factorized. | |
| 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 |
Class implementing sparse matrix stored in skyline form. This class assumes symmetric form of matrix to be stored, i.e., only upper half part is therefore stored. Coefficients are stored in one dimensional float array, containing for each column the values from the diagonal to the last nonzero entry. This requires to remember the addresses of diagonal members in such array (adr attribute)
Attribute 'isFactorized' is True if the skyline is already in U(T).D.U factorized form, else it is False. Attribute adr is array of diagonal members, it's size is size+1 (adr[0]=neni, adr[1]=1) Attribute mtrx is matrix values to skyline stored in a array form (but we start from index 1)
Tasks:
| oofem::Skyline::Skyline | ( | int | n = 0 | ) |
Constructor. Before any operation an internal profile must be built.
Definition at line 62 of file skyline.C.
References isFactorized, and oofem::SparseMtrx::SparseMtrx().
| oofem::Skyline::Skyline | ( | const Skyline & | s | ) |
Definition at line 68 of file skyline.C.
References adr, oofem::SparseMtrx::giveNumberOfColumns(), oofem::SparseMtrx::giveNumberOfRows(), isFactorized, mtrx, Skyline(), and oofem::SparseMtrx::SparseMtrx().
| oofem::Skyline::Skyline | ( | int | n, |
| FloatArray | mtrx, | ||
| IntArray | adr ) |
Definition at line 75 of file skyline.C.
References adr, isFactorized, mtrx, and oofem::SparseMtrx::SparseMtrx().
|
inlinevirtual |
|
overridevirtual |
Adds x * m.
| x | Value to multiply m by. |
| m | Matrix to add (should of the same matrix type). |
Reimplemented from oofem::SparseMtrx.
Definition at line 550 of file skyline.C.
References mtrx, Skyline(), oofem::SparseMtrx::SparseMtrx(), 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 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 189 of file skyline.C.
References adr, oofem::FloatMatrix::at(), oofem::IntArray::at(), oofem::FloatMatrix::giveNumberOfRows(), oofem::IntArray::giveSize(), mtrx, 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 226 of file skyline.C.
References oofem::FloatMatrix::at(), oofem::IntArray::at(), at(), oofem::FloatMatrix::giveNumberOfColumns(), oofem::FloatMatrix::giveNumberOfRows(), and oofem::SparseMtrx::version.
|
overridevirtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Definition at line 122 of file skyline.C.
References adr, oofem::SparseMtrx::giveNumberOfRows(), mtrx, and OOFEM_ERROR.
|
overridevirtual |
Returns coefficient at position (i,j).
Implements oofem::SparseMtrx.
Definition at line 89 of file skyline.C.
References adr, oofem::SparseMtrx::giveNumberOfRows(), mtrx, OOFEM_ERROR, and oofem::SparseMtrx::version.
Referenced by assemble(), and giveSubMatrix().
|
overridevirtual |
Computes the solution of linear system \( A\cdot x = y \) where A is receiver. Solution vector x overwrites the right hand side vector y. Receiver must be in factorized form.
| y | Right hand side on input, solution on output. |
Reimplemented from oofem::SparseMtrx.
Definition at line 248 of file skyline.C.
References adr, oofem::FloatArray::at(), oofem::SparseMtrx::giveNumberOfRows(), oofem::FloatArray::giveSize(), and mtrx.
|
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 306 of file skyline.C.
References adr, oofem::IntArray::at(), oofem::Domain::giveBcs(), oofem::EngngModel::giveDomain(), oofem::Domain::giveElement(), oofem::Domain::giveElements(), oofem::ActiveBoundaryCondition::giveLocationArrays(), oofem::EngngModel::giveNumberOfDomainEquations(), oofem::UnknownNumberingScheme::giveRequiredNumberOfDomainEquation(), oofem::UnknownNumberingScheme::isDefault(), oofem::min(), mtrx, oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, and oofem::SparseMtrx::version.
|
inlineoverridevirtual |
Determines, whether receiver can be factorized.
Implements oofem::SparseMtrx.
|
overridevirtual |
Returns a newly allocated copy of receiver. Programmer must take care about proper deallocation of allocated space.
Reimplemented from oofem::SparseMtrx.
|
overridevirtual |
Returns the receiver factorized. \( L^{\mathrm{T}} \cdot D \cdot L \) form is used.
Reimplemented from oofem::SparseMtrx.
Definition at line 429 of file skyline.C.
References adr, oofem::Timer::getUtime(), giveNumberOfNonZeros(), oofem::SparseMtrx::giveNumberOfRows(), isFactorized, mtrx, OOFEM_LOG_DEBUG, oofem::SparseMtrx::SparseMtrx(), oofem::Timer::startTimer(), and oofem::Timer::stopTimer().
|
inline |
Definition at line 142 of file skyline.h.
References oofem::FloatArray::giveSize().
|
inlineoverridevirtual |
Implements oofem::SparseMtrx.
|
inline |
Definition at line 138 of file skyline.h.
References oofem::FloatArray::giveSize().
Referenced by factorized(), giveSubMatrix(), and rbmodes().
|
overridevirtual |
Reimplemented from oofem::SparseMtrx.
Definition at line 593 of file skyline.C.
References oofem::FloatArray::at(), oofem::IntArray::at(), at(), giveNumberOfNonZeros(), oofem::IntArray::giveSize(), and isAllocatedAt().
|
inlineoverridevirtual |
Sparse matrix type identification.
Implements oofem::SparseMtrx.
Definition at line 144 of file skyline.h.
References oofem::SMT_Skyline.
|
overridevirtual |
Checks whether memory is allocated at position (i,j).
Reimplemented from oofem::SparseMtrx.
Definition at line 148 of file skyline.C.
References adr.
Referenced by giveSubMatrix().
|
inlineoverridevirtual |
| void oofem::Skyline::ldl_feti_sky | ( | FloatArray & | x, |
| FloatArray & | y, | ||
| int | nse, | ||
| double | limit, | ||
| IntArray & | se ) |
Solves the singular system of equations, the receiver should be factorized using rbmodes service.
| x | solution vector |
| y | right hand side |
| nse | number of rigid body motions |
| limit | determines the linear dependence or independence |
| se | indexes of singular equations |
Definition at line 775 of file skyline.C.
References adr, oofem::FloatArray::at(), oofem::IntArray::at(), oofem::SparseMtrx::giveNumberOfRows(), and mtrx.
Referenced by oofem::FETISolver::solve().
|
overridevirtual |
Prints receiver to stdout. Works only for relatively small matrices.
Reimplemented from oofem::SparseMtrx.
Definition at line 560 of file skyline.C.
References oofem::FloatMatrix::printYourself(), and toFloatMatrix().
| void oofem::Skyline::rbmodes | ( | FloatMatrix & | r, |
| int & | nse, | ||
| IntArray & | se, | ||
| double | limit, | ||
| int | tc ) |
Splits the receiver to LDLT form, and computes the rigid body motions.
| r | matrix containing the rigid body motions base vectors. |
| nse | number of rigid body motions |
| se | array containing indexes of singular eqs. |
| limit | determines linear dependence or independence |
| tc | type of calculation = 1 = Decomposition to LDL form = 2 = ? konstruovani baze prostoru ? Ker A = 3 = Decomposition to LDL form and ? konstruovani baze prostoru ? Ker A |
Definition at line 634 of file skyline.C.
References adr, oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::IntArray::at(), oofem::FloatMatrix::clear(), giveNumberOfNonZeros(), oofem::SparseMtrx::giveNumberOfRows(), mtrx, OOFEM_LOG_INFO, oofem::FloatMatrix::resize(), and oofem::FloatMatrix::zero().
Referenced by oofem::FETISolver::solve().
| int oofem::Skyline::setInternalStructure | ( | IntArray | a | ) |
Allocates and builds internal structure according to given array holding addresses of diagonal members values (adr).
Definition at line 292 of file skyline.C.
References adr, mtrx, oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, and oofem::SparseMtrx::version.
|
overridevirtual |
Evaluates \( y = A \cdot x \)
| x | Array to be multiplied with receiver. |
| answer | y. |
Reimplemented from oofem::SparseMtrx.
Definition at line 500 of file skyline.C.
References adr, oofem::FloatArray::at(), oofem::SparseMtrx::giveNumberOfRows(), oofem::FloatArray::giveSize(), mtrx, OOFEM_ERROR, oofem::FloatArray::resize(), and oofem::FloatArray::zero().
Referenced by timesT().
|
overridevirtual |
Multiplies receiver by scalar value.
| x | Value to multiply receiver. |
Reimplemented from oofem::SparseMtrx.
Definition at line 541 of file skyline.C.
References mtrx, 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::SparseMtrx.
Definition at line 92 of file skyline.h.
References times().
|
overridevirtual |
Converts receiving sparse matrix to a dense float matrix.
Reimplemented from oofem::SparseMtrx.
Definition at line 163 of file skyline.C.
References adr, oofem::FloatMatrix::at(), oofem::SparseMtrx::giveNumberOfColumns(), mtrx, OOFEM_ERROR, oofem::FloatMatrix::resize(), oofem::FloatMatrix::symmetrized(), and oofem::FloatMatrix::zero().
Referenced by printYourself(), and writeToFile().
|
overridevirtual |
Helpful for debugging, writes the matrix to given file.
Reimplemented from oofem::SparseMtrx.
Definition at line 569 of file skyline.C.
References oofem::FloatMatrix::at(), oofem::SparseMtrx::nColumns, oofem::SparseMtrx::nRows, and toFloatMatrix().
|
overridevirtual |
Zeroes the receiver.
Implements oofem::SparseMtrx.
Definition at line 584 of file skyline.C.
References isFactorized, mtrx, and oofem::SparseMtrx::version.
|
protected |
Integer array holding addresses of diagonal members.
Definition at line 74 of file skyline.h.
Referenced by assemble(), at(), at(), backSubstitutionWith(), buildInternalStructure(), factorized(), isAllocatedAt(), ldl_feti_sky(), rbmodes(), setInternalStructure(), Skyline(), Skyline(), times(), and toFloatMatrix().
|
protected |
|
protected |
Vector of stored coefficients.
Definition at line 72 of file skyline.h.
Referenced by add(), assemble(), at(), at(), backSubstitutionWith(), buildInternalStructure(), factorized(), ldl_feti_sky(), rbmodes(), setInternalStructure(), Skyline(), Skyline(), times(), times(), toFloatMatrix(), and zero().