6 #ifndef TPZStructMatrixOR_H 7 #define TPZStructMatrixOR_H 11 #include <semaphore.h> 101 unsigned numthreads_assemble,
unsigned numthreads_decompose) {
111 unsigned numthreads_assemble,
unsigned numthreads_decompose) {
112 std::cout <<
"Nothing to do." << std::endl;
int ClassId() const override
Define the class id associated with the class.
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
TPZAutoPointer< TPZGuiInterface > fGuiInterface
Gui interface object.
Contains declaration of the TPZSemaphore class which implements semaphore to threads.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
Implements semaphore to threads. Utility.
Structure to manipulate thread to solve system equations.
virtual ~TPZStructMatrixOR()
Templated vector implementation.
pthread_mutex_t fAccessElement
Mutexes (to choose which element is next)
Contains declaration of TPZGuiInterface class.
TPZFMatrix< STATE > * fGlobRhs
Global rhs vector.
~ThreadData()
Destructor: Destroy the mutex semaphores and others.
std::map< int, std::pair< TPZAutoPointer< TPZElementMatrix >, TPZAutoPointer< TPZElementMatrix > > > fSubmitted
List of computed element matrices (autopointers?)
static void * ThreadWork(void *threaddata)
The function which will compute the matrices.
virtual void Assemble(TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
Refines geometrical mesh (all the elements) num times.
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
virtual const std::set< int > & MaterialIds()
Returns the material ids.
virtual TPZStructMatrixOR * Clone() override
int64_t fNextElement
Current element.
ThreadData(TPZStructMatrixOR *strmat, TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, std::set< int > &MaterialIds, TPZAutoPointer< TPZGuiInterface > guiInterface)
Initialize the mutex semaphores and others.
TPZStructMatrixOR * fStruct
Current structmatrix object.
Contains TPZMatrixclass which implements full matrix (using column major representation).
virtual void SetNumThreads(int n)
TPZMatrix< STATE > * fGlobMatrix
Global matrix.
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.
int64_t NextElement()
Look for an element index which needs to be computed and put it on the stack.
virtual void MultiThread_Assemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
Assemble the global right hand side.
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.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
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.
Contains TPZMatrix<TVar>class, root matrix class.
static void * ThreadAssembly(void *threaddata)
The function which will compute the assembly.
bool ShouldCompute(int matid)
Establish whether the element should be computed.
std::set< int > fProcessed
Elements which are being processed.
TPZSemaphore fAssembly
Semaphore (to wake up assembly thread)
Implements computational mesh. Computational Mesh.
Defines the interface for saving and reading data. Persistency.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void ComputedElementMatrix(int64_t iel, TPZAutoPointer< TPZElementMatrix > &ek, TPZAutoPointer< TPZElementMatrix > &ef)
Put the computed element matrices in the map.
virtual TPZMatrix< STATE > * CreateAssemble(TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose)
virtual TPZMatrix< STATE > * Create() override