NeoPZ
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends | List of all members

Implements structural matrix divided in sub structures. Structural Matrix Sub structure. More...

#include <pzdohrstructmatrix.h>

Inheritance diagram for TPZDohrStructMatrix:
[legend]
Collaboration diagram for TPZDohrStructMatrix:
[legend]

Public Member Functions

 TPZDohrStructMatrix (TPZAutoPointer< TPZCompMesh > compmesh)
 We assume that the mesh consists of subcompmeshes. More...
 
 TPZDohrStructMatrix (const TPZDohrStructMatrix &copy)
 Copy constructors. More...
 
virtual ~TPZDohrStructMatrix ()
 
void SubStructure (int nsub)
 Partition the mesh in submeshes. More...
 
virtual TPZMatrix< STATE > * Create () override
 This will create a DohrMatrix. More...
 
TPZAutoPointer< TPZMatrix< STATE > > Preconditioner ()
 This will return the pointer to the preconditioner AND abandon the pointer. More...
 
virtual TPZMatrix< STATE > * CreateAssemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose) override
 This will create a DohrMatrix and compute its matrices. More...
 
virtual void Assemble (TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose) override
 Assemble the global system of equations into the matrix which has already been created. More...
 
void AssembleTBB (TPZMatrix< STATE > &mat, TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
 
virtual void Assemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override
 Assemble the global right hand side. More...
 
virtual TPZStructMatrixClone () override
 Creates a copy of itself. More...
 
int NumberCornerEqs () const
 Return the number of cornereqs. More...
 
TPZAutoPointer< TPZDohrAssembly< STATE > > Assembly ()
 
int SeparateUnconnected (TPZVec< int > &domain_index, int nsub, int connectdimension)
 Verifies if the subdomains are connected by sides of connectdimension and separate them if not. More...
 
int ClusterIslands (TPZVec< int > &domain_index, int nsub, int connectdimension)
 Eliminates subdomains who are embedded in other subdomains. More...
 
void Write (TPZStream &str, int withclassid) const override
 Writes this object to the TPZStream buffer. Include the classid if withclassid = true. More...
 
void Read (TPZStream &str, void *context) override
 read objects from the stream More...
 
void IdentifyExternalConnectIndexes ()
 Identify the external connects. More...
 
- Public Member Functions inherited from TPZStructMatrixOR
 TPZStructMatrixOR ()
 
 TPZStructMatrixOR (TPZCompMesh *)
 
 TPZStructMatrixOR (TPZAutoPointer< TPZCompMesh > cmesh)
 
 TPZStructMatrixOR (const TPZStructMatrixOR &copy)
 
virtual ~TPZStructMatrixOR ()
 
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. More...
 
int ClassId () const override
 Define the class id associated with the class. More...
 
- Public Member Functions inherited from TPZStructMatrixBase
virtual void SetMesh (TPZCompMesh *)
 
virtual void SetMesh (TPZAutoPointer< TPZCompMesh >)
 
virtual TPZMatrix< STATE > * CreateAssemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface)
 
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 TPZEquationFilterEquationFilter ()
 access method for the equation filter More...
 
virtual int64_t NReducedEquations () const
 number of equations after applying the filter More...
 
virtual TPZCompMeshMesh () 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...
 
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
 

Protected Member Functions

void IdentifyEqNumbers (TPZSubCompMesh *sub, std::map< int, int > &global, std::map< int, int > &globinv)
 
void ComputeInternalEquationPermutation (TPZSubCompMesh *sub, TPZVec< int > &scatterpermute, TPZVec< int > &gatherpermute)
 Computes the permutation vectors from the subcompmesh ordening to the "internal first" ordering. More...
 
void IdentifySubCornerEqs (std::map< int, int > &globaltolocal, TPZVec< int > &cornereqs, TPZVec< int > &coarseindex)
 Identify the corner equations associated with a substructure. More...
 
void CorrectNeighbourDomainIndex (TPZCompMesh *cmesh, TPZVec< int > &domainindex)
 Set the domain index of the lower dimension elements equal to the domain index of their neighbour. 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

