NeoPZ
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TPZDiffMatrix< T > Class Template Reference

Matrix class to hold the flux derivatives A B C and diffusive matrix coefficients. Matrix. More...

#include <pzdiffmatrix.h>

Public Member Functions

 TPZDiffMatrix ()
 
 TPZDiffMatrix (const int64_t rows, const int64_t cols)
 
 ~TPZDiffMatrix ()
 
 TPZDiffMatrix (const TPZDiffMatrix &copy)
 
void Redim (const int64_t rows, const int64_t cols)
 Resizes and zeroes the matrix. More...
 
void Multiply (TPZVec< T > &In, TPZVec< T > &Out, const T &scale=T(1.))
 Multiplies the matrix by a correspondent TPZVec vector. Dimensions are checked. More...
 
void Multiply (TPZDiffMatrix< T > &In, TPZDiffMatrix< T > &Out, const T &scale=T(1.))
 Matrix multiplication. Dimensions are checked. More...
 
void MultiplyAdd (TPZDiffMatrix< T > &In, TPZDiffMatrix< T > &Out, const T &scale=T(1.))
 Matrix multiplication. More...
 
TPZDiffMatrix< T > & operator= (const TPZDiffMatrix< T > &source)
 Copies the matrix, reallocating all coefficients. More...
 
void Add (TPZDiffMatrix< T > &matrix, const T &scale=T(1.))
 Adds element by element. More...
 
T & operator() (const int64_t i, const int64_t j=0)
 Matrix data access. More...
 
void PutVal (const int64_t row, const int64_t col, const T &value)
 
const T & GetVal (const int64_t row, const int64_t col) const
 
TPZDiffMatrix< T > & Transpose (TPZDiffMatrix< T > &matrix)
 Transposes the matrix onto the parameter object. More...
 
void AddAlignDiv (TPZVec< T > &gradx, const int64_t varOffset, const int64_t dim, TPZVec< T > &Divergent)
 Performs a specific diffusive divergence operation. More...
 
void AddDiv (T &dPhi, TPZVec< T > &U, const int64_t dim, TPZVec< T > &Divergent, TPZDiffMatrix< T > &dDivergent)
 Computes the divergent for diffusion purposes. More...
 
int64_t Cols () const
 
int64_t Rows () const
 
EStatus Decompose_LU ()
 
EStatus Substitution (TPZDiffMatrix< T > *B) const
 
void Reset ()
 

Private Member Functions

int64_t index (const int64_t i, const int64_t j) const
 

Private Attributes

int64_t fRows
 
int64_t fCols
 
T * fStore
 
int fDecomposed
 

Detailed Description

template<class T>
class TPZDiffMatrix< T >

Matrix class to hold the flux derivatives A B C and diffusive matrix coefficients. Matrix.

Author
Erick Slis
Cedric Ayala
Since
June 1, 2003.

Definition at line 27 of file pzdiffmatrix.h.

Constructor & Destructor Documentation

◆ TPZDiffMatrix() [1/3]

template<class T >
TPZDiffMatrix< T >::TPZDiffMatrix ( )
inline

Definition at line 173 of file pzdiffmatrix.h.

◆ TPZDiffMatrix() [2/3]

template<class T >
TPZDiffMatrix< T >::TPZDiffMatrix ( const int64_t  rows,
const int64_t  cols 
)
inline

Definition at line 178 of file pzdiffmatrix.h.

References TPZDiffMatrix< T >::Redim().

◆ ~TPZDiffMatrix()

template<class T >
TPZDiffMatrix< T >::~TPZDiffMatrix ( )
inline

Definition at line 184 of file pzdiffmatrix.h.

References TPZDiffMatrix< T >::fStore.

◆ TPZDiffMatrix() [3/3]

template<class T>
TPZDiffMatrix< T >::TPZDiffMatrix ( const TPZDiffMatrix< T > &  copy)
inline

Member Function Documentation

◆ Add()

template<class T >
void TPZDiffMatrix< T >::Add ( TPZDiffMatrix< T > &  matrix,
const T &  scale = T(1.) 
)
inline

◆ AddAlignDiv()

template<class T >
void TPZDiffMatrix< T >::AddAlignDiv ( TPZVec< T > &  gradx,
const int64_t  varOffset,
const int64_t  dim,
TPZVec< T > &  Divergent 
)
inline

Performs a specific diffusive divergence operation.

Parameters
gradxexample: {dU0dx0 dU0dx1 dU0dx2 dU1dx0... dU5dx2}
varOffsetshall lie between 0 and dim-1.
Represents the index of spatial derivative to multiply the matrix by.
dim
Divergentvetor to which the operation shall contribute to.
Must be explicitly zeroed before calling this function. The object gradx contain the tangent matrix of the solutions with respect to the dim spatial dimensions.

Definition at line 337 of file pzdiffmatrix.h.

References TPZVec< T >::NElements(), and PZError.

Referenced by TPZDiffMatrix< T >::TPZDiffMatrix().

◆ AddDiv()

template<class T >
void TPZDiffMatrix< T >::AddDiv ( T &  dPhi,
TPZVec< T > &  U,
const int64_t  dim,
TPZVec< T > &  Divergent,
TPZDiffMatrix< T > &  dDivergent 
)
inline

