NeoPZ
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
TPZBlockDiagonal< TVar > Class Template Reference

Defines block diagonal matrices. Matrix. More...

#include <pzblockdiag.h>

Inheritance diagram for TPZBlockDiagonal< TVar >:
[legend]
Collaboration diagram for TPZBlockDiagonal< TVar >:
[legend]

Public Member Functions

 TPZBlockDiagonal ()
 Simple constructor. More...
 
 TPZBlockDiagonal (const TPZVec< int > &blocksizes, const TPZFMatrix< TVar > &glob)
 Constructor with initialization parameters. More...
 
 TPZBlockDiagonal (const TPZVec< int > &blocksizes)
 Constructor with initialization parameters. More...
 
 TPZBlockDiagonal (const TPZBlockDiagonal &)
 Copy constructor. More...
 
 ~TPZBlockDiagonal ()
 Simple destructor. More...
 
int Put (const int64_t row, const int64_t col, const TVar &value) override
 Put values with bounds checking if DEBUG variable is defined. More...
 
const TVar & Get (const int64_t row, const int64_t col) const override
 Get value with bound checking. More...
 
TVar & operator() (const int64_t row, const int64_t col)
 
virtual TVar & s (const int64_t row, const int64_t col) override
 The operators check on the bounds if the DEBUG variable is defined. More...
 
int PutVal (const int64_t row, const int64_t col, const TVar &value) override
 This method don't make verification if the element exist. It is fast than Put. More...
 
const TVar & GetVal (const int64_t row, const int64_t col) const override
 This method don't make verification if the element exist. It is fast than Get. More...
 
void MultAdd (const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha=1., const TVar beta=0., const int opt=0) const override
 Computes z = alpha * opt(this)*x + beta * y. More...
 
int64_t Dim () const override
 Returns the dimension of the matrix if the matrix is square. More...
 
int Zero () override
 Zeroes all the elements of the matrix. More...
 
int GetSizeofBlock (int64_t blockid)
 Return the choosen block size. More...
 
void Transpose (TPZMatrix< TVar > *const T) const override
 It makes *T the transpose of current matrix. More...
 
virtual int Decompose_LU () override
 
virtual int Decompose_LU (std::list< int64_t > &singular) override
 Decomposes the current matrix using LU decomposition. More...
 
virtual int Substitution (TPZFMatrix< TVar > *B) const override
 Makes the backward and forward substitutions whether the matrix was LU decomposed. More...
 
virtual void UpdateFrom (TPZAutoPointer< TPZMatrix< TVar > > mat) override
 Updates the values of the matrix based on the values of the matrix. More...
 
void AutoFill (int64_t dim, int64_t dimj, int symmetric)
 
void Initialize (const TPZVec< int > &blocksize)
 Initializes current matrix based on blocksize. More...
 
void AddBlock (int64_t i, TPZFMatrix< TVar > &block)
 Adds a block to current matrix. More...
 
void SetBlock (int64_t i, TPZFMatrix< TVar > &block)
 Sets a block in the current matrix. More...
 
void GetBlock (int64_t i, TPZFMatrix< TVar > &block)
 Gets a block from current matrix. More...
 
void BuildFromMatrix (TPZMatrix< TVar > &matrix)
 Builds a block from matrix. More...
 
virtual void Print (const char *message, std::ostream &out=std::cout, const MatrixOutputFormat format=EFormatted) const override
 Prints current matrix data. More...
 
int64_t NumberofBlocks ()
 
int ClassId () const override
 Define the class id associated with the class. More...
 
- Public Member Functions inherited from TPZMatrix< TVar >
 TPZMatrix ()
 Simple constructor. More...
 
 TPZMatrix (const TPZMatrix< TVar > &cp)
 
virtual ~TPZMatrix ()
 Simple destructor. More...
 
virtual TPZMatrix< TVar > * Clone () const =0
 
virtual int64_t MemoryFootprint () const
 Returns the approximate size of the memory footprint (amount of memory required to store this object). More...
 
template<class TVar2 >
void CopyFrom (TPZMatrix< TVar2 > &copy)
 
