6 #ifndef TPZStructMatrixGC_H 7 #define TPZStructMatrixGC_H 11 #include <semaphore.h> 51 unsigned numthreads_assemble,
unsigned numthreads_decompose) {
63 unsigned numthreads_assemble,
unsigned numthreads_decompose) {
64 std::cout <<
"Nothing to do." << std::endl;
virtual void Serial_Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
Assemble the global system of equations into the matrix which has already been created.
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override
Assemble the global system of equations into the matrix which has already been created.
virtual TPZStructMatrixGC * Clone() override
Contains declaration of the TPZSemaphore class which implements semaphore to threads.
TPZStructMatrixGC * fStruct
Current structmatrix object.
virtual TPZMatrix< STATE > * Create() override
Implements semaphore to threads. Utility.
std::map< int, std::pair< TPZAutoPointer< TPZElementMatrix >, TPZAutoPointer< TPZElementMatrix > > > fSubmitted
List of computed element matrices (autopointers?)
std::map< int, int > felBlocked
int ClassId() const override
Define the class id associated with the class.
static void * ThreadWorkResidual(void *datavoid)
static void ElementColoring(TPZCompMesh *cmesh, TPZVec< int64_t > &elSequence, TPZVec< int64_t > &elSequenceColor, TPZVec< int64_t > &elBlocked)
Create blocks of elements to parallel processing.
void Read(TPZStream &buf, void *context) override
read objects from the stream
Templated vector implementation.
Contains declaration of TPZGuiInterface class.
static void * ThreadWork(void *threaddata)
The function which will compute the matrices.
int64_t fNextElement
Current element.
TPZSemaphore fAssembly
Semaphore (to wake up assembly thread)
virtual void MultiThread_Assemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
Assemble the global right hand side.
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
virtual const std::set< int > & MaterialIds()
Returns the material ids.
TPZVec< int64_t > * felSequenceColor
Contains TPZMatrixclass which implements full matrix (using column major representation).
Structure to manipulate thread to solve system equations.
virtual void SetNumThreads(int n)
static void OrderElement(TPZCompMesh *cmesh, TPZVec< int64_t > &ElementOrder)
Find the order to assemble the elements.
pthread_cond_t fCondition
TPZMatrix< STATE > * fGlobMatrix
Global matrix.
ThreadData(TPZStructMatrixGC *strmat, TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, std::set< int > &MaterialIds, TPZAutoPointer< TPZGuiInterface > guiInterface)
Initialize the mutex semaphores and others.
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
TPZAutoPointer< TPZGuiInterface > fGuiInterface
Gui interface object.
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
virtual bool ShouldCompute(int matid) const
Establish whether the element should be computed.
TPZVec< int64_t > * fnextBlocked
Vector for mesh coloring.
TPZVec< int64_t > fnextBlocked
Vectors for mesh coloring.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Refines geometrical mesh (all the elements) num times.
Contains TPZMatrix<TVar>class, root matrix class.
virtual ~TPZStructMatrixGC()
~ThreadData()
Destructor: Destroy the mutex semaphores and others.
Implements computational mesh. Computational Mesh.
pthread_mutex_t fAccessElement
Mutexes (to choose which element is next)
Defines the interface for saving and reading data. Persistency.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
std::set< int > fProcessed
Elements which are being processed.
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
TPZFMatrix< STATE > * fGlobRhs
Global rhs vector.
bool ShouldCompute(int matid)
The function which will compute the assembly.