NeoPZ
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
TPZStructMatrixOR::ThreadData Struct Reference

Structure to manipulate thread to solve system equations. More...

#include <pzstrmatrix.h>

Collaboration diagram for TPZStructMatrixOR::ThreadData:
[legend]

Public Member Functions

 ThreadData (TPZStructMatrixOR *strmat, TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, std::set< int > &MaterialIds, TPZAutoPointer< TPZGuiInterface > guiInterface)
 Initialize the mutex semaphores and others. More...
 
 ThreadData (TPZStructMatrixOR *strmat, TPZFMatrix< STATE > &rhs, std::set< int > &MaterialIds, TPZAutoPointer< TPZGuiInterface > guiInterface)
 Initialize the mutex semaphores and others. More...
 
 ~ThreadData ()
 Destructor: Destroy the mutex semaphores and others. More...
 
int64_t NextElement ()
 Look for an element index which needs to be computed and put it on the stack. More...
 
void ComputedElementMatrix (int64_t iel, TPZAutoPointer< TPZElementMatrix > &ek, TPZAutoPointer< TPZElementMatrix > &ef)
 Put the computed element matrices in the map. More...
 
bool ShouldCompute (int matid)
 Establish whether the element should be computed. More...
 

Static Public Member Functions

static void * ThreadWork (void *threaddata)
 The function which will compute the matrices. More...
 
static void * ThreadAssembly (void *threaddata)
 The function which will compute the assembly. More...
 

Public Attributes

TPZStructMatrixORfStruct
 Current structmatrix object. More...
 
TPZAutoPointer< TPZGuiInterfacefGuiInterface
 Gui interface object. More...
 
TPZMatrix< STATE > * fGlobMatrix
 Global matrix. More...
 
TPZFMatrix< STATE > * fGlobRhs
 Global rhs vector. More...
 
std::map< int, std::pair< TPZAutoPointer< TPZElementMatrix >, TPZAutoPointer< TPZElementMatrix > > > fSubmitted
 List of computed element matrices (autopointers?) More...
 
std::set< int > fProcessed
 Elements which are being processed. More...
 
int64_t fNextElement
 Current element. More...
 
pthread_mutex_t fAccessElement
 Mutexes (to choose which element is next) More...
 
TPZSemaphore fAssembly
 Semaphore (to wake up assembly thread) More...
 

Detailed Description

Structure to manipulate thread to solve system equations.

Definition at line 40 of file pzstrmatrix.h.

Constructor & Destructor Documentation

◆ ThreadData() [1/2]

TPZStructMatrixOR::ThreadData::ThreadData ( TPZStructMatrixOR strmat,
TPZMatrix< STATE > &  mat,
TPZFMatrix< STATE > &  rhs,
std::set< int > &  MaterialIds,
TPZAutoPointer< TPZGuiInterface guiInterface 
)

Initialize the mutex semaphores and others.

Definition at line 527 of file pzstrmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.

◆ ThreadData() [2/2]

TPZStructMatrixOR::ThreadData::ThreadData ( TPZStructMatrixOR strmat,
TPZFMatrix< STATE > &  rhs,
std::set< int > &  MaterialIds,
TPZAutoPointer< TPZGuiInterface guiInterface 
)

Initialize the mutex semaphores and others.

Definition at line 572 of file pzstrmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.

◆ ~ThreadData()

TPZStructMatrixOR::ThreadData::~ThreadData ( )

Destructor: Destroy the mutex semaphores and others.

Definition at line 604 of file pzstrmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_DESTROY.

Member Function Documentation

◆ ComputedElementMatrix()

void TPZStructMatrixOR::ThreadData::ComputedElementMatrix ( int64_t  iel,
TPZAutoPointer< TPZElementMatrix > &  ek,
TPZAutoPointer< TPZElementMatrix > &  ef 
)

Put the computed element matrices in the map.

Definition at line 886 of file pzstrmatrix.cpp.

References fAccessElement, fAssembly, fSubmitted, TPZSemaphore::Post(), PZ_PTHREAD_MUTEX_LOCK, and PZ_PTHREAD_MUTEX_UNLOCK.

Referenced by ThreadWork().

◆ NextElement()

int64_t TPZStructMatrixOR::ThreadData::NextElement ( )

◆ ShouldCompute()

bool TPZStructMatrixOR::ThreadData::ShouldCompute ( int  matid)
inline

Establish whether the element should be computed.

Definition at line 57 of file pzstrmatrix.h.

References fStruct, and TPZStructMatrixBase::ShouldCompute().

◆ ThreadAssembly()

void * TPZStructMatrixOR::ThreadData::ThreadAssembly ( void *  threaddata)
static

◆ ThreadWork()

void * TPZStructMatrixOR::ThreadData::ThreadWork ( void *  threaddata)
static

Member Data Documentation

◆ fAccessElement

pthread_mutex_t TPZStructMatrixOR::ThreadData::fAccessElement

Mutexes (to choose which element is next)

Definition at line 77 of file pzstrmatrix.h.

Referenced by ComputedElementMatrix(), NextElement(), ThreadAssembly(), ThreadData(), ThreadWork(), and ~ThreadData().

◆ fAssembly

TPZSemaphore TPZStructMatrixOR::ThreadData::fAssembly

Semaphore (to wake up assembly thread)

Definition at line 79 of file pzstrmatrix.h.

Referenced by ComputedElementMatrix(), ThreadAssembly(), and ThreadWork().

◆ fGlobMatrix

TPZMatrix<STATE>* TPZStructMatrixOR::ThreadData::fGlobMatrix

Global matrix.

Definition at line 67 of file pzstrmatrix.h.

Referenced by ThreadAssembly(), and ThreadWork().

◆ fGlobRhs

TPZFMatrix<STATE>* TPZStructMatrixOR::ThreadData::fGlobRhs

Global rhs vector.

Definition at line 69 of file pzstrmatrix.h.

Referenced by ThreadAssembly().

◆ fGuiInterface

TPZAutoPointer<TPZGuiInterface> TPZStructMatrixOR::ThreadData::fGuiInterface

Gui interface object.

Definition at line 65 of file pzstrmatrix.h.

Referenced by ThreadAssembly(), and ThreadWork().

◆ fNextElement

int64_t TPZStructMatrixOR::ThreadData::fNextElement

Current element.

Definition at line 75 of file pzstrmatrix.h.

Referenced by NextElement(), and ThreadAssembly().

◆ fProcessed

std::set<int> TPZStructMatrixOR::ThreadData::fProcessed

Elements which are being processed.

Definition at line 73 of file pzstrmatrix.h.

Referenced by NextElement(), and ThreadAssembly().

◆ fStruct

TPZStructMatrixOR* TPZStructMatrixOR::ThreadData::fStruct

Current structmatrix object.

Definition at line 63 of file pzstrmatrix.h.

Referenced by NextElement(), ShouldCompute(), ThreadAssembly(), and ThreadWork().

◆ fSubmitted

std::map<int, std::pair< TPZAutoPointer<TPZElementMatrix>, TPZAutoPointer<TPZElementMatrix> > > TPZStructMatrixOR::ThreadData::fSubmitted

List of computed element matrices (autopointers?)

Definition at line 71 of file pzstrmatrix.h.

Referenced by ComputedElementMatrix(), and ThreadAssembly().


The documentation for this struct was generated from the following files: