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

Contains the thread data for matrices divided in sub structures. More...

#include <tpzpairstructmatrix.h>

Collaboration diagram for TPZPairStructMatrix::ThreadData:
[legend]

Public Member Functions

 ThreadData (TPZStructMatrix *strmatrix, TPZMatrix< STATE > &mat1, TPZMatrix< STATE > &mat2, TPZFMatrix< STATE > &rhs)
 Initialize the mutex semaphores and others. More...
 
 ~ThreadData ()
 Destroy the mutex semaphores and others. More...
 
int NextElement ()
 Look for an element index which needs to be computed and put it on the stack. More...
 
void ComputedElementMatrix (int 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...
 
void PermuteScatter (TPZVec< int > &index)
 
void PermuteScatter (TPZVec< int64_t > &index)
 

Static Public Member Functions

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

Public Attributes

TPZStructMatrixfStrMatrix
 Current structmatrix object. More...
 
pthread_mutex_t fAccessElement
 Mutexes (to choose which element is next) More...
 
TPZSemaphore fAssembly1
 Semaphore (to wake up the first assembly thread) More...
 
TPZSemaphore fAssembly2
 Semaphore (to wake up the second assembly thread) More...
 
TPZMatrix< STATE > * fGlobMatrix1
 Global matrix1. More...
 
TPZMatrix< STATE > * fGlobMatrix2
 Global matrix2. More...
 
TPZFMatrix< STATE > * fGlobRhs
 Global rhs. More...
 
TPZVec< int > fPermuteScatter
 Vector which defines the permutation of all equations to internal equations. More...
 
std::map< int, std::pair< TPZAutoPointer< TPZElementMatrix >, TPZAutoPointer< TPZElementMatrix > > > fSubmitted1
 List of computed element matrices (autopointers?) More...
 
std::map< int, TPZAutoPointer< TPZElementMatrix > > fSubmitted2
 List of computed element matrices (autopointers?) More...
 
std::set< int > fProcessed1
 Elements which are being processed maintained by the first global matrix. More...
 
std::set< int > fProcessed2
 Elements which are being processed maintained by the second global matrix. More...
 
int fNextElement
 Current element. More...
 

Detailed Description

Contains the thread data for matrices divided in sub structures.

Definition at line 60 of file tpzpairstructmatrix.h.

Constructor & Destructor Documentation

◆ ThreadData()

TPZPairStructMatrix::ThreadData::ThreadData ( TPZStructMatrix strmatrix,
TPZMatrix< STATE > &  mat1,
TPZMatrix< STATE > &  mat2,
TPZFMatrix< STATE > &  rhs 
)

Initialize the mutex semaphores and others.

Definition at line 590 of file tpzpairstructmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.

◆ ~ThreadData()

TPZPairStructMatrix::ThreadData::~ThreadData ( )

Destroy the mutex semaphores and others.

Definition at line 598 of file tpzpairstructmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_DESTROY.

Member Function Documentation

◆ ComputedElementMatrix()

void TPZPairStructMatrix::ThreadData::ComputedElementMatrix ( int  iel,
TPZAutoPointer< TPZElementMatrix > &  ek,
TPZAutoPointer< TPZElementMatrix > &  ef 
)

Put the computed element matrices in the map.

Definition at line 868 of file tpzpairstructmatrix.cpp.

References fAccessElement, fAssembly1, fAssembly2, fSubmitted1, fSubmitted2, TPZSemaphore::Post(), PZ_PTHREAD_MUTEX_LOCK, and PZ_PTHREAD_MUTEX_UNLOCK.

Referenced by ThreadWork().

◆ NextElement()

int TPZPairStructMatrix::ThreadData::NextElement ( )

◆ PermuteScatter() [1/2]

void TPZPairStructMatrix::ThreadData::PermuteScatter ( TPZVec< int > &  index)

Definition at line 657 of file tpzpairstructmatrix.cpp.

References fPermuteScatter, and TPZVec< T >::NElements().

Referenced by ShouldCompute(), and ThreadAssembly2().

◆ PermuteScatter() [2/2]

void TPZPairStructMatrix::ThreadData::PermuteScatter ( TPZVec< int64_t > &  index)

Definition at line 666 of file tpzpairstructmatrix.cpp.

References fPermuteScatter, and TPZVec< T >::NElements().

◆ ShouldCompute()

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

Establish whether the element should be computed.

Definition at line 104 of file tpzpairstructmatrix.h.

References PermuteScatter(), and TPZStructMatrixBase::ShouldCompute().

Referenced by NextElement().

◆ ThreadAssembly1()

void * TPZPairStructMatrix::ThreadData::ThreadAssembly1 ( void *  threaddata)
static

◆ ThreadAssembly2()

void * TPZPairStructMatrix::ThreadData::ThreadAssembly2 ( void *  threaddata)
static

◆ ThreadWork()

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

Member Data Documentation

◆ fAccessElement

pthread_mutex_t TPZPairStructMatrix::ThreadData::fAccessElement

Mutexes (to choose which element is next)

Definition at line 69 of file tpzpairstructmatrix.h.

Referenced by ComputedElementMatrix(), NextElement(), ThreadAssembly1(), ThreadAssembly2(), ThreadData(), and ~ThreadData().

◆ fAssembly1

TPZSemaphore TPZPairStructMatrix::ThreadData::fAssembly1

Semaphore (to wake up the first assembly thread)

Definition at line 71 of file tpzpairstructmatrix.h.

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

◆ fAssembly2

TPZSemaphore TPZPairStructMatrix::ThreadData::fAssembly2

Semaphore (to wake up the second assembly thread)

Definition at line 73 of file tpzpairstructmatrix.h.

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

◆ fGlobMatrix1

TPZMatrix<STATE>* TPZPairStructMatrix::ThreadData::fGlobMatrix1

Global matrix1.

Definition at line 75 of file tpzpairstructmatrix.h.

Referenced by ThreadAssembly1().

◆ fGlobMatrix2

TPZMatrix<STATE>* TPZPairStructMatrix::ThreadData::fGlobMatrix2

Global matrix2.

Definition at line 77 of file tpzpairstructmatrix.h.

Referenced by ThreadAssembly2().

◆ fGlobRhs

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

Global rhs.

Definition at line 79 of file tpzpairstructmatrix.h.

Referenced by ThreadAssembly1().

◆ fNextElement

int TPZPairStructMatrix::ThreadData::fNextElement

Current element.

Definition at line 91 of file tpzpairstructmatrix.h.

Referenced by NextElement(), ThreadAssembly1(), and ThreadAssembly2().

◆ fPermuteScatter

TPZVec<int> TPZPairStructMatrix::ThreadData::fPermuteScatter

Vector which defines the permutation of all equations to internal equations.

Definition at line 81 of file tpzpairstructmatrix.h.

Referenced by TPZPairStructMatrix::MultiThread_Assemble(), and PermuteScatter().

◆ fProcessed1

std::set<int> TPZPairStructMatrix::ThreadData::fProcessed1

Elements which are being processed maintained by the first global matrix.

Definition at line 87 of file tpzpairstructmatrix.h.

Referenced by NextElement(), and ThreadAssembly1().

◆ fProcessed2

std::set<int> TPZPairStructMatrix::ThreadData::fProcessed2

Elements which are being processed maintained by the second global matrix.

Definition at line 89 of file tpzpairstructmatrix.h.

Referenced by NextElement(), and ThreadAssembly2().

◆ fStrMatrix

TPZStructMatrix* TPZPairStructMatrix::ThreadData::fStrMatrix

Current structmatrix object.

Definition at line 67 of file tpzpairstructmatrix.h.

Referenced by NextElement(), TPZPairStructMatrix::SetMaterialIds(), ThreadAssembly1(), ThreadAssembly2(), and ThreadWork().

◆ fSubmitted1

std::map<int, std::pair< TPZAutoPointer<TPZElementMatrix>, TPZAutoPointer<TPZElementMatrix> > > TPZPairStructMatrix::ThreadData::fSubmitted1

List of computed element matrices (autopointers?)

Definition at line 83 of file tpzpairstructmatrix.h.

Referenced by ComputedElementMatrix(), and ThreadAssembly1().

◆ fSubmitted2

std::map<int, TPZAutoPointer<TPZElementMatrix> > TPZPairStructMatrix::ThreadData::fSubmitted2

List of computed element matrices (autopointers?)

Definition at line 85 of file tpzpairstructmatrix.h.

Referenced by ComputedElementMatrix(), and ThreadAssembly2().


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