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

It is an equation array, generally in its decomposed form. Frontal. More...

#include <tpzeqnarray.h>

Collaboration diagram for TPZEqnArray< TVar >:
[legend]

Public Member Functions

void SetNonSymmetric ()
 Sets EqnArray to a non symmetric form. More...
 
void SetSymmetric ()
 Sets fSymmetric to the symmetric value. More...
 
int IsSymmetric ()
 Gets the symetry situation of EqnArray. More...
 
 TPZEqnArray ()
 Simple constructor. More...
 
 ~TPZEqnArray ()
 Simple desctructor. More...
 
void EqnForward (TPZFMatrix< TVar > &F, DecomposeType dec)
 Forward substitution on equations stored in EqnArray. More...
 
void EqnBackward (TPZFMatrix< TVar > &U, DecomposeType dec)
 Backward substitution on equations stored in EqnArray. More...
 
void Reset ()
 Resets data structure. More...
 
void BeginEquation (int eq)
 It starts an equation storage. More...
 
void AddTerm (int col, TVar val)
 Add a term to the current equation. More...
 
void EndEquation ()
 Ends the current equation. More...
 
void Read (char *inputfile)
 Reads from disk. More...
 
void Write (char *outputfile)
 Writes on disk. More...
 
void Print (const char *name, std::ostream &out)
 It prints all terms stored in TPZEqnArray. More...
 
void Write (FILE *outputfile)
 Writes to a file in binary mode. More...
 
void Read (FILE *inputfile)
 Reads from binary file generated by 'WriteBinary'. More...
 

Static Public Member Functions

static void main ()
 Static main function for testing. More...
 

Private Types

enum  MSymmetric { EIsUndefined, EIsSymmetric, EIsNonSymmetric }
 It defines two diferent types of storage Symmetric and NonSymmetric an also an undefined status. More...
 

Private Attributes

MSymmetric fSymmetric
 Indicates the symetry or not of the equationarray. More...
 
int fNumEq
 Number of equations. More...
 
TPZStack< int, 100 > fEqStart
 Equation start point index. More...
 
TPZStack< int, 100 > fEqNumber
 
TPZStack< TVar, 1000 > fEqValues
 Equations coefficients values. More...
 
TPZStack< int, 1000 > fIndex
 Line/Column number associated to each fEqValues values. More...
 
int fLastTerm
 Indicates the last used position in fEqValues. More...
 

Detailed Description

template<class TVar>
class TPZEqnArray< TVar >

It is an equation array, generally in its decomposed form. Frontal.

Author
Gustavo Longhin Would be saved and read from disk.
It contains a forward and a backward method.
It is sparce, symmetric or not.

Definition at line 36 of file tpzeqnarray.h.

Member Enumeration Documentation

◆ MSymmetric

template<class TVar>
enum TPZEqnArray::MSymmetric
private

It defines two diferent types of storage Symmetric and NonSymmetric an also an undefined status.

Enumerator
EIsUndefined 
EIsSymmetric 
EIsNonSymmetric 

Definition at line 39 of file tpzeqnarray.h.

Constructor & Destructor Documentation

◆ TPZEqnArray()

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

◆ ~TPZEqnArray()

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

Simple desctructor.

Definition at line 30 of file tpzeqnarray.cpp.

Member Function Documentation

◆ AddTerm()

template<class TVar>
void TPZEqnArray< TVar >::AddTerm ( int  col,
TVar  val 
)
inline

◆ BeginEquation()

template<class TVar >
void TPZEqnArray< TVar >::BeginEquation ( int  eq)

It starts an equation storage.

Parameters
eqIndicates what equation is beeing added to the stack

Definition at line 75 of file tpzeqnarray.cpp.

References TPZEqnArray< TVar >::fEqNumber, TPZEqnArray< TVar >::fNumEq, and TPZStack< T, NumExtAlloc >::Push().

Referenced by TPZFrontSym< TVar >::DecomposeOneEquation(), TPZFrontNonSym< TVar >::DecomposeOneEquation(), TPZEqnArray< TVar >::main(), and TPZFileEqnStorage< TVar >::main().

◆ EndEquation()

template<class TVar >
void TPZEqnArray< TVar >::EndEquation ( )

◆ EqnBackward()

template<class TVar >
void TPZEqnArray< TVar >::EqnBackward ( TPZFMatrix< TVar > &  U,
DecomposeType  dec 
)

Backward substitution on equations stored in EqnArray.

Parameters
UMatrix to execute a Forward substitution
decType of decomposition, depends on what method was used in its decomposition

Case LU - LDLT - Cholesky

Case Cholesky

Case LU - LDLT - Cholesky

Case Cholesky

Definition at line 93 of file tpzeqnarray.cpp.

References ECholesky, TPZEqnArray< TVar >::EIsNonSymmetric, TPZEqnArray< TVar >::EIsSymmetric, ELU, TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fNumEq, and TPZEqnArray< TVar >::IsSymmetric().

Referenced by TPZFileEqnStorage< TVar >::Backward(), TPZFrontSym< TVar >::main(), and TPZFrontNonSym< TVar >::main().

◆ EqnForward()

template<class TVar >
void TPZEqnArray< TVar >::EqnForward ( TPZFMatrix< TVar > &  F,
DecomposeType  dec 
)

