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