NeoPZ
pzsolve.cpp
Go to the documentation of this file.
1 
6 #include "pzlog.h"
7 #ifdef LOG4CXX
8 static LoggerPtr logger(Logger::getLogger("pz.matrix.tpzmatred"));
9 #endif
10 
11 #include "pzsolve.h"
12 #include "TPZPersistenceManager.h"
13 
14 #include <stdlib.h>
15 using namespace std;
16 
18 template <class TVar>
20 {
21 }
22 
23 template <class TVar>
25 fScratch()
26 {
27  fContainer = Refmat;
28 }
29 
30 template<class TVar>
32 fScratch()
33 {
34 }
35 
36 template <class TVar>
38 fScratch()
39 {
41  fContainer = Source.fContainer;
42 }
43 
44 template <class TVar>
46 {
47 }
48 
49 template <class TVar>
51 {
53  fContainer = reset;
54 }
55 
56 template <class TVar>
58 {
59  if (this == &other)
60  return;
61  fContainer = other.fContainer;
62 }
63 
64 template <class TVar>
65 void TPZMatrixSolver<TVar>::Write(TPZStream &buf, int withclassid) const {
66 #ifdef LOG4CXX
67  {
68  std::stringstream sout;
69  sout << "Entering " << __PRETTY_FUNCTION__;
70  LOGPZ_DEBUG(logger, sout.str());
71  }
72 #endif
73  TPZSolver<TVar>::Write(buf, withclassid);
74  if (fContainer) {
75 #ifdef LOG4CXX
76  {
77  std::stringstream sout;
78  sout << "fContainer AutoPointer valid on " << __PRETTY_FUNCTION__;
79  LOGPZ_DEBUG(logger, sout.str());
80  }
81 #endif
82  }
84 
85  if (fReferenceMatrix) {
86 #ifdef LOG4CXX
87  {
88  std::stringstream sout;
89  sout << "fReferenceMatrix AutoPointer valid! It Shouldn't ! Expect Trouble " << __PRETTY_FUNCTION__;
90  LOGPZ_WARN(logger, sout.str());
91  }
92 #endif
93  }
95 
96 #ifdef LOG4CXX
97  {
98  std::stringstream sout;
99  sout << "Leaving" << __PRETTY_FUNCTION__;
100  LOGPZ_DEBUG(logger, sout.str());
101  }
102 #endif
103 }
104 
105 template <class TVar>
106 void TPZMatrixSolver<TVar>::Read(TPZStream &buf, void *context)
107 {
108  TPZSolver<TVar>::Read(buf,context);
109  fContainer = TPZAutoPointerDynamicCast<TPZMatrix<TVar>>(TPZPersistenceManager::GetAutoPointer(&buf));
110  fReferenceMatrix = TPZAutoPointerDynamicCast<TPZMatrix<TVar>>(TPZPersistenceManager::GetAutoPointer(&buf));
111 }
112 
113 template class TPZMatrixSolver<float>;
114 template class TPZMatrixSolver<std::complex<float> >;
115 
116 template class TPZMatrixSolver<double>;
117 template class TPZMatrixSolver<std::complex<double> >;
118 
119 template class TPZMatrixSolver<long double>;
void ResetMatrix() override
Resets current object.
Definition: pzsolve.cpp:50
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
void ShareMatrix(TPZMatrixSolver< TVar > &other)
Shares the current matrix with another object of same type.
Definition: pzsolve.cpp:57
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: pzsolve.cpp:65
Defines a class of matrix solvers. Solver.
Definition: pzanalysis.h:24
virtual void Read(TPZStream &buf, void *context)
read objects from the stream
Definition: TPZSavable.cpp:61
#define LOGPZ_WARN(A, B)
Define log for warnings.
Definition: pzlog.h:91
TPZAutoPointer< TPZMatrix< TVar > > fReferenceMatrix
Reference matrix used to update the current matrix.
Definition: pzsolve.h:165
static TPZAutoPointer< TPZSavable > GetAutoPointer(const int64_t &objId)
virtual ~TPZMatrixSolver()
Destructor.
Definition: pzsolve.cpp:45
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
Definition: pzlog.h:87
void Read(TPZStream &buf, void *context) override
read objects from the stream
Definition: pzsolve.cpp:106
virtual void Write(TPZStream &buf, int withclassid) const
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Definition: TPZSavable.cpp:47
TPZFMatrix< TVar > fScratch
Manipulation matrix.
Definition: pzsolve.h:169
virtual ~TPZSolver()
Destructor.
Definition: pzsolve.cpp:19
Contains TPZSolver class which defines a abstract class of solvers which will be used by matrix class...
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
TPZAutoPointer< TPZMatrix< TVar > > fContainer
Container classes.
Definition: pzsolve.h:162
Root matrix class (abstract). Matrix.
Definition: pzmatrix.h:60
This class implements a reference counter mechanism to administer a dynamically allocated object...