TPZAutoPointer< TPZDohrAssembly< STATE > > fDohrAssembly
 
TPZAutoPointer< TPZMatrix< STATE > > fDohrPrecond
 
- Protected Attributes inherited from TPZStructMatrixBase
TPZCompMeshfMesh
 Pointer to the computational mesh from which the matrix will be generated. More...
 
TPZAutoPointer< TPZCompMeshfCompMesh
 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...
 

Private Member Functions

 TPZDohrStructMatrix ()
 
void IdentifyCornerNodes ()
 Identify cornernodes. More...
 

Private Attributes

TPZManVector< int > fExternalConnectIndexes
 The connect indexes which are external. More...
 
std::set< int > fCornerEqs
 The global equations defining the coarse matrix. More...
 
pthread_mutex_t fAccessElement
 Mutexes (to choose which submesh is next) More...
 
friend TPZPersistenceManager
 

Friends

struct ThreadDohrmanAssembly< STATE >
 

Additional Inherited Members

- 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 TPZSavableCreateInstance (const int &classId)
 

Detailed Description

Implements structural matrix divided in sub structures. Structural Matrix Sub structure.

Author
Philippe Devloo
Since
28/06/2010

Definition at line 22 of file pzdohrstructmatrix.h.

Constructor & Destructor Documentation

◆ TPZDohrStructMatrix() [1/3]

TPZDohrStructMatrix::TPZDohrStructMatrix ( TPZAutoPointer< TPZCompMesh compmesh)

We assume that the mesh consists of subcompmeshes.

Definition at line 81 of file pzdohrstructmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.

◆ TPZDohrStructMatrix() [2/3]

TPZDohrStructMatrix::TPZDohrStructMatrix ( const TPZDohrStructMatrix copy)

Copy constructors.

Definition at line 88 of file pzdohrstructmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.

◆ ~TPZDohrStructMatrix()

TPZDohrStructMatrix::~TPZDohrStructMatrix ( )
virtual

Definition at line 94 of file pzdohrstructmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_DESTROY.

◆ TPZDohrStructMatrix() [3/3]

TPZDohrStructMatrix::TPZDohrStructMatrix ( )
private

Definition at line 75 of file pzdohrstructmatrix.cpp.

References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.

Referenced by Clone().

Member Function Documentation

◆ Assemble() [1/2]

void TPZDohrStructMatrix::Assemble ( TPZMatrix< STATE > &  mat,
TPZFMatrix< STATE > &  rhs,
TPZAutoPointer< TPZGuiInterface guiInterface,
unsigned  numthreads_assemble,
unsigned  numthreads_decompose 
)
overridevirtual

◆ Assemble() [2/2]

void TPZDohrStructMatrix::Assemble ( TPZFMatrix< STATE > &  rhs,
TPZAutoPointer< TPZGuiInterface guiInterface 
)
overridevirtual

◆ AssembleTBB()

void TPZDohrStructMatrix::AssembleTBB ( TPZMatrix< STATE > &  mat,
TPZFMatrix< STATE > &  rhs,
TPZAutoPointer< TPZGuiInterface guiInterface 
)

◆ Assembly()

TPZAutoPointer<TPZDohrAssembly<STATE> > TPZDohrStructMatrix::Assembly ( )
inline

Definition at line 82 of file pzdohrstructmatrix.h.

References ClusterIslands(), fDohrAssembly, Read(), SeparateUnconnected(), and Write().

Referenced by only_assemble().

◆ Clone()

virtual TPZStructMatrix* TPZDohrStructMatrix::Clone ( )
inlineoverridevirtual

Creates a copy of itself.

Reimplemented from TPZStructMatrixOR.

Definition at line 70 of file pzdohrstructmatrix.h.

References TPZDohrStructMatrix().

◆ ClusterIslands()

int TPZDohrStructMatrix::ClusterIslands ( TPZVec< int > &  domain_index,
int  nsub,
int  connectdimension 
)