Computes the divergent for diffusion purposes.

Parameters
dPhithe dim number of derivatives of test function
Uthe dim+2 solutions at the given point
dim
DivergentVector result containing the computed divergent The operation is additive, so zero it first
dDivergentComputes an approximate derivative of the divergent with respect to the Ui coefficients.

Definition at line 351 of file pzdiffmatrix.h.

References TPZVec< T >::NElements(), TPZDiffMatrix< T >::operator()(), and PZError.

Referenced by TPZDiffMatrix< T >::TPZDiffMatrix().

◆ Cols()

template<class T >
int64_t TPZDiffMatrix< T >::Cols ( ) const
inline

◆ Decompose_LU()

template<class T >
EStatus TPZDiffMatrix< T >::Decompose_LU ( )
inline

◆ GetVal()

template<class T >
const T & TPZDiffMatrix< T >::GetVal ( const int64_t  row,
const int64_t  col 
) const
inline

◆ index()

template<class T >
int64_t TPZDiffMatrix< T >::index ( const int64_t  i,
const int64_t  j 
) const
inlineprivate

◆ Multiply() [1/2]

template<class T >
void TPZDiffMatrix< T >::Multiply ( TPZVec< T > &  In,
TPZVec< T > &  Out,
const T &  scale = T(1.) 
)
inline

Multiplies the matrix by a correspondent TPZVec vector. Dimensions are checked.

Definition at line 256 of file pzdiffmatrix.h.

References TPZDiffMatrix< T >::fCols, TPZDiffMatrix< T >::fRows, TPZVec< T >::NElements(), TPZDiffMatrix< T >::operator()(), PZError, and TPZVec< T >::Resize().

Referenced by TPZArtDiff::Bornhaus(), TPZArtDiff::SUPG(), and TPZDiffMatrix< T >::TPZDiffMatrix().

◆ Multiply() [2/2]

template<class T >
void TPZDiffMatrix< T >::Multiply ( TPZDiffMatrix< T > &  In,
TPZDiffMatrix< T > &  Out,
const T &  scale = T(1.) 
)
inline

Matrix multiplication. Dimensions are checked.

Definition at line 274 of file pzdiffmatrix.h.

References TPZDiffMatrix< T >::fCols, TPZDiffMatrix< T >::fRows, TPZDiffMatrix< T >::operator()(), PZError, and TPZDiffMatrix< T >::Redim().

◆ MultiplyAdd()

template<class T >
void TPZDiffMatrix< T >::MultiplyAdd ( TPZDiffMatrix< T > &  In,
TPZDiffMatrix< T > &  Out,
const T &  scale = T(1.) 
)
inline

Matrix multiplication.

Dimensions are checked.
Results are additively contributed to Out

Definition at line 296 of file pzdiffmatrix.h.

References TPZDiffMatrix< T >::fCols, TPZDiffMatrix< T >::fRows, TPZDiffMatrix< T >::operator()(), PZError, and TPZDiffMatrix< T >::Redim().

Referenced by TPZDiffMatrix< T >::TPZDiffMatrix().

◆ operator()()

template<class T >
T & TPZDiffMatrix< T >::operator() ( const int64_t  i,
const int64_t  j = 0 
)
inline

◆ operator=()

template<class T >
TPZDiffMatrix< T > & TPZDiffMatrix< T >::operator= ( const TPZDiffMatrix< T > &  source)
inline

◆ PutVal()

template<class T >
void TPZDiffMatrix< T >::PutVal ( const int64_t  row,
const int64_t  col,
const T &  value 
)
inline

◆ Redim()

template<class T >
void TPZDiffMatrix< T >::Redim ( const int64_t  rows,
const int64_t  cols 
)
inline

◆ Reset()

template<class T >
void TPZDiffMatrix< T >::Reset ( )
inline

Definition at line 436 of file pzdiffmatrix.h.

References ENoDecompose, and TPZDiffMatrix< T >::fDecomposed.

Referenced by TPZDiffMatrix< T >::TPZDiffMatrix().

◆ Rows()

template<class T >
int64_t TPZDiffMatrix< T >::Rows ( ) const
inline

◆ Substitution()

template<class T >
EStatus TPZDiffMatrix< T >::Substitution ( TPZDiffMatrix< T > *  B) const
inline

◆ Transpose()

template<class T >
TPZDiffMatrix< T > & TPZDiffMatrix< T >::Transpose ( TPZDiffMatrix< T > &  matrix)
inline

Transposes the matrix onto the parameter object.

Resizes it if necessary.

Definition at line 207 of file pzdiffmatrix.h.

References TPZDiffMatrix< T >::fCols, TPZDiffMatrix< T >::fRows, matrix, TPZDiffMatrix< T >::operator()(), and TPZDiffMatrix< T >::Redim().

Referenced by TPZArtDiff::RotMatrix(), and TPZDiffMatrix< T >::TPZDiffMatrix().

Member Data Documentation

◆ fCols

template<class T>
int64_t TPZDiffMatrix< T >::fCols
private

◆ fDecomposed

template<class T>
int TPZDiffMatrix< T >::fDecomposed
private

◆ fRows

template<class T>
int64_t TPZDiffMatrix< T >::fRows
private

◆ fStore

template<class T>
T* TPZDiffMatrix< T >::fStore
private

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