63 void Redim(
const int64_t rows,
const int64_t cols);
89 T &
operator()(
const int64_t i,
const int64_t j = 0);
91 void PutVal(
const int64_t row,
const int64_t col,
const T & value );
93 const T &
GetVal(
const int64_t row,
const int64_t col )
const;
114 const int64_t varOffset,
const int64_t dim,
128 const int64_t dim,
TPZVec<T> & Divergent,
143 int64_t
index(
const int64_t i,
const int64_t j)
const;
155 std::ostream & operator<<(std::ostream & out, TPZDiffMatrix<T> & A)
158 out <<
"\nTPZDiffMatrix<> " << A.Rows() <<
" * " << A.Cols();
159 for(i=0;i<A.Rows();i++)
162 for(j=0;j<A.Cols();j++)
164 out <<
" " << A(i,j);
203 for(;i>=0;i--)
fStore[i]=T(0.);
223 PZError <<
"\nTPZDiffMatrix<T>::index error: row out of bounds\n";
228 PZError <<
"\nTPZDiffMatrix<T>::index error: col out of bounds\n";
258 if(In.
NElements()!=
fCols)
PZError <<
"\nTPZDiffMatrix<T>::Multiply error: 'In' vector out of bounds\n";
276 if(
fCols!=In.
fRows)
PZError <<
"\nTPZDiffMatrix<T>::Multiply error: 'In' matrix out of bounds\n";
281 for(j=0;j<In.
fCols;j++)
298 if(
fCols!=In.
fRows)
PZError <<
"\nTPZDiffMatrix<T>::MultiplyAdd error: 'In' matrix out of bounds\n";
304 for(j=0;j<In.
fCols;j++)
320 if(
fRows!=matrix.
fRows)
PZError <<
"\nTPZDiffMatrix<T>::Add error: row out of bounds\n";
321 if(
fCols!=matrix.
fCols)
PZError <<
"\nTPZDiffMatrix<T>::add error: col out of bounds\n";
339 int64_t nstate = dim+2;
340 if(gradx.
NElements()!=(nstate)*dim)
PZError <<
"\nTPZDiffMatrix<T>::AddAlignDiv error: gradx vector of wrong size\n";
341 if(Divergent.
NElements()!=nstate )
PZError <<
"\nTPZDiffMatrix<T>::AddAlignDiv error: Divergent vector of wrong size\n";
344 for(i=0;i<nstate;i++)
346 for(j=0;j<nstate;j++)Divergent[i]+=
operator()(i,j)*gradx[j*dim+varOffset];
353 int64_t nstate = dim+2;
354 if( U.
NElements()!=nstate)
PZError <<
"\nTPZDiffMatrix<T>::AddDiv error: U vector of wrong size\n";
355 if(Divergent.
NElements()!=nstate)
PZError <<
"\nTPZDiffMatrix<T>::AddDiv error: Divergent vector of wrong size\n";
358 for(i=0;i<nstate;i++)
360 for(j=0;j<nstate;j++)
386 PZError <<
"\npzdiffmatrix.h Attempting to decompose an already decomposed matrix\n";
393 for ( int64_t k = 0; k < min ; k++ ) {
395 for ( int64_t i = k+1; i <
Rows(); i++ ) {
396 nn =
GetVal( i, k ) / pivot;
408 int64_t rowb = B->
Rows();
409 int64_t colb = B->
Cols();
410 if ( rowb !=
Rows() )
413 for ( i = 0; i < rowb; i++ ) {
414 for ( int64_t col = 0; col < colb; col++ ) {
415 for ( int64_t j = 0; j < i; j++ ) {
420 for (int64_t col=0; col<colb; col++) {
421 for ( i = rowb-1; i >= 0; i-- ) {
422 for ( int64_t j = i+1; j < rowb ; j++ ) {
TPZDiffMatrix< T > & operator=(const TPZDiffMatrix< T > &source)
Copies the matrix, reallocating all coefficients.
void PutVal(const int64_t row, const int64_t col, const T &value)
void Add(TPZDiffMatrix< T > &matrix, const T &scale=T(1.))
Adds element by element.
int64_t index(const int64_t i, const int64_t j) const
bool IsZero(long double a)
Returns if the value a is close Zero as the allowable tolerance.
void AddDiv(T &dPhi, TPZVec< T > &U, const int64_t dim, TPZVec< T > &Divergent, TPZDiffMatrix< T > &dDivergent)
Computes the divergent for diffusion purposes.
const T & GetVal(const int64_t row, const int64_t col) const
TPZDiffMatrix(const TPZDiffMatrix ©)
TPZDiffMatrix< T > & Transpose(TPZDiffMatrix< T > &matrix)
Transposes the matrix onto the parameter object.
This class implements a simple vector storage scheme for a templated class T. Utility.
EStatus Substitution(TPZDiffMatrix< T > *B) const
void MultiplyAdd(TPZDiffMatrix< T > &In, TPZDiffMatrix< T > &Out, const T &scale=T(1.))
Matrix multiplication.
TPZSkylMatrix< REAL > matrix
void Redim(const int64_t rows, const int64_t cols)
Resizes and zeroes the matrix.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
void AddAlignDiv(TPZVec< T > &gradx, const int64_t varOffset, const int64_t dim, TPZVec< T > &Divergent)
Performs a specific diffusive divergence operation.
#define DebugStop()
Returns a message to user put a breakpoint in.
Contains TPZMatrix<TVar>class, root matrix class.
void Multiply(TPZVec< T > &In, TPZVec< T > &Out, const T &scale=T(1.))
Multiplies the matrix by a correspondent TPZVec vector. Dimensions are checked.
Matrix class to hold the flux derivatives A B C and diffusive matrix coefficients. Matrix.
int64_t NElements() const
Returns the number of elements of the vector.
T & operator()(const int64_t i, const int64_t j=0)
Matrix data access.
#define PZError
Defines the output device to error messages and the DebugStop() function.