NeoPZ
tpzeqnarray.h
Go to the documentation of this file.
1 
8 #ifndef TPZEQNARRAY_H
9 #define TPZEQNARRAY_H
10 
11 #include "pzmatrix.h"
12 #include "pzstack.h"
13 #include "pzfmatrix.h"
14 #include "pzreal.h"
15 #include "pzmanvector.h"
16 #include "pzvec.h"
17 
18 #include <stdlib.h>
19 
20 #ifdef BORLAND
21 #include <stdio.h>
22 #endif
23 
35 template<class TVar>
36 class TPZEqnArray {
37 
40 
41 public:
43  static void main();
44 
46  void SetNonSymmetric();
47 
49  void SetSymmetric();
50 
52  int IsSymmetric();
53 
55  TPZEqnArray();
57  ~TPZEqnArray();
70 
72  void Reset();
77  void BeginEquation(int eq);
83  void AddTerm(int col, TVar val)
84  {
85  fIndex.Push(col);
86  fEqValues.Push(val);
87  fLastTerm++;
88  }
90  void EndEquation();
91 
93  void Read(char * inputfile);
94 
96  void Write(char * outputfile);
97 
99  void Print(const char * name, std::ostream & out);
100 
107  void Write(FILE * outputfile);
108 
113  void Read(FILE * inputfile);
114 
115 private:
116 
119 
120 
122  int fNumEq;
123 
127 
130 
133 
136 };
137 
138 #endif //TPZEQNARRAY_H
TPZStack< int, 100 > fEqNumber
Definition: tpzeqnarray.h:126
void EqnForward(TPZFMatrix< TVar > &F, DecomposeType dec)
Forward substitution on equations stored in EqnArray.
TPZStack< int, 100 > fEqStart
Equation start point index.
Definition: tpzeqnarray.h:125
int fLastTerm
Indicates the last used position in fEqValues.
Definition: tpzeqnarray.h:135
It is an equation array, generally in its decomposed form. Frontal.
Definition: tpzeqnarray.h:36
static void main()
Static main function for testing.
Templated vector implementation.
void Write(char *outputfile)
Writes on disk.
Definition: tpzeqnarray.cpp:65
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
void BeginEquation(int eq)
It starts an equation storage.
Definition: tpzeqnarray.cpp:75
MSymmetric
It defines two diferent types of storage Symmetric and NonSymmetric an also an undefined status...
Definition: tpzeqnarray.h:39
void Print(const char *name, std::ostream &out)
It prints all terms stored in TPZEqnArray.
Definition: tpzeqnarray.cpp:42
void Read(char *inputfile)
Reads from disk.
Definition: tpzeqnarray.cpp:67
void Push(const T object)
Pushes a copy of the object on the stack.
Definition: pzstack.h:80
int fNumEq
Number of equations.
Definition: tpzeqnarray.h:122
Contains TPZMatrixclass which implements full matrix (using column major representation).
void EqnBackward(TPZFMatrix< TVar > &U, DecomposeType dec)
Backward substitution on equations stored in EqnArray.
Definition: tpzeqnarray.cpp:93
Free store vector implementation.
void Reset()
Resets data structure.
Definition: tpzeqnarray.cpp:81
void SetNonSymmetric()
Sets EqnArray to a non symmetric form.
Definition: tpzeqnarray.cpp:18
void SetSymmetric()
Sets fSymmetric to the symmetric value.
Definition: tpzeqnarray.cpp:26
void AddTerm(int col, TVar val)
Add a term to the current equation.
Definition: tpzeqnarray.h:83
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
A simple stack.
Contains TPZMatrix<TVar>class, root matrix class.
MSymmetric fSymmetric
Indicates the symetry or not of the equationarray.
Definition: tpzeqnarray.h:118
void EndEquation()
Ends the current equation.
Definition: tpzeqnarray.cpp:70
TPZStack< TVar, 1000 > fEqValues
Equations coefficients values.
Definition: tpzeqnarray.h:129
TPZEqnArray()
Simple constructor.
Definition: tpzeqnarray.cpp:34
~TPZEqnArray()
Simple desctructor.
Definition: tpzeqnarray.cpp:30
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
TPZStack< int, 1000 > fIndex
Line/Column number associated to each fEqValues values.
Definition: tpzeqnarray.h:132
int IsSymmetric()
Gets the symetry situation of EqnArray.
Definition: tpzeqnarray.cpp:22
DecomposeType
Defines decomposition type for any matrix classes.
Definition: pzmatrix.h:52