NeoPZ
|
Implements rectangular matrix which extends a solution vector of the coarse mesh to a solution vector in the fine mesh. Matrix. More...
#include <pzcmesh.h>
Public Member Functions | |
int | ClassId () const override |
Define the class id associated with the class. More... | |
TPZTransfer () | |
Default constructor. More... | |
TPZTransfer (TPZBlock< TVar > &row, TPZBlock< TVar > &col, int nvar, int nrowblocks, int ncolblocks) | |
The sparse matrix blocks are defined by row, col. More... | |
TPZTransfer (const TPZTransfer &cp) | |
copy constructor More... | |
virtual TPZMatrix< TVar > * | Clone () const override |
virtual void | Print (const char *name=NULL, std::ostream &out=std::cout, const MatrixOutputFormat form=EFormatted) const override |
It prints the matrix data in a MatrixFormat Rows X Cols. More... | |
void | SetNTVarVariables (int TVarvar) |
Identifies the number of equations per shapefunction. More... | |
void | SetBlocks (TPZBlock< TVar > &row, TPZBlock< TVar > &col, int nvar, int nrowblocks, int ncolblocks) |
This operation will reset the matrix to zero with no rows defined. More... | |
int | HasRowDefinition (int row) |
Returns 1 if the row is defined (i.e. has column entries) More... | |
void | AddBlockNumbers (int row, TPZVec< int > &colnumbers) |
Will specify the sparsity pattern of row. More... | |
void | SetBlockMatrix (int row, int col, TPZFMatrix< TVar > &mat) |
Sets the row,col block equal to matrix mat if row col was not specified by AddBlockNumbers, an error will be issued and exit. More... | |
void | MultAdd (const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt=0) const override |
Multiplies the transfer matrix and puts the result in z. More... | |
void | MultAddScalar (const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt=0) const |
Multiplies the transfer matrix and puts the result in z. More... | |
void | TransferSolution (const TPZFMatrix< TVar > &coarsesol, TPZFMatrix< TVar > &finesol) |
Will transfer the solution, taking into acount there may be more than one TVar variable. More... | |
void | TransferResidual (const TPZFMatrix< TVar > &fine, TPZFMatrix< TVar > &coarse) |
Will transfer the residual, taking into acount there may be more than one TVar variable. More... | |
void | MultiplyScalar (const TPZFMatrix< TVar > &A, TPZFMatrix< TVar > &B, int opt) const |
Public Member Functions inherited from TPZMatrix< TVar > | |
TPZMatrix () | |
Simple constructor. More... | |
TPZMatrix (const TPZMatrix< TVar > &cp) | |
virtual | ~TPZMatrix () |
Simple destructor. More... | |
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 > ©) |
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... | |
virtual int | Put (const int64_t row, const int64_t col, const TVar &value) |
Put values with bounds checking if DEBUG variable is defined. More... | |
virtual const TVar & | Get (const int64_t row, const int64_t col) const |
Get value with bound checking. 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... | |
virtual TVar & | s (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 int | PutVal (const int64_t, const int64_t, const TVar &val) |
Put values without bounds checking This method is faster than "Put" if DEBUG is defined. More... | |
virtual const TVar & | GetVal (const int64_t, const int64_t) const |
Get values without bounds checking This method is faster than "Get" if DEBUG 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... | |
virtual void | Transpose (TPZMatrix< TVar > *const T) const |
It makes *T the transpose of current 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 void | UpdateFrom (TPZAutoPointer< TPZMatrix< TVar > >) |
Updates the values of the matrix based on the values of the matrix. 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_LU (std::list< int64_t > &singular) |
Decomposes the current matrix using LU decomposition. More... | |
virtual int | Decompose_LU () |
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 | Substitution (TPZFMatrix< TVar > *B) const |
Computes Forward and Backward substitution for a "LU" decomposed matrix. 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... | |
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 int64_t | Dim () const |
Returns the dimension of the matrix if the matrix is square. 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 int | Zero () |
Zeroes the matrix. 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 | |
Private Member Functions | |
void | ExpandColumnVectorEntries (int numcol) |
Increases the storage allocated int fColPosition to include numcol more values. More... | |
void | ExpandDoubleValueEntries (int numval) |
Increases the storage space available in the fDoubleValues vector to include numval entries. More... | |
Private Attributes | |
int | fNTVarVar |
Number of variables associated with each shape function. More... | |
TPZBlock< TVar > | fRowBlock |
Block sizes of the rows. More... | |
TPZBlock< TVar > | fColBlock |
Block sizes of the columns. More... | |
TPZVec< int > | fColPosition |
Vector indicating the starting column block for each row. More... | |
TPZVec< int > | fNumberofColumnBlocks |
Vector indicating the number of column blocks associated with each row. More... | |
TPZManVector< int > | fColumnBlockPosition |
Vector indicating the starting point of each column block. More... | |
TPZManVector< int > | fColumnBlockNumber |
Vector indicating the number of the column corresponding to the block. More... | |
int | fColumnBlockLastUsed |
Indicates the next free position. More... | |
TPZManVector< TVar > | fDoubleValues |
Storage space for the matrix blocks. More... | |
int | fDoubleValLastUsed |
Indicates the next free position of fDoubleValues. More... | |
Additional Inherited Members | |
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 TPZSavable * | CreateInstance (const int &classId) |
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... | |
virtual int | Clear () |
It clears data structure. 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... | |
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... | |
Static Protected Attributes inherited from TPZMatrix< TVar > | |
static TVar | gZero |
Initializing value to static variable. More... | |
Implements rectangular matrix which extends a solution vector of the coarse mesh to a solution vector in the fine mesh. Matrix.
Implements a rectangular sparse block matrix it is assumed that the data is entered one row at a time
the matrix structure cannot be modified after being defined
TPZTransfer< TVar >::TPZTransfer | ( | ) |
Default constructor.
Definition at line 13 of file pztransfer.cpp.
Referenced by TPZTransfer< TVar >::Clone().
TPZTransfer< TVar >::TPZTransfer | ( | TPZBlock< TVar > & | row, |
TPZBlock< TVar > & | col, | ||
int | nvar, | ||
int | nrowblocks, | ||
int | ncolblocks | ||
) |
The sparse matrix blocks are defined by row, col.
Definition at line 20 of file pztransfer.cpp.
References TPZTransfer< TVar >::SetBlocks().
|
inline |
copy constructor
Definition at line 36 of file pztransfer.h.
void TPZTransfer< TVar >::AddBlockNumbers | ( | int | row, |
TPZVec< int > & | colnumbers | ||
) |
Will specify the sparsity pattern of row.
Definition at line 121 of file pztransfer.cpp.
References DebugStop, TPZTransfer< TVar >::ExpandColumnVectorEntries(), TPZTransfer< TVar >::fColPosition, TPZTransfer< TVar >::fColumnBlockLastUsed, TPZTransfer< TVar >::fColumnBlockNumber, TPZTransfer< TVar >::fNumberofColumnBlocks, TPZTransfer< TVar >::HasRowDefinition(), and TPZVec< T >::NElements().
Referenced by TPZInterpolationSpace::BuildTransferMatrix(), TPZInterpolatedElement::BuildTransferMatrix(), TPZCompElDisc::BuildTransferMatrix(), and TPZTransfer< TVar >::SetNTVarVariables().
|
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
Reimplemented from TPZMatrix< TVar >.
Definition at line 138 of file pztransfer.h.
References TPZMatrix< TVar >::ClassId(), and Hash().
|
inlineoverridevirtual |
Implements TPZMatrix< TVar >.
Definition at line 48 of file pztransfer.h.
References EFormatted, TPZTransfer< TVar >::Print(), and TPZTransfer< TVar >::TPZTransfer().
|
private |
Increases the storage allocated int fColPosition to include numcol more values.
Definition at line 139 of file pztransfer.cpp.
References TPZManVector< T, NumExtAlloc >::Expand(), TPZTransfer< TVar >::fColumnBlockLastUsed, TPZTransfer< TVar >::fColumnBlockNumber, TPZTransfer< TVar >::fColumnBlockPosition, TPZVec< T >::Fill(), TPZManVector< T, NumExtAlloc >::NAlloc(), and TPZManVector< T, NumExtAlloc >::Resize().
Referenced by TPZTransfer< TVar >::AddBlockNumbers(), and TPZTransfer< TVar >::SetNTVarVariables().
|
private |
Increases the storage space available in the fDoubleValues vector to include numval entries.
Definition at line 191 of file pztransfer.cpp.
References TPZManVector< T, NumExtAlloc >::Expand(), TPZTransfer< TVar >::fDoubleValLastUsed, TPZTransfer< TVar >::fDoubleValues, TPZManVector< T, NumExtAlloc >::NAlloc(), TPZVec< T >::NElements(), and TPZManVector< T, NumExtAlloc >::Resize().
Referenced by TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetNTVarVariables().
int TPZTransfer< TVar >::HasRowDefinition | ( | int | row | ) |
Returns 1 if the row is defined (i.e. has column entries)
Definition at line 114 of file pztransfer.cpp.
References TPZTransfer< TVar >::fColPosition.
Referenced by TPZTransfer< TVar >::AddBlockNumbers(), TPZInterpolationSpace::BuildTransferMatrix(), TPZInterpolatedElement::BuildTransferMatrix(), TPZCompElDisc::BuildTransferMatrix(), and TPZTransfer< TVar >::SetNTVarVariables().
|
overridevirtual |
Multiplies the transfer matrix and puts the result in z.
Reimplemented from TPZMatrix< TVar >.
Definition at line 202 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), TPZMatrix< TVar >::Error(), TPZTransfer< TVar >::fNTVarVar, TPZTransfer< TVar >::fRowBlock, TPZFMatrix< TVar >::GetVal(), TPZTransfer< TVar >::MultAddScalar(), TPZMatrix< TVar >::PrepareZ(), and TPZMatrix< TVar >::Rows().
Referenced by TPZTransfer< TVar >::SetNTVarVariables().
void TPZTransfer< TVar >::MultAddScalar | ( | const TPZFMatrix< TVar > & | x, |
const TPZFMatrix< TVar > & | y, | ||
TPZFMatrix< TVar > & | z, | ||
const TVar | alpha, | ||
const TVar | beta, | ||
const int | opt = 0 |
||
) | const |
Multiplies the transfer matrix and puts the result in z.
Definition at line 241 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), TPZMatrix< TVar >::Error(), TPZTransfer< TVar >::fColBlock, TPZTransfer< TVar >::fColPosition, TPZTransfer< TVar >::fColumnBlockNumber, TPZTransfer< TVar >::fColumnBlockPosition, TPZTransfer< TVar >::fDoubleValues, TPZTransfer< TVar >::fNumberofColumnBlocks, TPZTransfer< TVar >::fRowBlock, TPZFMatrix< TVar >::g(), TPZFMatrix< TVar >::MultAdd(), TPZMatrix< TVar >::PrepareZ(), and TPZMatrix< TVar >::Rows().
Referenced by TPZTransfer< TVar >::MultAdd(), TPZTransfer< TVar >::MultiplyScalar(), and TPZTransfer< TVar >::SetNTVarVariables().
void TPZTransfer< TVar >::MultiplyScalar | ( | const TPZFMatrix< TVar > & | A, |
TPZFMatrix< TVar > & | B, | ||
int | opt | ||
) | const |
Definition at line 386 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), TPZMatrix< TVar >::Error(), TPZTransfer< TVar >::fNTVarVar, TPZTransfer< TVar >::MultAddScalar(), TPZFMatrix< TVar >::Redim(), and TPZMatrix< TVar >::Rows().
Referenced by TPZTransfer< TVar >::SetNTVarVariables(), TPZTransfer< TVar >::TransferResidual(), and TPZTransfer< TVar >::TransferSolution().
|
overridevirtual |
It prints the matrix data in a MatrixFormat Rows X Cols.
Reimplemented from TPZMatrix< TVar >.
Definition at line 31 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), EFormatted, TPZTransfer< TVar >::fColBlock, TPZTransfer< TVar >::fColPosition, TPZTransfer< TVar >::fColumnBlockNumber, TPZTransfer< TVar >::fColumnBlockPosition, TPZTransfer< TVar >::fDoubleValues, TPZTransfer< TVar >::fNumberofColumnBlocks, TPZTransfer< TVar >::fRowBlock, TPZMatrix< TVar >::Print(), and TPZMatrix< TVar >::Rows().
Referenced by TPZTransfer< TVar >::Clone().
void TPZTransfer< TVar >::SetBlockMatrix | ( | int | row, |
int | col, | ||
TPZFMatrix< TVar > & | mat | ||
) |
Sets the row,col block equal to matrix mat if row col was not specified by AddBlockNumbers,
an error will be issued and exit.
Definition at line 153 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), DebugStop, TPZTransfer< TVar >::ExpandDoubleValueEntries(), TPZTransfer< TVar >::fColBlock, TPZTransfer< TVar >::fColPosition, TPZTransfer< TVar >::fColumnBlockNumber, TPZTransfer< TVar >::fColumnBlockPosition, TPZTransfer< TVar >::fDoubleValLastUsed, TPZTransfer< TVar >::fDoubleValues, TPZTransfer< TVar >::fNumberofColumnBlocks, TPZTransfer< TVar >::fRowBlock, and TPZMatrix< TVar >::Rows().
Referenced by TPZInterpolationSpace::BuildTransferMatrix(), TPZInterpolatedElement::BuildTransferMatrix(), TPZCompElDisc::BuildTransferMatrix(), and TPZTransfer< TVar >::SetNTVarVariables().
void TPZTransfer< TVar >::SetBlocks | ( | TPZBlock< TVar > & | row, |
TPZBlock< TVar > & | col, | ||
int | nvar, | ||
int | nrowblocks, | ||
int | ncolblocks | ||
) |
This operation will reset the matrix to zero with no rows defined.
row | starting row of the block |
col | starting column of the block |
nvar | indicates the number of TVar variables of the problem |
nrowblocks | number of rows of the block |
ncolblocks | number of columns of the block |
Definition at line 85 of file pztransfer.cpp.
References TPZMatrix< TVar >::fCol, TPZTransfer< TVar >::fColBlock, TPZTransfer< TVar >::fColPosition, TPZTransfer< TVar >::fColumnBlockLastUsed, TPZTransfer< TVar >::fColumnBlockNumber, TPZTransfer< TVar >::fColumnBlockPosition, TPZTransfer< TVar >::fDoubleValLastUsed, TPZTransfer< TVar >::fDoubleValues, TPZVec< T >::Fill(), TPZTransfer< TVar >::fNTVarVar, TPZTransfer< TVar >::fNumberofColumnBlocks, TPZMatrix< TVar >::fRow, TPZTransfer< TVar >::fRowBlock, TPZBlock< TVar >::MaxBlockSize(), TPZManVector< T, NumExtAlloc >::Resize(), TPZVec< T >::Resize(), and TPZBlock< TVar >::Size().
Referenced by TPZCompMesh::BuildTransferMatrix(), TPZCompMesh::BuildTransferMatrixDesc(), TPZTransfer< TVar >::SetNTVarVariables(), and TPZTransfer< TVar >::TPZTransfer().
|
inline |
Identifies the number of equations per shapefunction.
Definition at line 54 of file pztransfer.h.
References TPZTransfer< TVar >::AddBlockNumbers(), TPZTransfer< TVar >::ExpandColumnVectorEntries(), TPZTransfer< TVar >::ExpandDoubleValueEntries(), TPZTransfer< TVar >::fNTVarVar, TPZTransfer< TVar >::HasRowDefinition(), TPZTransfer< TVar >::MultAdd(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::MultiplyScalar(), TPZTransfer< TVar >::SetBlockMatrix(), TPZTransfer< TVar >::SetBlocks(), TPZTransfer< TVar >::TransferResidual(), and TPZTransfer< TVar >::TransferSolution().
void TPZTransfer< TVar >::TransferResidual | ( | const TPZFMatrix< TVar > & | fine, |
TPZFMatrix< TVar > & | coarse | ||
) |
Will transfer the residual, taking into acount there may be more than one TVar variable.
Will transfer the residual, taking into acount there may be more than one TVar variable
Definition at line 347 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), TPZTransfer< TVar >::fNTVarVar, TPZFMatrix< TVar >::GetVal(), TPZTransfer< TVar >::MultiplyScalar(), TPZFMatrix< TVar >::Redim(), and TPZMatrix< TVar >::Rows().
Referenced by TPZTransfer< TVar >::SetNTVarVariables(), and TPZNonLinMultGridAnalysis::TwoGridAlgorithm().
void TPZTransfer< TVar >::TransferSolution | ( | const TPZFMatrix< TVar > & | coarsesol, |
TPZFMatrix< TVar > & | finesol | ||
) |
Will transfer the solution, taking into acount there may be more than one TVar variable.
Will transfer the solution, taking into acount there may be more than one TVar variable
Definition at line 305 of file pztransfer.cpp.
References TPZMatrix< TVar >::Cols(), TPZTransfer< TVar >::fNTVarVar, TPZFMatrix< TVar >::GetVal(), TPZTransfer< TVar >::MultiplyScalar(), TPZFMatrix< TVar >::Redim(), and TPZMatrix< TVar >::Rows().
Referenced by TPZMGAnalysis::AppendMesh(), TPZTransfer< TVar >::SetNTVarVariables(), and TPZNonLinMultGridAnalysis::TwoGridAlgorithm().
|
private |
Block sizes of the columns.
Definition at line 119 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Vector indicating the starting column block for each row.
Definition at line 121 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::AddBlockNumbers(), TPZTransfer< TVar >::HasRowDefinition(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Indicates the next free position.
Definition at line 129 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::AddBlockNumbers(), TPZTransfer< TVar >::ExpandColumnVectorEntries(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Vector indicating the number of the column corresponding to the block.
Definition at line 127 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::AddBlockNumbers(), TPZTransfer< TVar >::ExpandColumnVectorEntries(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Vector indicating the starting point of each column block.
Definition at line 125 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::ExpandColumnVectorEntries(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Indicates the next free position of fDoubleValues.
Definition at line 133 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::ExpandDoubleValueEntries(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Storage space for the matrix blocks.
Definition at line 131 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::ExpandDoubleValueEntries(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Number of variables associated with each shape function.
Definition at line 113 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::MultAdd(), TPZTransfer< TVar >::MultiplyScalar(), TPZTransfer< TVar >::SetBlocks(), TPZTransfer< TVar >::SetNTVarVariables(), TPZTransfer< TVar >::TransferResidual(), and TPZTransfer< TVar >::TransferSolution().
|
private |
Vector indicating the number of column blocks associated with each row.
Definition at line 123 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::AddBlockNumbers(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().
|
private |
Block sizes of the rows.
Definition at line 116 of file pztransfer.h.
Referenced by TPZTransfer< TVar >::MultAdd(), TPZTransfer< TVar >::MultAddScalar(), TPZTransfer< TVar >::Print(), TPZTransfer< TVar >::SetBlockMatrix(), and TPZTransfer< TVar >::SetBlocks().