◆ ComputeInternalEquationPermutation()

void TPZDohrStructMatrix::ComputeInternalEquationPermutation ( TPZSubCompMesh sub,
TPZVec< int > &  scatterpermute,
TPZVec< int > &  gatherpermute 
)
protected

Computes the permutation vectors from the subcompmesh ordening to the "internal first" ordering.

The mesh is modified during this method but is returned to its original state at the end of execution

Definition at line 995 of file pzdohrstructmatrix.cpp.

References TPZCompMesh::Block(), TPZSubCompMesh::ComputePermutationInternalFirst(), TPZCompMesh::ConnectVec(), TPZVec< T >::Fill(), TPZConnect::HasDependency(), TPZConnect::IsCondensed(), LOGPZ_DEBUG, TPZBlock< TVar >::NBlocks(), TPZVec< T >::NElements(), TPZChunkVector< T, EXP >::NElements(), TPZBlock< TVar >::Position(), TPZBlock< TVar >::Resequence(), TPZVec< T >::Resize(), TPZBlock< TVar >::Set(), and TPZBlock< TVar >::Size().

Referenced by Create().

◆ CorrectNeighbourDomainIndex()

void TPZDohrStructMatrix::CorrectNeighbourDomainIndex ( TPZCompMesh cmesh,
TPZVec< int > &  domainindex 
)
protected

Set the domain index of the lower dimension elements equal to the domain index of their neighbour.

Definition at line 2023 of file pzdohrstructmatrix.cpp.

References TPZGeoElSide::Element(), TPZCompMesh::ElementVec(), TPZCompEl::Index(), TPZGeoEl::Neighbour(), TPZCompMesh::NElements(), TPZGeoEl::NSides(), TPZCompEl::Reference(), and TPZGeoEl::Reference().

Referenced by SubStructure().

◆ Create()

TPZMatrix< STATE > * TPZDohrStructMatrix::Create ( )
overridevirtual

◆ CreateAssemble()

TPZMatrix< STATE > * TPZDohrStructMatrix::CreateAssemble ( TPZFMatrix< STATE > &  rhs,
TPZAutoPointer< TPZGuiInterface guiInterface,
unsigned  numthreads_assemble,
unsigned  numthreads_decompose 
)
overridevirtual

This will create a DohrMatrix and compute its matrices.

Reimplemented from TPZStructMatrixOR.

Definition at line 275 of file pzdohrstructmatrix.cpp.

References Assemble(), and Create().

Referenced by Preconditioner().

◆ IdentifyCornerNodes()

void TPZDohrStructMatrix::IdentifyCornerNodes ( )
private

◆ IdentifyEqNumbers()

void TPZDohrStructMatrix::IdentifyEqNumbers ( TPZSubCompMesh sub,
std::map< int, int > &  global,
std::map< int, int > &  globinv 
)
protected

◆ IdentifyExternalConnectIndexes()

void TPZDohrStructMatrix::IdentifyExternalConnectIndexes ( )

◆ IdentifySubCornerEqs()

void TPZDohrStructMatrix::IdentifySubCornerEqs ( std::map< int, int > &  globaltolocal,
TPZVec< int > &  cornereqs,
TPZVec< int > &  coarseindex 
)
protected

Identify the corner equations associated with a substructure.

Definition at line 1063 of file pzdohrstructmatrix.cpp.

References fCornerEqs, LOGPZ_DEBUG, and TPZVec< T >::Resize().

Referenced by Create().

◆ NumberCornerEqs()

int TPZDohrStructMatrix::NumberCornerEqs ( ) const
inline

Return the number of cornereqs.

Definition at line 76 of file pzdohrstructmatrix.h.

References fCornerEqs.

Referenced by main().

◆ Preconditioner()

TPZAutoPointer<TPZMatrix<STATE> > TPZDohrStructMatrix::Preconditioner ( )
inline

This will return the pointer to the preconditioner AND abandon the pointer.

Warning
This method can only be called once

Definition at line 45 of file pzdohrstructmatrix.h.