void AutoFill (int64_t nrow, int64_t ncol, int symmetric)
 Fill matrix storage with randomic values. More...
 
virtual int VerifySymmetry (REAL tol=1.e-13) const
 Checks if current matrix value is symmetric. More...
 
const TVar & g (const int64_t row, const int64_t col) const
 Substitution for the () operator when const arguments are needed. More...
 
TVar & operator() (const int64_t row, const int64_t col)
 The operators check on the bounds if the DEBUG variable is defined. More...
 
TVar & operator() (const int64_t row)
 The operators check on the bounds if the DEBUG variable is defined. More...
 
virtual void AddKel (TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &destinationindex)
 Add a contribution of a stiffness matrix. More...
 
virtual void AddKel (TPZFMatrix< TVar > &elmat, TPZVec< int64_t > &sourceindex, TPZVec< int64_t > &destinationindex)
 Add a contribution of a stiffness matrix. More...
 
void SetIsDecomposed (int val)
 Sets current matrix to decomposed state. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) override
 Compare the object for identity with the object pointed to, eventually copy the object. More...
 
virtual bool Compare (TPZSavable *copy, bool override=false) const override
 Compare the object for identity with the object pointed to, eventually copy the object. More...
 
virtual void GetSub (const TPZVec< int64_t > &indices, TPZFMatrix< TVar > &block) const
 Extract the block indicated by the indices from the matrix. More...
 
bool CompareValues (TPZMatrix< TVar > &M, TVar tol)
 Compare values of this to B, with a precision tolerance tol. More...
 
template<>
void Print (const char *name, std::ostream &out, const MatrixOutputFormat form) const
 
template<>
void Print (const char *name, std::ostream &out, const MatrixOutputFormat form) const
 
template<>
void Print (const char *name, std::ostream &out, const MatrixOutputFormat form) const
 
