9 #ifndef TPZDOHRMATRIX_H 10 #define TPZDOHRMATRIX_H 29 template <
class TVar,
class TSubStruct>
34 typedef typename std::list<TPZAutoPointer<TSubStruct> >
SubsList;
55 fAssembly(cp.fAssembly)
86 return (*fGlobal.begin());
91 out << __PRETTY_FUNCTION__ << std::endl;
92 out << name << std::endl;
93 out <<
"Number of coarse equations " << fNumCoarse << std::endl;
94 typename SubsList::const_iterator iter;
95 for (iter=fGlobal.begin();iter!=fGlobal.end();iter++) {
109 fGlobal.push_back(substruct);
158 template <
class TVar,
class TSubStruct>
167 template <
class TSubStruct>
201 template <
class TVar,
class TSubStruct>
213 std::list<TPZDohrThreadMultData<TSubStruct> >
fWork;
218 fAssembly(assembly), fAssemblyStructure(assemblestruct)
228 static void *ThreadWork(
void *voidptr);
233 fWork.push_back(data);
242 result = *fWork.begin();
void AdjustResidual(TPZFMatrix< TVar > &res)
Adjust the residual to zero the residual of the internal connects.
#define PZ_PTHREAD_MUTEX_UNLOCK(mutex, fn)
const TPZFMatrix< TVar > * fInput
The vector with which we will multiply.
Assembling using Dohrmann algorithm. Sub structure.
virtual TPZMatrix< TVar > * Clone() const override
std::list< TPZDohrThreadMultData< TSubStruct > > fWork
The list of data objects which need to treated by the threads.
Contains the TPZDohrSubstruct class which implements sub structure matrices using Dohrman algorithm...
MatrixOutputFormat
Defines output format.
void Read(TPZStream &buf, void *context) override
Unpacks the object structure from a stream of bytes.
TPZAutoPointer< TPZDohrAssembleList< TVar > > fAssemblyStructure
The local contribution to the v2 vector.
void SetNumCornerEqs(int nc)
void AddSubstruct(TPZAutoPointer< TSubStruct > substruct)
It adds a substruct.
TPZDohrThreadMultList(const TPZFMatrix< TVar > &x, TVar alpha, TPZAutoPointer< TPZDohrAssembly< TVar > > assembly, TPZAutoPointer< TPZDohrAssembleList< TVar > > &assemblestruct)
TPZDohrThreadMultData< TSubStruct > & operator=(const TPZDohrThreadMultData< TSubStruct > &cp)
Implement the attribution operator.
Implements a matrix divided into substructures. Matrix Sub structure.
Contains the TPZDohrAssembly class which implements assembling using Dohrmann algorithm.
virtual void MultAddTBB(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt) const
It computes z = beta * y + alpha * opt(this)*x but z and x can not overlap in memory.
Contains the TPZDohrAssembleItem and TPZDohrAssembleList structs to assembling using Dohrman algorith...
TPZAutoPointer< TSubStruct > GetFirstSub()
Just a method for tests.
TPZDohrThreadMultData(int isub, TPZAutoPointer< TSubStruct > submesh)
TVar fAlpha
Scalar multiplication factor.
#define PZ_PTHREAD_MUTEX_LOCK(mutex, fn)
void Print(const char *name, std::ostream &out, const MatrixOutputFormat form=EFormatted) const override
Just a method for tests.
TPZDohrThreadMultData(const TPZDohrThreadMultData< TSubStruct > &cp)
Copy constructor.
int fNumThreads
Number of threads that will be used during the matrix vector multiplication.
void AddItem(TPZDohrThreadMultData< TSubStruct > &data)
Interface to add items in a thread safe way.
List of items to assembling using Dohrmann algorithm.
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
#define PZ_PTHREAD_MUTEX_DESTROY(mutex, fn)
Contains the TPZDohrSubstructCondense class which condenses matrix divided in sub structures...
void SetNumThreads(int numthreads)
TPZAutoPointer< TPZDohrAssembly< TVar > > fAssembly
The data structure which defines the assemble destinations.
void AddInternalSolution(TPZFMatrix< TVar > &solution)
Add the solution corresponding to the internal residual.
virtual void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt) const override
Full matrix class. Matrix.
TPZDohrMatrix(const TPZDohrMatrix &cp)
int32_t Hash(std::string str)
Contains TPZMatrix<TVar>class, root matrix class.
TPZDohrThreadMultData< TSubStruct > PopItem()
Interface to pop an item in a thread safe way.
TPZAutoPointer< TSubStruct > fSub
TPZDohrThreadMultData()
Default constructor.
std::list< TPZAutoPointer< TSubStruct > > SubsList
The matrix class is a placeholder for a list of substructures.
const SubsList & SubStructures() const
void Write(TPZStream &buf, int withclassid) const override
Packs the object structure in a stream of bytes.
int ClassId() const override
Routines to send and receive messages.
Defines the interface for saving and reading data. Persistency.
void Initialize()
Initialize the necessary datastructures.
#define PZ_PTHREAD_MUTEX_INIT(mutex, attr, fn)
TPZAutoPointer< TPZDohrAssembly< TVar > > fAssembly
pthread_mutex_t fAccessLock
Mutex which will enable the access protection of the list.
int ClassId() const override
Define the class id associated with the class.
Root matrix class (abstract). Matrix.
This class implements a reference counter mechanism to administer a dynamically allocated object...