NeoPZ
|
Is a structural matrix with parallel techniques included. Structural Matrix Frontal. More...
#include <TPZParFrontStructMatrix.h>
Public Member Functions | |
TPZStructMatrix * | Clone () |
It clones a TPZStructMatrix. More... | |
TPZParFrontStructMatrix (TPZCompMesh *mesh) | |
Constructor passing as parameter a TPZCompMesh. More... | |
TPZParFrontStructMatrix (const TPZParFrontStructMatrix ©) | |
virtual | ~TPZParFrontStructMatrix () |
Destructor. More... | |
virtual TPZMatrix< STATE > * | CreateAssemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) |
Returns a pointer to TPZMatrix. More... | |
virtual void | Assemble (TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) |
Assemble a stiffness matrix. More... | |
Public Member Functions inherited from TPZFrontStructMatrix< front > | |
TPZFrontStructMatrix (TPZCompMesh *) | |
Class constructor < href="http://www.fec.unicamp.br/~longhin">link text < href="http://www.fec.unicamp.br/~phil">link text More... | |
TPZFrontStructMatrix (const TPZFrontStructMatrix ©) | |
virtual void | SetDecomposeType (DecomposeType dectype) |
Set the decomposition type. More... | |
virtual | ~TPZFrontStructMatrix () |
Class destructor. More... | |
TPZMatrix< STATE > * | Create () |
Returns a pointer to TPZMatrix<STATE> More... | |
void | AssembleNew (TPZMatrix< STATE > &stiffness, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) |
Assemble a stiffness matrix according to rhs. More... | |
void | AssembleElement (TPZCompEl *el, TPZElementMatrix &ek, TPZElementMatrix &ef, TPZMatrix< STATE > &stiffness, TPZFMatrix< STATE > &rhs) |
Computes element matrices. More... | |
void | SetQuiet (int quiet) |
Public Member Functions inherited from TPZStructMatrixOR | |
TPZStructMatrixOR () | |
TPZStructMatrixOR (TPZCompMesh *) | |
TPZStructMatrixOR (TPZAutoPointer< TPZCompMesh > cmesh) | |
TPZStructMatrixOR (const TPZStructMatrixOR ©) | |
virtual | ~TPZStructMatrixOR () |
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) |
virtual void | Assemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override |
Assemble the global right hand side. More... | |
int | ClassId () const override |
Define the class id associated with the class. More... | |
void | Read (TPZStream &buf, void *context) override |
read objects from the stream More... | |
void | Write (TPZStream &buf, int withclassid) const override |
Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More... | |
Public Member Functions inherited from TPZStructMatrixBase | |
virtual void | SetMesh (TPZCompMesh *) |
virtual void | SetMesh (TPZAutoPointer< TPZCompMesh >) |
virtual void | FilterEquations (TPZVec< int64_t > &origindex, TPZVec< int64_t > &destindex) const |
Filter out the equations which are out of the range. More... | |
virtual void | SetMaterialIds (const std::set< int > &materialids) |
Set the set of material ids which will be considered when assembling the system. More... | |
virtual void | SetNumThreads (int n) |
virtual int | GetNumThreads () const |
virtual void | SetEquationRange (int64_t mineq, int64_t maxeq) |
virtual bool | HasRange () const |
Verify if a range has been specified. More... | |
virtual TPZEquationFilter & | EquationFilter () |
access method for the equation filter More... | |
virtual int64_t | NReducedEquations () const |
number of equations after applying the filter More... | |
virtual TPZCompMesh * | Mesh () const |
Access method for the mesh pointer. More... | |
virtual bool | ShouldCompute (int matid) const |
Establish whether the element should be computed. More... | |
virtual const std::set< int > & | MaterialIds () |
Returns the material ids. More... | |
int | ClassId () const override |
Define the class id associated with the class. More... | |
void | Read (TPZStream &buf, void *context) override |
read objects from the stream More... | |
void | Write (TPZStream &buf, int withclassid) const override |
Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More... | |
virtual | ~TPZStructMatrixBase () |
Public Member Functions inherited from TPZSavable | |
TPZSavable () | |
virtual | ~TPZSavable () |
virtual std::list< std::map< std::string, uint64_t > > | VersionHistory () const |
virtual std::pair< std::string, uint64_t > | Version () const |
virtual bool | Compare (TPZSavable *copy, bool override=false) |
Compares the object for identity with the object pointed to, eventually copy the object. More... | |
virtual bool | Compare (TPZSavable *copy, bool override=false) const |
Compares the object for identity with the object pointed to, eventually copy the object. More... | |
Public Member Functions inherited from TPZRegisterClassId | |
template<typename T > | |
TPZRegisterClassId (int(T::*)() const) | |
TPZRegisterClassId ()=default | |
Static Public Member Functions | |
static int | main () |
static void * | ElementAssemble (void *t) |
It computes element matrices in an independent thread. More... | |
static void * | GlobalAssemble (void *t) |
It assembles element matrices in the global stiffness matrix, it is also executed in an independent thread. More... | |
Static Public Member Functions inherited from TPZFrontStructMatrix< front > | |
static int | main () |
Static Public Member Functions inherited from TPZSavable | |
static std::set< TPZRestoreClassBase * > & | RestoreClassSet () |
This static function guarantees that the gMap object is available when needed. More... | |
static std::map< int, TPZRestore_t > & | ClassIdMap () |
This static function guarantees that the gMap object is available when needed. More... | |
static std::pair< std::string, uint64_t > | NeoPZVersion () |
static void | Register (TPZRestoreClassBase *restore) |
static void | RegisterClassId (int classid, TPZRestore_t fun) |
static TPZSavable * | CreateInstance (const int &classId) |
Private Attributes | |
TPZAutoPointer< TPZGuiInterface > | fGuiInterface |
int64_t | fCurrentElement |
Current computed element. More... | |
int64_t | fCurrentAssembled |
Current assembled element in the global stiffness matrix. More... | |
int64_t | fNElements |
Total number of elements. More... | |
int | fMaxStackSize |
Maximum stack size allowed. More... | |
TPZMatrix< STATE > * | fStiffness |
Local pointer to stiffness matrix. More... | |
TPZFMatrix< STATE > * | fRhs |
Local pointer to load matrix. More... | |
TPZStack< int64_t > | felnum |
Stack containing elements to be assembled on Stiffness matrix. More... | |
TPZStack< TPZElementMatrix * > | fekstack |
TPZStack< TPZElementMatrix * > | fefstack |
Additional Inherited Members | |
Protected Member Functions inherited from TPZFrontStructMatrix< front > | |
void | GetNumElConnected (TPZVec< int > &numelconnected) |
Returns a vector containing all elements connected to a degree of freedom. More... | |
void | OrderElement () |
It is applied over fElementOrder putting it in the correct order. More... | |
void | AdjustSequenceNumbering () |
Resequence the connects according to the element order. More... | |
Protected Member Functions inherited from TPZStructMatrixOR | |
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. More... | |
virtual void | Serial_Assemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) |
Assemble the global right hand side. More... | |
virtual void | MultiThread_Assemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) |
Assemble the global right hand side. More... | |
virtual void | MultiThread_Assemble (TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) |
Assemble the global system of equations into the matrix which has already been created. More... | |
Protected Member Functions inherited from TPZStructMatrixBase | |
TPZStructMatrixBase () | |
TPZStructMatrixBase (const TPZStructMatrixBase &) | |
TPZStructMatrixBase (TPZCompMesh *) | |
TPZStructMatrixBase (TPZAutoPointer< TPZCompMesh >) | |
Protected Attributes inherited from TPZFrontStructMatrix< front > | |
TPZVec< int > | fElementOrder |
This vector contains an ordered list. More... | |
int | f_quiet |
DecomposeType | fDecomposeType |
Used Decomposition method. More... | |
Protected Attributes inherited from TPZStructMatrixBase | |
TPZCompMesh * | fMesh |
Pointer to the computational mesh from which the matrix will be generated. More... | |
TPZAutoPointer< TPZCompMesh > | fCompMesh |
Autopointer control of the computational mesh. More... | |
TPZEquationFilter | fEquationFilter |
Object which will determine which equations will be assembled. More... | |
std::set< int > | fMaterialIds |
Set of material ids to be considered. It is a private attribute. More... | |
int | fNumThreads |
Number of threads in Assemble process. More... | |
Is a structural matrix with parallel techniques included. Structural Matrix Frontal.
TPZParFrontStructMatrix is derived from TPZFrontStructMatrix. It uses TPZParFrontMatrix as its FrontalMatrix
Definition at line 42 of file TPZParFrontStructMatrix.h.
TPZParFrontStructMatrix< front >::TPZParFrontStructMatrix | ( | TPZCompMesh * | mesh | ) |
Constructor passing as parameter a TPZCompMesh.
mesh | Mesh to refer to |
Definition at line 61 of file TPZParFrontStructMatrix.cpp.
References TPZParFrontStructMatrix< front >::fMaxStackSize, and TPZStructMatrixBase::SetNumThreads().
TPZParFrontStructMatrix< front >::TPZParFrontStructMatrix | ( | const TPZParFrontStructMatrix< front > & | copy | ) |
Definition at line 68 of file TPZParFrontStructMatrix.cpp.
|
virtual |
Destructor.
Definition at line 73 of file TPZParFrontStructMatrix.cpp.
|
virtual |
Assemble a stiffness matrix.
stiffness | Stiffness matrix to assembled |
rhs | Vector containing loads |
guiInterface | pointer to user interface |
Rearange elements order
Reimplemented from TPZFrontStructMatrix< front >.
Definition at line 397 of file TPZParFrontStructMatrix.cpp.
References DebugStop, TPZParFrontStructMatrix< front >::ElementAssemble(), TPZParFrontStructMatrix< front >::fCurrentAssembled, TPZParFrontStructMatrix< front >::fCurrentElement, TPZParFrontStructMatrix< front >::fGuiInterface, TPZStructMatrixBase::fMesh, TPZParFrontStructMatrix< front >::fNElements, TPZStructMatrixBase::fNumThreads, TPZParFrontStructMatrix< front >::fRhs, TPZParFrontStructMatrix< front >::fStiffness, clarg::argT< T >::get_value(), TPZFrontMatrix< TVar, store, front >::GetFront(), TPZFrontStructMatrix< front >::GetNumElConnected(), TPZParFrontStructMatrix< front >::GlobalAssemble(), LOGPZ_DEBUG, TPZCompMesh::NElements(), TPZCompMesh::NEquations(), nthreads, TPZFrontStructMatrix< front >::OrderElement(), TPZCompMesh::Print(), TPZFront< TVar >::ProductTensorMTFinish(), TPZFront< TVar >::ProductTensorMTInitData(), PZ_PTHREAD_CREATE, PZ_PTHREAD_JOIN, test::res, TPZFrontMatrix< TVar, store, front >::SetNumElConnected(), clarg::arg_base::was_set(), and TPZParFrontMatrix< TVar, store, front >::WriteFile().
Referenced by TPZParFrontStructMatrix< front >::CreateAssemble().
|
virtual |
It clones a TPZStructMatrix.
Virtual function must return same type
Reimplemented from TPZFrontStructMatrix< front >.
Definition at line 79 of file TPZParFrontStructMatrix.cpp.
|
virtual |
Returns a pointer to TPZMatrix.
rhs | Load matrix |
guiInterface | pointer to user interface |
Reimplemented from TPZFrontStructMatrix< front >.
Definition at line 723 of file TPZParFrontStructMatrix.cpp.
References TPZParFrontStructMatrix< front >::Assemble(), ENoDecompose, TPZFrontStructMatrix< front >::fDecomposeType, TPZStructMatrixBase::fEquationFilter, TPZFrontMatrix< TVar, store, front >::GetFront(), TPZEquationFilter::NActiveEquations(), TPZFMatrix< TVar >::Redim(), and TPZFront< TVar >::SetDecomposeType().
|
static |
It computes element matrices in an independent thread.
It is passed as a parameter to the pthread_create() function.
It is a 'static void *' to be used by pthread_create
Lock mutex and search for an avilable element A global variable to be updated whenever a element is processed
Definition at line 87 of file TPZParFrontStructMatrix.cpp.
References TPZGuiInterface::AmIKilled(), TPZCompEl::CalcStiff(), TPZElementMatrix::EF, TPZElementMatrix::EK, TPZCompMesh::ElementVec(), TPZParFrontStructMatrix< front >::fCurrentElement, TPZParFrontStructMatrix< front >::fefstack, TPZParFrontStructMatrix< front >::fekstack, TPZFrontStructMatrix< front >::fElementOrder, TPZParFrontStructMatrix< front >::felnum, TPZParFrontStructMatrix< front >::fGuiInterface, TPZParFrontStructMatrix< front >::fMaxStackSize, TPZStructMatrixBase::fMesh, TPZParFrontStructMatrix< front >::fNElements, LOGPZ_DEBUG, TPZVec< T >::NElements(), num_threads, TPZStack< T, NumExtAlloc >::Push(), PZ_PTHREAD_COND_BROADCAST, PZ_PTHREAD_COND_WAIT, PZ_PTHREAD_MUTEX_LOCK, and PZ_PTHREAD_MUTEX_UNLOCK.
Referenced by TPZParFrontStructMatrix< front >::Assemble().
|
static |
It assembles element matrices in the global stiffness matrix, it is also executed in an independent thread.
It is passed as a parameter to the pthread_create() function.
It is a 'static void *' to be used by pthread_create
Lock mutex and search for an available element A global variable to be updated whenever a element is processed
Definition at line 235 of file TPZParFrontStructMatrix.cpp.
References TPZGuiInterface::AmIKilled(), TPZFrontStructMatrix< front >::AssembleElement(), TPZCompMesh::ElementVec(), TPZParFrontStructMatrix< front >::fCurrentAssembled, TPZParFrontStructMatrix< front >::fCurrentElement, TPZParFrontStructMatrix< front >::fefstack, TPZParFrontStructMatrix< front >::fekstack, TPZFrontStructMatrix< front >::fElementOrder, TPZParFrontStructMatrix< front >::felnum, TPZParFrontStructMatrix< front >::fGuiInterface, TPZParFrontMatrix< TVar, store, front >::FinishWriting(), TPZParFrontStructMatrix< front >::fMaxStackSize, TPZStructMatrixBase::fMesh, TPZParFrontStructMatrix< front >::fNElements, TPZParFrontStructMatrix< front >::fRhs, TPZParFrontStructMatrix< front >::fStiffness, TPZMaterial::Id(), LOGPZ_DEBUG, TPZCompEl::Material(), TPZVec< T >::NElements(), TPZStack< T, NumExtAlloc >::Pop(), PZ_PTHREAD_COND_BROADCAST, PZ_PTHREAD_COND_WAIT, PZ_PTHREAD_MUTEX_LOCK, PZ_PTHREAD_MUTEX_UNLOCK, and TPZStructMatrixBase::ShouldCompute().
Referenced by TPZParFrontStructMatrix< front >::Assemble().
|
static |
Used only for testing
Definition at line 545 of file TPZParFrontStructMatrix.cpp.
References TPZCompMesh::AutoBuild(), TPZCompMesh::Block(), TPZGeoMesh::BuildConnectivity(), TPZCompMesh::ConnectVec(), TPZMaterial::CreateBC(), TPZGeoMesh::CreateGeoElement(), DebugStop, ECholesky, EQuadrilateral, TPZConnect::HasDependency(), TPZCompMesh::InitializeBlock(), TPZCompMesh::InsertMaterialObject(), TPZConnect::IsCondensed(), TPZChunkVector< T, EXP >::NElements(), TPZCompMesh::NEquations(), TPZBlock< TVar >::Position(), TPZCompMesh::Print(), TPZAnalysis::Print(), TPZAnalysis::Run(), TPZConnect::SequenceNumber(), TPZCompMesh::SetDefaultOrder(), TPZStepSolver< TVar >::SetDirect(), TPZMat2dLin::SetMaterial(), TPZStructMatrixBase::SetNumThreads(), TPZAnalysis::SetSolver(), TPZAnalysis::SetStructuralMatrix(), TPZBlock< TVar >::Size(), and test::threads.
|
private |
Current assembled element in the global stiffness matrix.
Definition at line 96 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Current computed element.
Definition at line 94 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), TPZParFrontStructMatrix< front >::ElementAssemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Definition at line 114 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::ElementAssemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Definition at line 113 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::ElementAssemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Stack containing elements to be assembled on Stiffness matrix.
ElementAssemble pushes elements on the stack.
GlobalAssemble pops elements from the stack.
Definition at line 112 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::ElementAssemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Definition at line 46 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), TPZParFrontStructMatrix< front >::ElementAssemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Maximum stack size allowed.
Whenever this value is reached a execution of element computing is suspended
Definition at line 101 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::ElementAssemble(), TPZParFrontStructMatrix< front >::GlobalAssemble(), and TPZParFrontStructMatrix< front >::TPZParFrontStructMatrix().
|
private |
Total number of elements.
Definition at line 98 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), TPZParFrontStructMatrix< front >::ElementAssemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Local pointer to load matrix.
Definition at line 105 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().
|
private |
Local pointer to stiffness matrix.
Definition at line 103 of file TPZParFrontStructMatrix.h.
Referenced by TPZParFrontStructMatrix< front >::Assemble(), and TPZParFrontStructMatrix< front >::GlobalAssemble().