Forward substitution on equations stored in EqnArray.

Parameters
FMatrix to execute a Forward substitution on
decType of decomposition, depends on what method was used in its decomposition

cholesky e lu

ldlt cholesky lu

finalizacao para ldlt

cholesky e lu

ldlt cholesky lu

Definition at line 131 of file tpzeqnarray.cpp.

References DebugStop, ECholesky, TPZEqnArray< TVar >::EIsNonSymmetric, TPZEqnArray< TVar >::EIsSymmetric, ELDLt, ELU, TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fNumEq, TPZEqnArray< TVar >::IsSymmetric(), and TPZVec< T >::NElements().

Referenced by TPZFileEqnStorage< TVar >::Forward(), TPZEqnArray< TVar >::main(), TPZFrontSym< TVar >::main(), and TPZFrontNonSym< TVar >::main().

◆ IsSymmetric()

template<class TVar >
int TPZEqnArray< TVar >::IsSymmetric ( )

Gets the symetry situation of EqnArray.

Definition at line 22 of file tpzeqnarray.cpp.

Referenced by TPZEqnArray< TVar >::EqnBackward(), and TPZEqnArray< TVar >::EqnForward().

◆ main()

template<class TVar >
void TPZEqnArray< TVar >::main ( )
static

◆ Print()

template<class TVar >
void TPZEqnArray< TVar >::Print ( const char *  name,
std::ostream &  out 
)

◆ Read() [1/2]

template<class TVar >
void TPZEqnArray< TVar >::Read ( char *  inputfile)

◆ Read() [2/2]

template<class TVar >
void TPZEqnArray< TVar >::Read ( FILE *  inputfile)

Reads from binary file generated by 'WriteBinary'.

Note
Also receives position and FILE for 'C' fread() function execution

Number of equations

Last term added

TPZStack fEqStart data

TPZStack fEqNumber data

TPZStack fIndex data

TPZStack fEqValues data

Definition at line 227 of file tpzeqnarray.cpp.

References DebugStop, TPZEqnArray< TVar >::EIsNonSymmetric, TPZEqnArray< TVar >::EIsSymmetric, TPZEqnArray< TVar >::fEqNumber, TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fLastTerm, TPZEqnArray< TVar >::fNumEq, TPZEqnArray< TVar >::fSymmetric, and TPZManVector< T, NumExtAlloc >::Resize().

◆ Reset()

template<class TVar >
void TPZEqnArray< TVar >::Reset ( )

◆ SetNonSymmetric()

template<class TVar >
void TPZEqnArray< TVar >::SetNonSymmetric ( )

Sets EqnArray to a non symmetric form.

Definition at line 18 of file tpzeqnarray.cpp.

Referenced by TPZFrontNonSym< TVar >::DecomposeEquations().

◆ SetSymmetric()

template<class TVar >
void TPZEqnArray< TVar >::SetSymmetric ( )

Sets fSymmetric to the symmetric value.

Definition at line 26 of file tpzeqnarray.cpp.

Referenced by TPZFrontSym< TVar >::DecomposeEquations().

◆ Write() [1/2]

template<class TVar >
void TPZEqnArray< TVar >::Write ( char *  outputfile)

Writes on disk.

Definition at line 65 of file tpzeqnarray.cpp.

Referenced by TPZFileEqnStorage< TVar >::AddEqnArray(), and TPZEqnArray< TVar >::AddTerm().

◆ Write() [2/2]

template<class TVar >
void TPZEqnArray< TVar >::Write ( FILE *  outputfile)

Writes to a file in binary mode.

Used by FileEqnStorage
Receives FILE and position to execute 'C' fwrite function

Number of equations

Last term added

TPZStack fEqStart data

TPZStack fEqNumber data

TPZStack fIndex data

TPZStack fEqValues data

Definition at line 190 of file tpzeqnarray.cpp.

References TPZEqnArray< TVar >::fEqNumber, TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fLastTerm, TPZEqnArray< TVar >::fNumEq, and TPZVec< T >::NElements().

Member Data Documentation

◆ fEqNumber

template<class TVar>
TPZStack< int , 100 > TPZEqnArray< TVar >::fEqNumber
private

◆ fEqStart

template<class TVar>
TPZStack< int , 100 > TPZEqnArray< TVar >::fEqStart
private

◆ fEqValues

template<class TVar>
TPZStack< TVar, 1000 > TPZEqnArray< TVar >::fEqValues
private

◆ fIndex

template<class TVar>
TPZStack< int , 1000 > TPZEqnArray< TVar >::fIndex
private

◆ fLastTerm

template<class TVar>
int TPZEqnArray< TVar >::fLastTerm
private

◆ fNumEq

template<class TVar>
int TPZEqnArray< TVar >::fNumEq
private

◆ fSymmetric

template<class TVar>
MSymmetric TPZEqnArray< TVar >::fSymmetric
private

Indicates the symetry or not of the equationarray.

Definition at line 118 of file tpzeqnarray.h.

Referenced by TPZEqnArray< TVar >::Read(), TPZEqnArray< TVar >::Reset(), and TPZEqnArray< TVar >::TPZEqnArray().


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