NeoPZ
|
It is an equation array, generally in its decomposed form. Frontal. More...
#include <tpzeqnarray.h>
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... | |
It is an equation array, generally in its decomposed form. Frontal.
Definition at line 36 of file tpzeqnarray.h.
|
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.
TPZEqnArray< TVar >::TPZEqnArray | ( | ) |
Simple constructor.
Definition at line 34 of file tpzeqnarray.cpp.
References TPZEqnArray< TVar >::EIsUndefined, TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fLastTerm, TPZEqnArray< TVar >::fNumEq, TPZEqnArray< TVar >::fSymmetric, and TPZStack< T, NumExtAlloc >::Push().
TPZEqnArray< TVar >::~TPZEqnArray | ( | ) |
Simple desctructor.
Definition at line 30 of file tpzeqnarray.cpp.
|
inline |
Add a term to the current equation.
col | The collumn position of val |
val | The value beeing added itself. |
Definition at line 83 of file tpzeqnarray.h.
References TPZEqnArray< TVar >::EndEquation(), TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fLastTerm, TPZEqnArray< TVar >::Print(), TPZStack< T, NumExtAlloc >::Push(), TPZEqnArray< TVar >::Read(), and TPZEqnArray< TVar >::Write().
Referenced by TPZFrontSym< TVar >::DecomposeOneEquation(), TPZFrontNonSym< TVar >::DecomposeOneEquation(), TPZEqnArray< TVar >::main(), and TPZFileEqnStorage< TVar >::main().
void TPZEqnArray< TVar >::BeginEquation | ( | int | eq | ) |
It starts an equation storage.
eq | Indicates 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().
void TPZEqnArray< TVar >::EndEquation | ( | ) |
Ends the current equation.
Definition at line 70 of file tpzeqnarray.cpp.
References TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fLastTerm, and TPZStack< T, NumExtAlloc >::Push().
Referenced by TPZEqnArray< TVar >::AddTerm(), TPZFrontSym< TVar >::DecomposeOneEquation(), TPZFrontNonSym< TVar >::DecomposeOneEquation(), TPZEqnArray< TVar >::main(), and TPZFileEqnStorage< TVar >::main().
void TPZEqnArray< TVar >::EqnBackward | ( | TPZFMatrix< TVar > & | U, |
DecomposeType | dec | ||
) |
Backward substitution on equations stored in EqnArray.
U | Matrix to execute a Forward substitution |
dec | Type 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().
void TPZEqnArray< TVar >::EqnForward | ( | TPZFMatrix< TVar > & | F, |
DecomposeType | dec | ||
) |
Forward substitution on equations stored in EqnArray.
F | Matrix to execute a Forward substitution on |
dec | Type 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().
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().
|
static |
Static main function for testing.
Definition at line 287 of file tpzeqnarray.cpp.
References TPZEqnArray< TVar >::AddTerm(), TPZEqnArray< TVar >::BeginEquation(), TPZFMatrix< TVar >::Decompose_Cholesky(), ECholesky, TPZEqnArray< TVar >::EndEquation(), TPZEqnArray< TVar >::EqnForward(), stats::filename, TPZEqnArray< TVar >::Print(), TPZMatrix< TVar >::Print(), TPZEqnArray< TVar >::Reset(), and TPZMatrix< TVar >::Subst_Forward().
void TPZEqnArray< TVar >::Print | ( | const char * | name, |
std::ostream & | out | ||
) |
It prints all terms stored in TPZEqnArray.
Definition at line 42 of file tpzeqnarray.cpp.
References TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fNumEq, and TPZVec< T >::NElements().
Referenced by TPZEqnArray< TVar >::AddTerm(), TPZEqnArray< TVar >::main(), TPZFrontSym< TVar >::main(), TPZFrontNonSym< TVar >::main(), and TPZFileEqnStorage< TVar >::Print().
void TPZEqnArray< TVar >::Read | ( | char * | inputfile | ) |
Reads from disk.
Definition at line 67 of file tpzeqnarray.cpp.
Referenced by TPZEqnArray< TVar >::AddTerm(), TPZFileEqnStorage< TVar >::Backward(), TPZFileEqnStorage< TVar >::Forward(), and TPZFileEqnStorage< TVar >::Print().
void TPZEqnArray< TVar >::Read | ( | FILE * | inputfile | ) |
Reads from binary file generated by 'WriteBinary'.
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().
void TPZEqnArray< TVar >::Reset | ( | ) |
Resets data structure.
Definition at line 81 of file tpzeqnarray.cpp.
References TPZEqnArray< TVar >::EIsUndefined, TPZEqnArray< TVar >::fEqStart, TPZEqnArray< TVar >::fEqValues, TPZEqnArray< TVar >::fIndex, TPZEqnArray< TVar >::fLastTerm, TPZEqnArray< TVar >::fNumEq, TPZEqnArray< TVar >::fSymmetric, TPZStack< T, NumExtAlloc >::Push(), and TPZManVector< T, NumExtAlloc >::Resize().
Referenced by TPZFrontSym< TVar >::DecomposeEquations(), TPZFrontNonSym< TVar >::DecomposeEquations(), and TPZEqnArray< TVar >::main().
void TPZEqnArray< TVar >::SetNonSymmetric | ( | ) |
Sets EqnArray to a non symmetric form.
Definition at line 18 of file tpzeqnarray.cpp.
Referenced by TPZFrontNonSym< TVar >::DecomposeEquations().
void TPZEqnArray< TVar >::SetSymmetric | ( | ) |
Sets fSymmetric to the symmetric value.
Definition at line 26 of file tpzeqnarray.cpp.
Referenced by TPZFrontSym< TVar >::DecomposeEquations().
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().
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().
|
private |
Definition at line 126 of file tpzeqnarray.h.
Referenced by TPZEqnArray< TVar >::BeginEquation(), TPZEqnArray< TVar >::Read(), and TPZEqnArray< TVar >::Write().
|
private |
Equation start point index.
Definition at line 125 of file tpzeqnarray.h.
Referenced by TPZEqnArray< TVar >::EndEquation(), TPZEqnArray< TVar >::EqnBackward(), TPZEqnArray< TVar >::EqnForward(), TPZEqnArray< TVar >::Print(), TPZEqnArray< TVar >::Read(), TPZEqnArray< TVar >::Reset(), TPZEqnArray< TVar >::TPZEqnArray(), and TPZEqnArray< TVar >::Write().
|
private |
Equations coefficients values.
Definition at line 129 of file tpzeqnarray.h.
Referenced by TPZEqnArray< TVar >::AddTerm(), TPZEqnArray< TVar >::EqnBackward(), TPZEqnArray< TVar >::EqnForward(), TPZEqnArray< TVar >::Print(), TPZEqnArray< TVar >::Read(), TPZEqnArray< TVar >::Reset(), and TPZEqnArray< TVar >::Write().
|
private |
Line/Column number associated to each fEqValues values.
Definition at line 132 of file tpzeqnarray.h.
Referenced by TPZEqnArray< TVar >::AddTerm(), TPZEqnArray< TVar >::EqnBackward(), TPZEqnArray< TVar >::EqnForward(), TPZEqnArray< TVar >::Print(), TPZEqnArray< TVar >::Read(), TPZEqnArray< TVar >::Reset(), and TPZEqnArray< TVar >::Write().
|
private |
Indicates the last used position in fEqValues.
Definition at line 135 of file tpzeqnarray.h.
Referenced by TPZEqnArray< TVar >::AddTerm(), TPZEqnArray< TVar >::EndEquation(), TPZEqnArray< TVar >::Read(), TPZEqnArray< TVar >::Reset(), TPZEqnArray< TVar >::TPZEqnArray(), and TPZEqnArray< TVar >::Write().
|
private |
Number of equations.
Definition at line 122 of file tpzeqnarray.h.
Referenced by TPZEqnArray< TVar >::BeginEquation(), TPZEqnArray< TVar >::EqnBackward(), TPZEqnArray< TVar >::EqnForward(), TPZEqnArray< TVar >::Print(), TPZEqnArray< TVar >::Read(), TPZEqnArray< TVar >::Reset(), TPZEqnArray< TVar >::TPZEqnArray(), and TPZEqnArray< TVar >::Write().
|
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().