NeoPZ
TPZFileEqnStorage.h
Go to the documentation of this file.
1 
6 #ifndef TPZFILEEQNSTORAGE_H
7 #define TPZFILEEQNSTORAGE_H
8 
9 #include "tpzeqnarray.h"
10 #include "pzstack.h"
11 #include "pzstack.h"
12 #include "tpzeqnarray.h"
13 #include "pzfmatrix.h"
18 /*
19  * It has methods for operating over a set of equations. \n
20  * The arrays of equations are in the form of a binary files of EqnArrays.
21  */
22 template<class TVar>
23 class TPZFileEqnStorage : public TPZSavable {
24 public:
26  void ReOpen();
27 
29  void Zero();
31  void ReadBlockPositions();
33  void FinishWriting();
35  //void SetFileName(const char *name);
36 
42  void OpenGeneric(char option, const char * name);
43 
48 
50  static void main();
51 
59  TPZFileEqnStorage(char option, const std::string &name);
60 
65  void AddEqnArray(TPZEqnArray<TVar> *EqnArray);
66 
72  void Print(const char *name, std::ostream& out) const;
73 
75  void Reset();
81  void Backward(TPZFMatrix<TVar> &f, DecomposeType dec) const;
82 
88  void Forward(TPZFMatrix<TVar> &f, DecomposeType dec) const;
89 
96  void Store(int ieq, int jeq, const char *name);
97 
99  void WriteHeaders();
100 
102  std::string GetStorage();
103 
104  public:
105  int ClassId() const override;
106 
107 private:
109  //TPZStack<int64_t> fSubBlockIndex;
110 
113 
116 
118  std::string fFileName;
119 
121  FILE *fIOStream;
128 };
129 
130 template<class TVar>
132  return Hash("TPZFileEqnStorage") ^ ClassIdOrHash<TVar>() << 1;
133 }
134 
135 #endif //TPZFILEEQNSTORAGE_H
Has the same porpouse of EqnStack but stores the EqnArrays in a different form (binary files)...
void ReadBlockPositions()
Method used for binary input/output.
void Forward(TPZFMatrix< TVar > &f, DecomposeType dec) const
Executes a Forward substitution.
It is an equation array, generally in its decomposed form. Frontal.
Definition: tpzeqnarray.h:36
void Backward(TPZFMatrix< TVar > &f, DecomposeType dec) const
Executes a Backward substitution.
int fNumBlocks
Used with binary input/output aritimethics.
void OpenGeneric(char option, const char *name)
Sets file name and if it is for input or output, the second term can be either &#39;r&#39; for input and &#39;w&#39; ...
Contains the TPZEqnArray class which implements an equation array.
std::string fFileName
file name containing binary data
f
Definition: test.py:287
std::string GetStorage()
Type of Storage.
~TPZFileEqnStorage()
Simple destructor.
TPZFileEqnStorage()
Simple constructor.
TPZStack< int64_t > fBlockPos
Stack containing block positions.
Contains TPZMatrixclass which implements full matrix (using column major representation).
void Print(const char *name, std::ostream &out) const
It prints TPZEqnStorage data.
Full matrix class. Matrix.
Definition: pzfmatrix.h:32
void Reset()
Resets data.
A simple stack.
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
int fNumHeaders
Indicates the number of headers for the object.
void AddEqnArray(TPZEqnArray< TVar > *EqnArray)
Adds an EqnArray.
FILE * fIOStream
binary file itself
void Store(int ieq, int jeq, const char *name)
Stores from ieq to jeq equations on a binary file.
int fCurrentBlock
Used with binary input/output aritimethics.
int ClassId() const override
Define the class id associated with the class.
void WriteHeaders()
Writes the header of the binary file.
void ReOpen()
Reopens an binary file with its current fFileName.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Definition: TPZSavable.h:67
void Zero()
Reinitialize the object.
int fCurBlockPosition
Used with binary input/output aritimethics.
void FinishWriting()
Method used for binary input/output.
DecomposeType
Defines decomposition type for any matrix classes.
Definition: pzmatrix.h:52