NeoPZ
|
Implements structural matrix divided in sub structures. Structural Matrix Sub structure. More...
#include <pzdohrstructmatrix.h>
Public Member Functions | |
TPZDohrStructMatrix (TPZAutoPointer< TPZCompMesh > compmesh) | |
We assume that the mesh consists of subcompmeshes. More... | |
TPZDohrStructMatrix (const TPZDohrStructMatrix ©) | |
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 TPZStructMatrix * | Clone () 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 ©) | |
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 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... | |
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 | |
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... | |
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 TPZSavable * | CreateInstance (const int &classId) |
Implements structural matrix divided in sub structures. Structural Matrix Sub structure.
Definition at line 22 of file pzdohrstructmatrix.h.
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::TPZDohrStructMatrix | ( | const TPZDohrStructMatrix & | copy | ) |
Copy constructors.
Definition at line 88 of file pzdohrstructmatrix.cpp.
References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.
|
virtual |
Definition at line 94 of file pzdohrstructmatrix.cpp.
References fAccessElement, and PZ_PTHREAD_MUTEX_DESTROY.
|
private |
Definition at line 75 of file pzdohrstructmatrix.cpp.
References fAccessElement, and PZ_PTHREAD_MUTEX_INIT.
Referenced by Clone().
|
overridevirtual |
Assemble the global system of equations into the matrix which has already been created.
Reimplemented from TPZStructMatrixOR.
Definition at line 439 of file pzdohrstructmatrix.cpp.
References TPZGuiInterface::AmIKilled(), ThreadDohrmanAssemblyList< TVar >::Append(), TPZDohrAssembly< TVar >::Assemble(), dohr_ass, dohr_dec, TPZStructMatrixBase::fCompMesh, fDohrAssembly, fDohrPrecond, ThreadDohrmanAssemblyList< TVar >::fList, TPZStructMatrixBase::fNumThreads, TPZDohrPrecond< TVar, TSubStruct >::Initialize(), TPZDohrMatrix< TVar, TSubStruct >::Initialize(), ThreadDohrmanAssemblyList_ThreadArgs_t< T >::list, LOGPZ_DEBUG, nsub, NSubMesh(), ThreadDohrmanAssemblyList_ThreadArgs_t< T >::pthread, PZ_PTHREAD_CREATE, PZ_PTHREAD_JOIN, TPZDohrMatrix< TVar, TSubStruct >::SetNumThreads(), RunStatsTable::start(), RunStatsTable::stop(), SubMesh(), TPZDohrMatrix< TVar, TSubStruct >::SubStructures(), ThreadDohrmanAssemblyList_ThreadArgs_t< T >::thread_idx, and ThreadDohrmanAssemblyList< TVar >::ThreadWork().
Referenced by CreateAssemble(), main(), and Preconditioner().
|
overridevirtual |
Assemble the global right hand side.
Reimplemented from TPZStructMatrixOR.
Definition at line 604 of file pzdohrstructmatrix.cpp.
References TPZDohrAssembly< TVar >::Assemble(), TPZStructMatrixOR::Assemble(), DebugStop, TPZStructMatrixBase::fCompMesh, fDohrAssembly, fDohrPrecond, TPZStructMatrixBase::fMesh, TPZDohrPrecond< TVar, TSubStruct >::Global(), TPZCompMesh::NEquations(), nsub, NSubMesh(), TPZFMatrix< TVar >::Redim(), and SubMesh().
void TPZDohrStructMatrix::AssembleTBB | ( | TPZMatrix< STATE > & | mat, |
TPZFMatrix< STATE > & | rhs, | ||
TPZAutoPointer< TPZGuiInterface > | guiInterface | ||
) |
Definition at line 365 of file pzdohrstructmatrix.cpp.
References TPZDohrAssembly< TVar >::Assemble(), fDohrAssembly, fDohrPrecond, TPZStructMatrixBase::fMesh, TPZDohrPrecond< TVar, TSubStruct >::Initialize(), TPZDohrMatrix< TVar, TSubStruct >::Initialize(), nsub, NSubMesh(), parallel_assemble_task_t< TVar >::push_work_item(), parallel_assemble_task_t< TVar >::run_serial(), SubMesh(), and TPZDohrMatrix< TVar, TSubStruct >::SubStructures().
Referenced by main(), and Preconditioner().
|
inline |
Definition at line 82 of file pzdohrstructmatrix.h.
References ClusterIslands(), fDohrAssembly, Read(), SeparateUnconnected(), and Write().
Referenced by only_assemble().
|
inlineoverridevirtual |
Creates a copy of itself.
Reimplemented from TPZStructMatrixOR.
Definition at line 70 of file pzdohrstructmatrix.h.
References TPZDohrStructMatrix().
int TPZDohrStructMatrix::ClusterIslands | ( | TPZVec< int > & | domain_index, |
int | nsub, | ||
int | connectdimension | ||
) |
Eliminates subdomains who are embedded in other subdomains.
Definition at line 1798 of file pzdohrstructmatrix.cpp.
References TPZVec< T >::begin(), TPZGeoElSide::ConnectedCompElementList(), TPZGeoEl::Dimension(), TPZCompElSide::Element(), TPZVec< T >::end(), TPZCompEl::Index(), LOGPZ_DEBUG, TPZVec< T >::NElements(), TPZGeoEl::NSides(), nsub, TPZCompEl::Reference(), TPZGeoEl::SideDimension(), and TPZVec< T >::size().
Referenced by Assembly(), and SubStructure().
|
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().
|
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().
|
overridevirtual |
This will create a DohrMatrix.
Reimplemented from TPZStructMatrixOR.
Definition at line 101 of file pzdohrstructmatrix.cpp.
References TPZDohrMatrix< TVar, TSubStruct >::AddSubstruct(), TPZCompMesh::ComputeElGraph(), TPZCompMesh::ComputeFillIn(), ComputeInternalEquationPermutation(), TPZSubCompMesh::ComputeNodElCon(), TPZCompMesh::ComputeNodElCon(), TPZStructMatrixBase::fCompMesh, fCornerEqs, fDohrAssembly, stats::filename, TPZStructMatrixBase::fMesh, TPZTimeTemp::ft1comput, TPZTimeTemp::ft4identcorner, IdentifyCornerNodes(), IdentifyEqNumbers(), IdentifySubCornerEqs(), TPZCompEl::Index(), TPZCompMesh::InitializeBlock(), TPZVec< T >::NElements(), TPZCompMesh::NEquations(), TPZCompMesh::NIndependentConnects(), nsub, NSubMesh(), TPZSubCompMesh::NumInternalEquations(), TPZCompMesh::Permute(), TPZSloan::Resequence(), TPZVec< T >::Resize(), TPZMatrix< TVar >::Resize(), TPZfTime::ReturnTimeDouble(), TPZRenumbering::SetElementGraph(), TPZDohrMatrix< TVar, TSubStruct >::SetNumCornerEqs(), SubMesh(), tempo, and VisualMatrix().
Referenced by CreateAssemble(), get_sky_matrices(), and main().
|
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().
|
private |
Identify cornernodes.
Definition at line 642 of file pzdohrstructmatrix.cpp.
References TPZCompMesh::Block(), TPZGeoMesh::BuildConnectivity(), TPZCompMesh::BuildCornerConnectList(), TPZCompMesh::ComputeElGraph(), TPZCompEl::Connect(), TPZCompEl::ConnectIndex(), TPZCompMesh::ConnectVec(), TPZRenumbering::CornerEqs(), TPZGeoMesh::CreateGeoElement(), TPZCompMesh::ElementVec(), EPoint, fCornerEqs, fExternalConnectIndexes, TPZStructMatrixBase::fMesh, LOGPZ_DEBUG, TPZBlock< TVar >::NBlocks(), TPZCompEl::NConnects(), TPZGeoEl::NCornerNodes(), TPZCompMesh::NElements(), TPZVec< T >::NElements(), TPZChunkVector< T, EXP >::NElements(), TPZCompMesh::NIndependentConnects(), TPZGeoEl::NodeIndex(), TPZSubCompMesh::NodeIndex(), TPZGeoMesh::NodeVec(), TPZBlock< TVar >::Position(), TPZRenumbering::Print(), TPZVTKGeoMesh::PrintGMeshVTK(), TPZStack< T, NumExtAlloc >::Push(), TPZCompEl::Reference(), TPZCompMesh::Reference(), TPZConnect::SequenceNumber(), TPZRenumbering::SetElementGraph(), and TPZBlock< TVar >::Size().
Referenced by Create().
|
protected |
Definition at line 921 of file pzdohrstructmatrix.cpp.
References TPZCompMesh::Block(), TPZCompMesh::ConnectVec(), TPZStructMatrixBase::fMesh, LOGPZ_DEBUG, TPZChunkVector< T, EXP >::NElements(), TPZSubCompMesh::NodeIndex(), TPZBlock< TVar >::Position(), and TPZBlock< TVar >::Size().
Referenced by Create().
void TPZDohrStructMatrix::IdentifyExternalConnectIndexes | ( | ) |
Identify the external connects.
Definition at line 1618 of file pzdohrstructmatrix.cpp.
References TPZGeoElSide::ConnectedCompElementList(), TPZGeoElSide::Dimension(), TPZGeoEl::Dimension(), TPZGeoElSide::Element(), TPZVec< T >::NElements(), TPZInterpolatedElement::NSideConnects(), TPZGeoEl::NSides(), TPZCompEl::Reference(), TPZCompElSide::Reference(), TPZManVector< T, NumExtAlloc >::Resize(), and TPZInterpolatedElement::SideConnectIndex().
Referenced by get_sky_matrices(), and main().
|
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().
|
inline |
Return the number of cornereqs.
Definition at line 76 of file pzdohrstructmatrix.h.
References fCornerEqs.
Referenced by main().
|
inline |
This will return the pointer to the preconditioner AND abandon the pointer.
Definition at line 45 of file pzdohrstructmatrix.h.
References Assemble(), AssembleTBB(), CreateAssemble(), and fDohrPrecond.
Referenced by main().
|
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().
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.
domain_index | |
nsub | number of subdomains |
connectdimension |
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().
void TPZDohrStructMatrix::SubStructure | ( | int | nsub | ) |
Partition the mesh in submeshes.
Definition at line 1108 of file pzdohrstructmatrix.cpp.
References TPZCompMesh::CleanUpUnconnectedNodes(), ClusterIslands(), TPZCompMesh::ComputeElGraph(), TPZCompMesh::ComputeNodElCon(), CorrectNeighbourDomainIndex(), TPZCompMesh::Dimension(), TPZCompMesh::ElementVec(), TPZStructMatrixBase::fMesh, TPZGeoEl::Index(), LOGPZ_DEBUG, TPZGeoMesh::NElements(), TPZCompMesh::NElements(), TPZVec< T >::NElements(), TPZCompMesh::NIndependentConnects(), nsub, TPZGeoMesh::Print(), TPZVTKGeoMesh::PrintGMeshVTK(), TPZCompEl::Reference(), TPZCompMesh::Reference(), SeparateUnconnected(), TPZRenumbering::SetElementGraph(), and TPZMetis::Subdivide().
Referenced by get_sky_matrices(), and main().
|
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().
|
friend |
Definition at line 146 of file pzdohrstructmatrix.h.
|
private |
Mutexes (to choose which submesh is next)
Definition at line 144 of file pzdohrstructmatrix.h.
Referenced by ThreadDohrmanAssemblyList< T >::ThreadDohrmanAssemblyList(), TPZDohrStructMatrix(), and ~TPZDohrStructMatrix().
|
private |
The global equations defining the coarse matrix.
Definition at line 141 of file pzdohrstructmatrix.h.
Referenced by Create(), IdentifyCornerNodes(), IdentifySubCornerEqs(), and NumberCornerEqs().
|
protected |
Definition at line 108 of file pzdohrstructmatrix.h.
Referenced by Assemble(), AssembleTBB(), Assembly(), and Create().
|
protected |
Definition at line 110 of file pzdohrstructmatrix.h.
Referenced by Assemble(), AssembleTBB(), and Preconditioner().
|
private |
The connect indexes which are external.
Definition at line 138 of file pzdohrstructmatrix.h.
Referenced by IdentifyCornerNodes().
|
private |
Definition at line 148 of file pzdohrstructmatrix.h.