References Assemble(), AssembleTBB(), CreateAssemble(), and fDohrPrecond.

Referenced by main().

◆ Read()

void TPZDohrStructMatrix::Read ( TPZStream buf,
void *  context 
)
overridevirtual

read objects from the stream

Reimplemented from TPZStructMatrixOR.

Definition at line 2010 of file pzdohrstructmatrix.cpp.

References TPZPersistenceManager::GetAutoPointer(), and TPZStream::Read().

Referenced by Assembly(), and main().

◆ SeparateUnconnected()

int TPZDohrStructMatrix::SeparateUnconnected ( TPZVec< int > &  domain_index,
int  nsub,
int  connectdimension 
)

Verifies if the subdomains are connected by sides of connectdimension and separate them if not.

Parameters
domain_index
nsubnumber of subdomains
connectdimension
Returns
returns the new number of subdomains

Definition at line 1690 of file pzdohrstructmatrix.cpp.

References TPZGeoElSide::ConnectedCompElementList(), DebugStop, TPZCompElSide::Element(), TPZCompEl::Index(), LOGPZ_DEBUG, TPZVec< T >::NElements(), TPZGeoEl::NSides(), nsub, TPZStack< T, NumExtAlloc >::Pop(), TPZStack< T, NumExtAlloc >::Push(), TPZCompEl::Reference(), TPZGeoEl::Reference(), and TPZGeoEl::SideDimension().

Referenced by Assembly(), and SubStructure().

◆ SubStructure()

void TPZDohrStructMatrix::SubStructure ( int  nsub)

◆ Write()

void TPZDohrStructMatrix::Write ( TPZStream buf,
int  withclassid 
) const
overridevirtual

Writes this object to the TPZStream buffer. Include the classid if withclassid = true.

Writes this object to the TPZStream buffer. Include the classid if withclassid = true

Reimplemented from TPZStructMatrixOR.

Definition at line 1995 of file pzdohrstructmatrix.cpp.

References TPZStream::Write(), and TPZPersistenceManager::WritePointer().

Referenced by Assembly(), and main().

Friends And Related Function Documentation

◆ ThreadDohrmanAssembly< STATE >

friend struct ThreadDohrmanAssembly< STATE >
friend

Definition at line 146 of file pzdohrstructmatrix.h.

Member Data Documentation

◆ fAccessElement

pthread_mutex_t TPZDohrStructMatrix::fAccessElement
private

Mutexes (to choose which submesh is next)

Definition at line 144 of file pzdohrstructmatrix.h.

Referenced by ThreadDohrmanAssemblyList< T >::ThreadDohrmanAssemblyList(), TPZDohrStructMatrix(), and ~TPZDohrStructMatrix().

◆ fCornerEqs

std::set<int> TPZDohrStructMatrix::fCornerEqs
private

The global equations defining the coarse matrix.

Definition at line 141 of file pzdohrstructmatrix.h.

Referenced by Create(), IdentifyCornerNodes(), IdentifySubCornerEqs(), and NumberCornerEqs().

◆ fDohrAssembly

TPZAutoPointer<TPZDohrAssembly<STATE> > TPZDohrStructMatrix::fDohrAssembly
protected

Definition at line 108 of file pzdohrstructmatrix.h.

Referenced by Assemble(), AssembleTBB(), Assembly(), and Create().

◆ fDohrPrecond

TPZAutoPointer<TPZMatrix<STATE> > TPZDohrStructMatrix::fDohrPrecond
protected

Definition at line 110 of file pzdohrstructmatrix.h.

Referenced by Assemble(), AssembleTBB(), and Preconditioner().

◆ fExternalConnectIndexes

TPZManVector<int> TPZDohrStructMatrix::fExternalConnectIndexes
private

The connect indexes which are external.

Definition at line 138 of file pzdohrstructmatrix.h.

Referenced by IdentifyCornerNodes().

◆ TPZPersistenceManager

friend TPZDohrStructMatrix::TPZPersistenceManager
private

Definition at line 148 of file pzdohrstructmatrix.h.


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