template<>
void SolveCG (int64_t &numiterations, TPZSolver< std::complex< float > > &preconditioner, const TPZFMatrix< std::complex< float > > &F, TPZFMatrix< std::complex< float > > &result, TPZFMatrix< std::complex< float > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveCG (int64_t &numiterations, TPZSolver< std::complex< double > > &preconditioner, const TPZFMatrix< std::complex< double > > &F, TPZFMatrix< std::complex< double > > &result, TPZFMatrix< std::complex< double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveCG (int64_t &numiterations, TPZSolver< std::complex< long double > > &preconditioner, const TPZFMatrix< std::complex< long double > > &F, TPZFMatrix< std::complex< long double > > &result, TPZFMatrix< std::complex< long double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveGMRES (int64_t &numiterations, TPZSolver< std::complex< float > > &preconditioner, TPZFMatrix< std::complex< float > > &H, int &numvectors, const TPZFMatrix< std::complex< float > > &F, TPZFMatrix< std::complex< float > > &result, TPZFMatrix< std::complex< float > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveGMRES (int64_t &numiterations, TPZSolver< std::complex< double > > &preconditioner, TPZFMatrix< std::complex< double > > &H, int &numvectors, const TPZFMatrix< std::complex< double > > &F, TPZFMatrix< std::complex< double > > &result, TPZFMatrix< std::complex< double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveGMRES (int64_t &numiterations, TPZSolver< std::complex< long double > > &preconditioner, TPZFMatrix< std::complex< long double > > &H, int &numvectors, const TPZFMatrix< std::complex< long double > > &F, TPZFMatrix< std::complex< long double > > &result, TPZFMatrix< std::complex< long double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveBICG (int64_t &numiterations, TPZSolver< std::complex< float > > &preconditioner, const TPZFMatrix< std::complex< float > > &F, TPZFMatrix< std::complex< float > > &result, REAL &tol)
 
template<>
void SolveBICG (int64_t &numiterations, TPZSolver< std::complex< double > > &preconditioner, const TPZFMatrix< std::complex< double > > &F, TPZFMatrix< std::complex< double > > &result, REAL &tol)
 
template<>
void SolveBICG (int64_t &numiterations, TPZSolver< std::complex< long double > > &preconditioner, const TPZFMatrix< std::complex< long double > > &F, TPZFMatrix< std::complex< long double > > &result, REAL &tol)
 
template<>
void SolveBICGStab (int64_t &numiterations, TPZSolver< std::complex< float > > &preconditioner, const TPZFMatrix< std::complex< float > > &F, TPZFMatrix< std::complex< float > > &result, TPZFMatrix< std::complex< float > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveBICGStab (int64_t &numiterations, TPZSolver< std::complex< double > > &preconditioner, const TPZFMatrix< std::complex< double > > &F, TPZFMatrix< std::complex< double > > &result, TPZFMatrix< std::complex< double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveBICGStab (int64_t &numiterations, TPZSolver< std::complex< long double > > &preconditioner, const TPZFMatrix< std::complex< long double > > &F, TPZFMatrix< std::complex< long double > > &result, TPZFMatrix< std::complex< long double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveIR (int64_t &numiterations, TPZSolver< std::complex< float > > &preconditioner, const TPZFMatrix< std::complex< float > > &F, TPZFMatrix< std::complex< float > > &result, TPZFMatrix< std::complex< float > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveIR (int64_t &numiterations, TPZSolver< std::complex< double > > &preconditioner, const TPZFMatrix< std::complex< double > > &F, TPZFMatrix< std::complex< double > > &result, TPZFMatrix< std::complex< double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
void SolveIR (int64_t &numiterations, TPZSolver< std::complex< long double > > &preconditioner, const TPZFMatrix< std::complex< long double > > &F, TPZFMatrix< std::complex< long double > > &result, TPZFMatrix< std::complex< long double > > *residual, REAL &tol, const int FromCurrent)
 
template<>
bool SolveEigenvaluesJacobi (int64_t &numiterations, REAL &tol, TPZVec< std::complex< float > > *Sort)
 
template<>
bool SolveEigenvaluesJacobi (int64_t &numiterations, REAL &tol, TPZVec< std::complex< double > > *Sort)
 
template<>
bool SolveEigenvaluesJacobi (int64_t &numiterations, REAL &tol, TPZVec< std::complex< long double > > *Sort)
 
virtual void Multiply (const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &res, int opt=0) const
 It mutiplies itself by TPZMatrix<TVar>A putting the result in res. More...
 
virtual void Add (const TPZMatrix< TVar > &A, TPZMatrix< TVar > &res) const
 It adds itself to TPZMatrix<TVar>A putting the result in res. More...
 
virtual void Residual (const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &rhs, TPZFMatrix< TVar > &res)
 Computes res = rhs - this * x. More...
 
virtual void Substract (const TPZMatrix< TVar > &A, TPZMatrix< TVar > &result) const
 It substracts A from storing the result in result. More...
 
virtual void Identity ()
 Converts the matrix in an identity matrix. More...
 
int Inverse (TPZFMatrix< TVar > &Inv, DecomposeType dec)
 It makes Inv =[this]. IMPORTANT OBSERVATION –> The original matrix (calling object) no is more equal. It containts the some decomposition (LU or Cholesky or ...) More...
 
TVar MatrixNorm (int p, int64_t numiter=2000000, REAL tol=1.e-10) const
 Computes the matrix norm of this. More...
 
TVar ConditionNumber (int p, int64_t numiter=2000000, REAL tol=1.e-10)
 Computes the matrix condition number of this. More...
 
virtual int PutSub (const int64_t sRow, const int64_t sCol, const TPZFMatrix< TVar > &Source)
 It puts submatrix Source on actual matrix structure. More...
 
virtual int GetSub (const int64_t sRow, const int64_t sCol, const int64_t rowSize, const int64_t colSize, TPZFMatrix< TVar > &Target) const
 Gets submatrix storing it on Target. More...
 
virtual int AddSub (const int64_t sRow, const int64_t sCol, const TPZFMatrix< TVar > &Source)
 It adds Source matrix on current matrix from position (sRow, sCol) More...
 
virtual int InsertSub (const int64_t sRow, const int64_t sCol, const int64_t rowSize, const int64_t colSize, const int64_t pRow, const int64_t pCol, TPZMatrix< TVar > *Target) const
 Inserts a submatrix from current object on matrix *Target with no
redimentioning. More...
 
virtual int AddSub (const int64_t sRow, const int64_t sCol, const int64_t rowSize, const int64_t colSize, const int64_t pRow, const int64_t pCol, TPZMatrix< TVar > *pA) const
 Adds a submatrix from current object in *Target. More...
 
virtual int IsSimetric () const
 Checks if the current matrix is symmetric. More...
 
int IsSquare () const
 Checks if current matrix is square. More...
 
virtual void Simetrize ()
 Simetrizes copies upper plan to the lower plan, making its data simetric. More...
 
virtual int IsDefPositive () const
 Checks if current matrix is definite positive. More...
 
int IsDecomposed () const
 Checks if current matrix is already decomposed. More...
 
virtual int Decompose_Cholesky ()
 Decomposes the current matrix using Cholesky method. The current matrix has to be symmetric. More...
 
virtual int Decompose_Cholesky (std::list< int64_t > &singular)
 Decomposes the current matrix using Cholesky method. More...
 
virtual int Decompose_LDLt (std::list< int64_t > &singular)
 Decomposes the current matrix using LDLt.
The current matrix has to be symmetric. "L" is lower triangular with 1.0 in its diagonal and "D" is a Diagonal matrix. More...
 
virtual int Decompose_LDLt ()
 Decomposes the current matrix using LDLt. More...
 
virtual int Subst_Forward (TPZFMatrix< TVar > *b) const
 Computes B = Y, where A*Y = B, A is lower triangular. More...
 
virtual int Subst_Backward (TPZFMatrix< TVar > *b) const
 Computes B = Y, where A*Y = B, A is upper triangular. More...
 
virtual int Subst_LForward (TPZFMatrix< TVar > *b) const
 Computes B = Y, where A*Y = B, A is lower triangular with A(i,i)=1. More...
 
virtual int Subst_LBackward (TPZFMatrix< TVar > *b) const
 Computes B = Y, where A*Y = B, A is upper triangular with A(i,i)=1. More...
 
virtual int Subst_Diag (TPZFMatrix< TVar > *b) const
 Computes B = Y, where A*Y = B, A is diagonal matrix. More...
 
int ClassId () const override
 Define the class id associated with the class. More...
 
void Read (TPZStream &buf, void *context) override
 Unpacks the object structure from a stream of bytes. More...
 
void Write (TPZStream &buf, int withclassid) const override
 Packs the object structure in a stream of bytes. More...
 
virtual void Input (std::istream &in=std::cin)
 Input operation. More...
 
virtual void Print (std::ostream &out) const
 
int64_t Rows () const
 Returns number of rows. More...
 
int64_t Cols () const
 Returns number of cols. More...
 
virtual int Resize (const int64_t newRows, const int64_t newCols)
 Redimensions a matriz keeping the previous values. More...
 
virtual int Redim (const int64_t newRows, const int64_t newCols)
 Redimensions the matrix reinitializing it with zero. More...
 
virtual void SolveJacobi (int64_t &numiterations, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, TPZFMatrix< TVar > &scratch, REAL &tol, const int FromCurrent=0)
 Solves the linear system using Jacobi method.
. More...
 
virtual void SolveSOR (int64_t &numiterations, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, TPZFMatrix< TVar > &scratch, const REAL overrelax, REAL &tol, const int FromCurrent=0, const int direction=1)
 Solves the linear system using Successive Over Relaxation method (Gauss Seidel).
. More...
 
virtual void SolveSSOR (int64_t &numiterations, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, TPZFMatrix< TVar > &scratch, const REAL overrelax, REAL &tol, const int FromCurrent=0)
 Solves the linear system using Symmetric Successive Over Relaxation method (Gauss Seidel).
. More...
 
virtual void SolveCG (int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent=0)
 Solves the linear system using Conjugate Gradient method.
. More...
 
virtual void SolveBICG (int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, REAL &tol)
 Solves the linear system using Bi-Conjugate Gradient method.
. More...
 
virtual void SolveBICGStab (int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent=0)
 Solves the linear system using Bi-Conjugate Gradient stabilized method.
. More...
 
virtual void SolveGMRES (int64_t &numiterations, TPZSolver< TVar > &preconditioner, TPZFMatrix< TVar > &H, int &numvectors, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent)
 Solves the linear system using Generalized Minimal Residual (GMRES) method.
. More...
 
virtual void SolveIR (int64_t &numiterations, TPZSolver< TVar > &preconditioner, const TPZFMatrix< TVar > &F, TPZFMatrix< TVar > &result, TPZFMatrix< TVar > *residual, REAL &tol, const int FromCurrent=0)
 Solves the linear system using IR method.
. More...
 
virtual bool SolveEigenvaluesJacobi (int64_t &numiterations, REAL &tol, TPZVec< TVar > *Sort=0)
 Transforms this matrix in a diagonal matrix, where the diagonal values are its eigenvalues. This method is efficient only for small matrices. More...
 
virtual bool SolveEigensystemJacobi (int64_t &numiterations, REAL &tol, TPZVec< TVar > &Eigenvalues, TPZFMatrix< TVar > &Eigenvectors) const
 Compute Eigenvalues and Eigenvectors of this matrix.
This method is efficient only for small matrices. More...
 
virtual int SolveDirect (TPZFMatrix< TVar > &F, const DecomposeType dt, std::list< int64_t > &singular)
 Solves the linear system using Direct methods. More...
 
virtual int SolveDirect (TPZFMatrix< TVar > &F, const DecomposeType dt)
 Solves the linear system using Direct methods. More...
 
virtual int Decompose (const DecomposeType dt, std::list< int64_t > &singular)
 decompose the system of equations acording to the decomposition scheme More...
 
int Solve_LU (TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
 Solves the linear system using LU method
. More...
 
int Solve_LU (TPZFMatrix< TVar > *B)
 Solves the linear system using LU method
. More...
 
virtual int Solve_Cholesky (TPZFMatrix< TVar > *B)
 Solves the linear system using Cholesky method
. More...
 
int Solve_Cholesky (TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
 Solves the linear system using Cholesky method
. More...
 
int Solve_LDLt (TPZFMatrix< TVar > *B, std::list< int64_t > &singular)
 Solves the linear system using LDLt method
. More...
 
int Solve_LDLt (TPZFMatrix< TVar > *B)
 Solves the linear system using LDLt method
. More...
 
- Public Member Functions inherited from TPZSavable
 TPZSavable ()
 
virtual ~TPZSavable ()
 
virtual std::list< std::map< std::string, uint64_t > > VersionHistory () const
 
virtual std::pair< std::string, uint64_t > Version () const
 
- Public Member Functions inherited from TPZRegisterClassId
template<typename T >
 TPZRegisterClassId (int(T::*)() const)
 
 TPZRegisterClassId ()=default
 

Static Public Member Functions

static int main ()
 This method checks the working of the class. More...
 
- Static Public Member Functions inherited from TPZMatrix< TVar >
static int Error (const char *msg, const char *msg2=0)
 Returns error messages. More...
 
static TVar ReturnNearestValue (TVar val, TPZVec< TVar > &Vec, TVar tol)
 Retorna o valor mais proximo a "val" (exceto valores no intervalo -tol <= val <= +tol) contido no vetor Vec. More...
 
- Static Public Member Functions inherited from TPZSavable
static std::set< TPZRestoreClassBase * > & RestoreClassSet ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::map< int, TPZRestore_t > & ClassIdMap ()
 This static function guarantees that the gMap object is available when needed. More...
 
static std::pair< std::string, uint64_t > NeoPZVersion ()
 
static void Register (TPZRestoreClassBase *restore)
 
static void RegisterClassId (int classid, TPZRestore_t fun)
 
static TPZSavableCreateInstance (const int &classId)
 

Protected Attributes

TPZVec< TVar > fStorage
 Stores matrix data. More...
 
TPZVec< int64_t > fBlockPos
 Stores blocks data. More...
 
TPZVec< int > fBlockSize
 Stores block sizes data. More...
 
- Protected Attributes inherited from TPZMatrix< TVar >
int64_t fRow
 Number of rows in matrix. More...
 
int64_t fCol
 Number of cols in matrix. More...
 
char fDecomposed
 Decomposition type used to decompose the current matrix. More...
 
char fDefPositive
 Definite Posistiveness of current matrix. More...
 

Private Member Functions

int Clear () override
 Clean data matrix. Zeroes number of columns and rows. More...
 

Additional Inherited Members

- Protected Member Functions inherited from TPZMatrix< TVar >
void PrepareZ (const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar beta, const int opt) const
 Is an auxiliar method used by MultiplyAdd. More...
 
 TPZMatrix (const int64_t row, const int64_t col)
 Constructor. More...
 
- Static Protected Member Functions inherited from TPZMatrix< TVar >
static void Swap (int64_t *a, int64_t *b)
 Swaps contents of a in b and b in a. More...
 
- Static Protected Attributes inherited from TPZMatrix< TVar >
static TVar gZero
 Initializing value to static variable. More...
 

Detailed Description

template<class TVar>
class TPZBlockDiagonal< TVar >

Defines block diagonal matrices. Matrix.

Author
Philippe Devloo.
Since
01/2001

Definition at line 21 of file pzblockdiag.h.

Constructor & Destructor Documentation

◆ TPZBlockDiagonal() [1/4]

template<class TVar >
TPZBlockDiagonal< TVar >::TPZBlockDiagonal ( )

Simple constructor.

Definition at line 126 of file pzblockdiag.cpp.

◆ TPZBlockDiagonal() [2/4]

template<class TVar>
TPZBlockDiagonal< TVar >::TPZBlockDiagonal ( const TPZVec< int > &  blocksizes,
const TPZFMatrix< TVar > &  glob 
)

Constructor with initialization parameters.

Parameters
blocksizesSize of blocks on Block Diagonal matrix
globGlobal matrix which will be blocked

Definition at line 145 of file pzblockdiag.cpp.

◆ TPZBlockDiagonal() [3/4]

template<class TVar>
TPZBlockDiagonal< TVar >::TPZBlockDiagonal ( const TPZVec< int > &  blocksizes)

Constructor with initialization parameters.

Parameters
blocksizesSize of blocks on Block Diagonal matrix

Definition at line 134 of file pzblockdiag.cpp.

◆ TPZBlockDiagonal() [4/4]

template<class TVar>
TPZBlockDiagonal< TVar >::TPZBlockDiagonal ( const TPZBlockDiagonal< TVar > &  A)

Copy constructor.

Definition at line 182 of file pzblockdiag.cpp.

◆ ~TPZBlockDiagonal()

template<class TVar >
TPZBlockDiagonal< TVar >::~TPZBlockDiagonal ( )

Simple destructor.

Definition at line 192 of file pzblockdiag.cpp.

Member Function Documentation

◆ AddBlock()

template<class TVar>
void TPZBlockDiagonal< TVar >::AddBlock ( int64_t  i,
TPZFMatrix< TVar > &  block 
)

Adds a block to current matrix.

Parameters
iAdds in ith position
blockBlock to be added

Definition at line 25 of file pzblockdiag.cpp.

Referenced by TPZSparseBlockDiagonal< TVar >::AddBlock(), TPZBlockDiagonalStructMatrix::AssembleBlockDiagonal(), TPZCompEl::CalcBlockDiagonal(), and TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ AutoFill()

template<class TVar >
void TPZBlockDiagonal< TVar >::AutoFill ( int64_t  neq,
int64_t  jeq,
int  symmetric 
)

Fill the matrix with random values (non singular matrix)

Definition at line 590 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ BuildFromMatrix()

template<class TVar>
void TPZBlockDiagonal< TVar >::BuildFromMatrix ( TPZMatrix< TVar > &  matrix)

Builds a block from matrix.

Parameters
matrixMatrix to build from

Definition at line 103 of file pzblockdiag.cpp.

Referenced by TPZEulerAnalysis::Assemble(), TPZBlockDiagonal< STATE >::GetSizeofBlock(), and TPZElastoPlasticAnalysis::UpdatePrecond().

◆ ClassId()

template<class TVar >
int TPZBlockDiagonal< TVar >::ClassId ( ) const
overridevirtual

Define the class id associated with the class.

This id has to be unique for all classes A non unique id is flagged at the startup of the program

Implements TPZSavable.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 638 of file pzblockdiag.cpp.

Referenced by TPZSparseBlockDiagonal< TVar >::ClassId(), and TPZBlockDiagonal< STATE >::NumberofBlocks().

◆ Clear()

template<class TVar >
int TPZBlockDiagonal< TVar >::Clear ( )
overrideprivatevirtual

Clean data matrix. Zeroes number of columns and rows.

Reimplemented from TPZMatrix< TVar >.

Definition at line 493 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ Decompose_LU() [1/2]

template<class TVar >
int TPZBlockDiagonal< TVar >::Decompose_LU ( )
overridevirtual

◆ Decompose_LU() [2/2]

template<class TVar >
int TPZBlockDiagonal< TVar >::Decompose_LU ( std::list< int64_t > &  singular)
overridevirtual

Decomposes the current matrix using LU decomposition.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSpBlockDiagPivot< TVar >.

Definition at line 420 of file pzblockdiag.cpp.

◆ Dim()

template<class TVar>
int64_t TPZBlockDiagonal< TVar >::Dim ( ) const
inlineoverridevirtual

Returns the dimension of the matrix if the matrix is square.

If the matrix is not square, returns an error

Reimplemented from TPZMatrix< TVar >.

Definition at line 61 of file pzblockdiag.h.

Referenced by TPZBlockDiagonal< STATE >::Get(), TPZBlockDiagonal< STATE >::Put(), and TPZBlockDiagonal< STATE >::Transpose().

◆ Get()

template<class TVar >
const TVar & TPZBlockDiagonal< TVar >::Get ( const int64_t  row,
const int64_t  col 
) const
overridevirtual

Get value with bound checking.

Parameters
rowRow number.
colColumn number.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 253 of file pzblockdiag.cpp.

◆ GetBlock()

template<class TVar>
void TPZBlockDiagonal< TVar >::GetBlock ( int64_t  i,
TPZFMatrix< TVar > &  block 
)

Gets a block from current matrix.

Parameters
iReturns teh ith block
blockContains returned block

Definition at line 52 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonalStructMatrix::AssembleBlockDiagonal(), TPZSparseBlockDiagonal< TVar >::GetBlock(), and TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ GetSizeofBlock()

template<class TVar>
int TPZBlockDiagonal< TVar >::GetSizeofBlock ( int64_t  blockid)
inline

Return the choosen block size.

Parameters
blockid- block index

Definition at line 70 of file pzblockdiag.h.

◆ GetVal()

template<class TVar >
const TVar & TPZBlockDiagonal< TVar >::GetVal ( const int64_t  row,
const int64_t  col 
) const
overridevirtual

This method don't make verification if the element exist. It is fast than Get.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 295 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::Get().

◆ Initialize()

template<class TVar >
void TPZBlockDiagonal< TVar >::Initialize ( const TPZVec< int > &  blocksize)

◆ main()

template<class TVar >
int TPZBlockDiagonal< TVar >::main ( )
static

This method checks the working of the class.

Definition at line 505 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ MultAdd()

template<class TVar>
void TPZBlockDiagonal< TVar >::MultAdd ( const TPZFMatrix< TVar > &  x,
const TPZFMatrix< TVar > &  y,
TPZFMatrix< TVar > &  z,
const TVar  alpha = 1.,
const TVar  beta = 0.,
const int  opt = 0 
) const
overridevirtual

Computes z = alpha * opt(this)*x + beta * y.

Note
z and x cannot overlap in memory

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 330 of file pzblockdiag.cpp.

Referenced by TPZSparseBlockDiagonal< TVar >::MultAdd().

◆ NumberofBlocks()

template<class TVar>
int64_t TPZBlockDiagonal< TVar >::NumberofBlocks ( )
inline

Definition at line 132 of file pzblockdiag.h.

◆ operator()()

template<class TVar >
TVar & TPZBlockDiagonal< TVar >::operator() ( const int64_t  row,
const int64_t  col 
)

Definition at line 263 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::s().

◆ Print()

template<class TVar >
void TPZBlockDiagonal< TVar >::Print ( const char *  message,
std::ostream &  out = std::cout,
const MatrixOutputFormat  format = EFormatted 
) const
overridevirtual

Prints current matrix data.

Parameters
messageMessage to be printed
outOutput device
formatOutput format to print

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 536 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock(), and TPZSparseBlockDiagonal< TVar >::Print().

◆ Put()

template<class TVar>
int TPZBlockDiagonal< TVar >::Put ( const int64_t  row,
const int64_t  col,
const TVar &  value 
)
overridevirtual

Put values with bounds checking if DEBUG variable is defined.

Parameters
rowRow number.
colColumn number.
valueValue being put.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 199 of file pzblockdiag.cpp.

◆ PutVal()

template<class TVar>
int TPZBlockDiagonal< TVar >::PutVal ( const int64_t  row,
const int64_t  col,
const TVar &  value 
)
overridevirtual

This method don't make verification if the element exist. It is fast than Put.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 215 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::Put().

◆ s()

template<class TVar >
TVar & TPZBlockDiagonal< TVar >::s ( const int64_t  row,
const int64_t  col 
)
inlineoverridevirtual

The operators check on the bounds if the DEBUG variable is defined.

Parameters
rowRow number.
colColumn number.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 146 of file pzblockdiag.h.

◆ SetBlock()

template<class TVar>
void TPZBlockDiagonal< TVar >::SetBlock ( int64_t  i,
TPZFMatrix< TVar > &  block 
)

Sets a block in the current matrix.

Parameters
iAdds in ith position
blockBlock to be added

Definition at line 39 of file pzblockdiag.cpp.

Referenced by TPZSparseBlockDiagonal< TVar >::BuildFromMatrix(), and TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ Substitution()

template<class TVar>
int TPZBlockDiagonal< TVar >::Substitution ( TPZFMatrix< TVar > *  B) const
overridevirtual

Makes the backward and forward substitutions whether the matrix was LU decomposed.

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >, and TPZSpBlockDiagPivot< TVar >.

Definition at line 464 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock(), and TPZSparseBlockDiagonal< TVar >::Substitution().

◆ Transpose()

template<class TVar>
void TPZBlockDiagonal< TVar >::Transpose ( TPZMatrix< TVar > *const  T) const
overridevirtual

It makes *T the transpose of current matrix.

Reimplemented from TPZMatrix< TVar >.

Definition at line 396 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ UpdateFrom()

template<class TVar>
void TPZBlockDiagonal< TVar >::UpdateFrom ( TPZAutoPointer< TPZMatrix< TVar > >  mat)
overridevirtual

Updates the values of the matrix based on the values of the matrix.

Updates the values of the matrix based on the values of the matrix

Reimplemented from TPZMatrix< TVar >.

Reimplemented in TPZSparseBlockDiagonal< TVar >.

Definition at line 568 of file pzblockdiag.cpp.

Referenced by TPZBlockDiagonal< STATE >::GetSizeofBlock().

◆ Zero()

template<class TVar >
int TPZBlockDiagonal< TVar >::Zero ( )
overridevirtual

Zeroes all the elements of the matrix.

Reimplemented from TPZMatrix< TVar >.

Definition at line 382 of file pzblockdiag.cpp.

Referenced by TPZEulerAnalysis::Assemble(), and TPZBlockDiagonal< STATE >::Dim().

Member Data Documentation

◆ fBlockPos

template<class TVar>
TPZVec<int64_t> TPZBlockDiagonal< TVar >::fBlockPos
protected

◆ fBlockSize

template<class TVar>
TPZVec<int> TPZBlockDiagonal< TVar >::fBlockSize
protected

◆ fStorage

template<class TVar>
TPZVec<TVar> TPZBlockDiagonal< TVar >::fStorage
protected

The documentation for this class was generated from the following files: