7 #ifndef TPZDOHRPRECOND_H 8 #define TPZDOHRPRECOND_H 18 #include <semaphore.h> 31 template <
class TVar,
class TSubStruct>
35 std::list<TPZAutoPointer<TSubStruct> >
fGlobal;
63 std::list<TPZAutoPointer<TSubStruct> > &
Global()
127 template <
class TVar,
class TSubStruct>
137 template <
class TVar,
class TSubStruct>
143 fInput(&input), fOutput(&output)
164 template <
class TVar,
class TSubStruct>
172 fInput_local(res_local)
178 fv2_local(copy.fv2_local)
192 return fSubStructure;
213 template <
class TVar,
class TSubStruct>
217 PZ_PTHREAD_MUTEX_INIT(&fAccessLock, 0,
"TPZDohrPrecondV2SubDataList::TPZDohrPrecondV2SubDataList()");
228 std::list<TPZDohrPrecondV2SubData<TVar, TSubStruct> >
fWork;
234 fWork.push_back(data);
243 result = *fWork.begin();
254 static void *ThreadWork(
void *voidptr);
TPZAutoPointer< TPZFMatrix< TVar > > fInput_local
Input matrix.
TPZDohrPrecondThreadV1Data(const TPZDohrPrecond< TVar, TSubStruct > *ptr, const TPZFMatrix< TVar > &input, TPZFMatrix< TVar > &output)
#define PZ_PTHREAD_MUTEX_UNLOCK(mutex, fn)
Assembling using Dohrmann algorithm. Sub structure.
const TPZDohrPrecond< TVar, TSubStruct > * fDohrMatrix
Pointer to the dohr matrix.
~TPZDohrPrecondV2SubDataList()
Auxiliar structure for v2 vector to compute the preconditioner developed by Dohrmann. Sub Structure.
void ComputeV2(const TPZFMatrix< TVar > &x, TPZFMatrix< TVar > &v2) const
Compute the contribution of the sub domains.
Contains the TPZDohrSubstruct class which implements sub structure matrices using Dohrman algorithm...
pthread_mutex_t fAccessLock
Mutex which will enable the access protection of the list.
Auxiliar structure with list for v2 vector data. Sub Structure.
Defines a abstract class of solvers which will be used by matrix classes. Solver. ...
Defines step solvers class. Solver.
TPZDohrPrecondV2SubDataList(TPZAutoPointer< TPZDohrAssembleList< TVar > > &assemble)
TPZAutoPointer< TSubStruct > fSubStructure
Pointer to the dohr matrix.
Contains the TPZDohrMatrix class which implements a matrix divided into substructures. Also contains the TPZDohrThreadMultData and TPZDohrThreadMultList structs.
virtual TPZMatrix< TVar > * Clone() const override
int64_t fNumCoarse
Size of the coarse system.
clarg::argString input("-if", "input file", "cube1.txt")
TPZDohrPrecondV2SubData(const TPZDohrPrecondV2SubData< TVar, TSubStruct > ©)
Implements a matrix divided into substructures. Matrix Sub structure.
TPZDohrPrecondV2SubData & operator=(const TPZDohrPrecondV2SubData ©)
Contains the TPZDohrAssembly class which implements assembling using Dohrmann algorithm.
std::list< TPZAutoPointer< TSubStruct > > fGlobal
The matrix class is a placeholder for a list of substructures.
TPZDohrPrecondV2SubData(int subindex, const TPZAutoPointer< TSubStruct > &substruct, TPZAutoPointer< TPZFMatrix< TVar > > res_local)
Contains the TPZDohrAssembleItem and TPZDohrAssembleList structs to assembling using Dohrman algorith...
int fNumThreads
Number of threads used during preconditioning.
std::list< TPZAutoPointer< TSubStruct > > & Global()
The matrix class is a placeholder for a list of substructures.
TPZAutoPointer< TPZDohrAssembleItem< TVar > > fv2_local
The local contribution to the v2 vector.
void AddItem(TPZDohrPrecondV2SubData< TVar, TSubStruct > &data)
Interface to add items in a thread safe way.
Implements a matrix which computes the preconditioner developed by Dohrmann. Sub Structure.
TPZDohrPrecondV2SubData< TVar, TSubStruct > PopItem()
Interface to pop an item in a thread safe way.
#define PZ_PTHREAD_MUTEX_LOCK(mutex, fn)
static void * ComputeV1(void *dataptr)
Compute the contribution of the coarse matrix.
TPZDohrPrecondV2SubData()
int ClassId() const override
Routines to send and receive messages.
TPZAutoPointer< TPZDohrAssembleList< TVar > > fAssemblyStructure
The local contribution to the v2 vector.
To assembling one item using Dohrmann algorithm. Sub structure.
std::list< TPZDohrPrecondV2SubData< TVar, TSubStruct > > fWork
The list of structures which need to be computed.
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)
TPZDohrPrecondThreadV1Data()
Full matrix class. Matrix.
const TPZFMatrix< TVar > * fInput
Input matrix.
virtual void MultAddTBB(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha, const TVar beta, const int opt) const
int32_t Hash(std::string str)
void SetNumThreads(int numthreads)
Contains TPZMatrix<TVar>class, root matrix class.
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
The only method any matrix class needs to implement.
Auxiliar structure with thread to compute the preconditioner developed by Dohrmann. Sub Structure.
~TPZDohrPrecondV2SubData()
TPZDohrPrecond()
Empty constructor for restoring.
void Read(TPZStream &buf, void *context) override
Unpacks the object structure from a stream of bytes.
void Write(TPZStream &buf, int withclassid) const override
Packs the object structure in a stream of bytes.
void ComputeV1(const TPZFMatrix< TVar > &x, TPZFMatrix< TVar > &v1) const
Compute the contribution of the coarse matrix.
Defines the interface for saving and reading data. Persistency.
#define PZ_PTHREAD_MUTEX_INIT(mutex, attr, fn)
TPZStepSolver< TVar > * fCoarse
The global matrix associated with the coarse degrees of freedom.
void Initialize()
Initialize the necessary datastructures.
TPZAutoPointer< TPZDohrAssembly< TVar > > fAssemble
void SetSolver(TPZSolver< TVar > &solver)
Specify the solution process for the coarse matrix.
TPZFMatrix< TVar > * fOutput
Matrix where the coarse solution will be contributed.
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...