NeoPZ
|
Refines geometrical mesh (all the elements) num times. More...
#include <pzstrmatrixot.h>
Classes | |
struct | ThreadData |
Structure to manipulate thread to solve system equations. More... | |
Public Member Functions | |
TPZStructMatrixOT () | |
TPZStructMatrixOT (TPZCompMesh *) | |
TPZStructMatrixOT (TPZAutoPointer< TPZCompMesh > cmesh) | |
TPZStructMatrixOT (const TPZStructMatrixOT ©) | |
virtual | ~TPZStructMatrixOT () |
virtual TPZMatrix< STATE > * | Create () override |
virtual TPZMatrix< STATE > * | CreateAssemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface, unsigned numthreads_assemble, unsigned numthreads_decompose) |
virtual TPZMatrix< STATE > * | CreateAssemble (TPZFMatrix< STATE > &rhs, TPZAutoPointer< TPZGuiInterface > guiInterface) override |
virtual TPZStructMatrixOT * | Clone () override |
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... | |
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... | |
virtual void | FilterEquations (TPZVec< int64_t > &origindex, TPZVec< int64_t > &destindex) const override |
Filter out the equations which are out of the range. More... | |
void | SetMaterialIds (const std::set< int > &materialids) override |
Set the set of material ids which will be considered when assembling the system. More... | |
bool | ShouldCompute (int matid) const override |
Establish whether the element should be computed. More... | |
const std::set< int > & | MaterialIds () override |
Returns the material ids. More... | |
Public Member Functions inherited from TPZStructMatrixBase | |
virtual void | SetMesh (TPZCompMesh *) |
virtual void | SetMesh (TPZAutoPointer< TPZCompMesh >) |
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... | |
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 void | OrderElement (TPZCompMesh *cmesh, TPZVec< int64_t > &ElementOrder) |
Find the order to assemble the elements. More... | |
static void | ElementColoring (TPZCompMesh *cmesh, TPZVec< int64_t > &elSequence, TPZVec< int64_t > &elSequenceColor, TPZVec< int64_t > &elBlocked, TPZVec< int64_t > &NumelColors) |
Create blocks of elements to parallel processing. More... | |
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) |
Protected Member Functions | |
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 | |
TPZVec< int64_t > | fElBlocked |
Vectors for mesh coloring. More... | |
TPZVec< int64_t > | fElSequenceColor |
TPZVec< int64_t > | fElementsComputed |
vector of the size of the elements containing 0 or 1 if the element has been computed (in the order of computation sequence) More... | |
int64_t | fElementCompleted |
All elements below or equal this index have been computed. More... | |
int | fSomeoneIsSleeping |
variable indicating if a thread is sleeping More... | |
pthread_mutex_t | fAccessElement |
Mutexes (to choose which element is next) More... | |
pthread_cond_t | fCondition |
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... | |
Friends | |
struct | ThreadData |
Refines geometrical mesh (all the elements) num times.
It is responsible for a interface among Matrix and Finite Element classes. Structural Matrix
Definition at line 44 of file pzstrmatrixot.h.
|
inline |
Definition at line 48 of file pzstrmatrixot.h.
TPZStructMatrixOT::TPZStructMatrixOT | ( | TPZCompMesh * | mesh | ) |
Definition at line 51 of file pzstrmatrixot.cpp.
References ElementColoring(), fElBlocked, fElSequenceColor, TPZStructMatrixBase::Mesh(), OrderElement(), RunStatsTable::start(), stat_ass_graph_ot, and RunStatsTable::stop().
TPZStructMatrixOT::TPZStructMatrixOT | ( | TPZAutoPointer< TPZCompMesh > | cmesh | ) |
Definition at line 64 of file pzstrmatrixot.cpp.
References ElementColoring(), fElBlocked, fElSequenceColor, TPZStructMatrixBase::Mesh(), OrderElement(), RunStatsTable::start(), stat_ass_graph_ot, and RunStatsTable::stop().
TPZStructMatrixOT::TPZStructMatrixOT | ( | const TPZStructMatrixOT & | copy | ) |
Definition at line 75 of file pzstrmatrixot.cpp.
References fElBlocked, fElementCompleted, fElementsComputed, fElSequenceColor, TPZStructMatrixBase::fEquationFilter, and fSomeoneIsSleeping.
|
inlinevirtual |
Definition at line 56 of file pzstrmatrixot.h.
References Create().
|
overridevirtual |
Assemble the global system of equations into the matrix which has already been created.
Implements TPZStructMatrixBase.
Definition at line 98 of file pzstrmatrixot.cpp.
References TPZMatrix< TVar >::Cols(), DebugStop, TPZStructMatrixBase::fEquationFilter, TPZStructMatrixBase::fNumThreads, TPZEquationFilter::IsActive(), MultiThread_Assemble(), TPZEquationFilter::NActiveEquations(), TPZMatrix< TVar >::Rows(), TPZEquationFilter::Scatter(), Serial_Assemble(), RunStatsTable::start(), and RunStatsTable::stop().
Referenced by Assemble(), and CreateAssemble().
|
inlinevirtual |
Definition at line 72 of file pzstrmatrixot.h.
References Assemble(), ClassId(), ElementColoring(), FilterEquations(), MultiThread_Assemble(), OrderElement(), Read(), Serial_Assemble(), SetMaterialIds(), and Write().
|
overridevirtual |
Assemble the global right hand side.
Implements TPZStructMatrixBase.
Definition at line 129 of file pzstrmatrixot.cpp.
References DebugStop, TPZStructMatrixBase::fEquationFilter, TPZStructMatrixBase::fNumThreads, TPZEquationFilter::IsActive(), MultiThread_Assemble(), TPZEquationFilter::NActiveEquations(), TPZEquationFilter::NEqExpand(), Norm(), TPZMatrix< TVar >::Rows(), TPZEquationFilter::Scatter(), Serial_Assemble(), RunStatsTable::start(), and RunStatsTable::stop().
|
overridevirtual |
Define the class id associated with the class.
This id has to be unique for all classes A non unique id is flagged at the startup of the program
Implements TPZSavable.
Definition at line 1555 of file pzstrmatrixot.cpp.
References TPZStructMatrixBase::ClassId(), and Hash().
Referenced by Assemble().
|
overridevirtual |
Implements TPZStructMatrixBase.
Definition at line 90 of file pzstrmatrixot.cpp.
References ass_rhs, and ass_stiff.
Referenced by CreateAssemble().
|
overridevirtual |
Implements TPZStructMatrixBase.
Definition at line 85 of file pzstrmatrixot.cpp.
Referenced by CreateAssemble(), and ~TPZStructMatrixOT().
|
inlinevirtual |
Definition at line 60 of file pzstrmatrixot.h.
References Assemble(), Clone(), and TPZStructMatrixBase::SetNumThreads().
|
overridevirtual |
Reimplemented from TPZStructMatrixBase.
Definition at line 445 of file pzstrmatrixot.cpp.
References Assemble(), TPZMatrix< TVar >::Cols(), Create(), TPZStructMatrixBase::fEquationFilter, LOGPZ_DEBUG, MAX, TPZEquationFilter::NEqExpand(), TPZMatrix< TVar >::Print(), and TPZFMatrix< TVar >::Redim().
|
static |
Create blocks of elements to parallel processing.
elSequence (input) element sequence according to the connect sequence numbers elSequenceColor (output) the colored element sequence elBlocked the element index which needs to have been computed before assembling the element elColors (output) number of elements in each color
Definition at line 1378 of file pzstrmatrixot.cpp.
References AssembleColor(), TPZCompEl::BuildConnectList(), DebugStop, TPZCompMesh::Element(), TPZVec< T >::Fill(), MinPassIndex(), TPZCompMesh::NConnects(), TPZCompMesh::NElements(), TPZVec< T >::NElements(), TPZVec< T >::Resize(), TPZVec< T >::size(), and WhoBlockedMe().
Referenced by Assemble(), Serial_Assemble(), and TPZStructMatrixOT().
|
overridevirtual |
Filter out the equations which are out of the range.
Reimplemented from TPZStructMatrixBase.
Referenced by Assemble(), TPZStructMatrixOT::ThreadData::ThreadWork(), and TPZStructMatrixOT::ThreadData::ThreadWorkResidual().
|
inlineoverridevirtual |
Returns the material ids.
Reimplemented from TPZStructMatrixBase.
Definition at line 120 of file pzstrmatrixot.h.
References TPZStructMatrixBase::fMaterialIds.
|
protectedvirtual |
Assemble the global right hand side.
Definition at line 543 of file pzstrmatrixot.cpp.
References TPZGuiInterface::AmIKilled(), EMathematicaInput, TPZStructMatrixOT::ThreadData::fAccessElement, fAccessElement, TPZStructMatrixOT::ThreadData::fComputedElements, TPZStructMatrixOT::ThreadData::fCondition, fCondition, TPZStructMatrixOT::ThreadData::fElBlocked, fElBlocked, TPZStructMatrixOT::ThreadData::fElementCompleted, fElementCompleted, fElementsComputed, TPZStructMatrixOT::ThreadData::fElSequenceColor, fElSequenceColor, TPZVec< T >::Fill(), TPZStructMatrixBase::fMaterialIds, TPZStructMatrixBase::fMesh, TPZStructMatrixBase::fNumThreads, TPZStructMatrixOT::ThreadData::fSomeoneIsSleeping, fSomeoneIsSleeping, LOGPZ_DEBUG, TPZCompMesh::NElements(), substruct_tst14.test::numthreads, TPZMatrix< TVar >::Print(), PZ_PTHREAD_CREATE, PZ_PTHREAD_JOIN, PZ_PTHREAD_MUTEX_DESTROY, PZ_PTHREAD_MUTEX_INIT, TPZVec< T >::Resize(), ThreadData, and TPZStructMatrixOT::ThreadData::ThreadWorkResidual().
Referenced by Assemble().
|
protectedvirtual |
Assemble the global system of equations into the matrix which has already been created.
Definition at line 468 of file pzstrmatrixot.cpp.
References TPZGuiInterface::AmIKilled(), EMathematicaInput, TPZStructMatrixOT::ThreadData::fAccessElement, fAccessElement, TPZStructMatrixOT::ThreadData::fComputedElements, TPZStructMatrixOT::ThreadData::fCondition, fCondition, TPZStructMatrixOT::ThreadData::fElBlocked, fElBlocked, TPZStructMatrixOT::ThreadData::fElementCompleted, fElementCompleted, fElementsComputed, TPZStructMatrixOT::ThreadData::fElSequenceColor, fElSequenceColor, TPZVec< T >::Fill(), TPZStructMatrixBase::fMaterialIds, TPZStructMatrixBase::fMesh, TPZStructMatrixBase::fNumThreads, TPZStructMatrixOT::ThreadData::fSomeoneIsSleeping, fSomeoneIsSleeping, LOGPZ_DEBUG, TPZCompMesh::NElements(), substruct_tst14.test::numthreads, TPZMatrix< TVar >::Print(), PZ_PTHREAD_CREATE, PZ_PTHREAD_JOIN, PZ_PTHREAD_MUTEX_DESTROY, PZ_PTHREAD_MUTEX_INIT, TPZVec< T >::Resize(), TPZVec< T >::size(), ThreadData, and TPZStructMatrixOT::ThreadData::ThreadWork().
|
static |
Find the order to assemble the elements.
Definition at line 1457 of file pzstrmatrixot.cpp.
References TPZCompEl::BuildConnectList(), TPZCompMesh::ConnectVec(), TPZCompMesh::ElementVec(), TPZVec< T >::Fill(), TPZCompMesh::NConnects(), TPZCompMesh::NElements(), TPZVec< T >::NElements(), TPZChunkVector< T, EXP >::NElements(), and TPZVec< T >::Resize().
Referenced by Assemble(), Serial_Assemble(), and TPZStructMatrixOT().
|
overridevirtual |
read objects from the stream
Reimplemented from TPZSavable.
Definition at line 1619 of file pzstrmatrixot.cpp.
References TPZStructMatrixOT::ThreadData::fElBlocked, TPZStructMatrixOT::ThreadData::fElementCompleted, TPZStructMatrixOT::ThreadData::fElSequenceColor, TPZStructMatrixOT::ThreadData::fSomeoneIsSleeping, TPZStructMatrixBase::Read(), and TPZStream::Read().
Referenced by Assemble().
|
protectedvirtual |
Assemble the global system of equations into the matrix which has already been created.
Definition at line 185 of file pzstrmatrixot.cpp.
References TPZFMatrix< TVar >::AddFel(), TPZMatrix< TVar >::AddKel(), TPZGuiInterface::AmIKilled(), TPZElementMatrix::ApplyConstraints(), TPZCompEl::CalcStiff(), TPZGeoEl::CenterPoint(), DebugStop, TPZGeoEl::Dimension(), TPZElementMatrix::EF, TPZElementMatrix::EK, TPZCompMesh::ElementVec(), EMathematicaInput, TPZElementMatrix::fConstrMat, TPZStructMatrixBase::fEquationFilter, TPZEquationFilter::Filter(), TPZElementMatrix::fMat, TPZStructMatrixBase::fMaterialIds, TPZStructMatrixBase::fMesh, TPZCompEl::HasDependency(), TPZMaterial::Id(), TPZCompEl::Index(), TPZGeoEl::Index(), LOGPZ_DEBUG, LOGPZ_ERROR, TPZCompEl::Material(), TPZEquationFilter::NActiveEquations(), TPZSubCompMesh::NeedsComputing(), TPZCompMesh::NElements(), TPZGeoEl::NSides(), TPZElementMatrix::Print(), TPZMatrix< TVar >::Print(), TPZCompEl::Reference(), TPZMatrix< TVar >::Rows(), ShouldCompute(), TPZTimer::start(), TPZTimer::stop(), and TPZGeoEl::X().
Referenced by Assemble().
|
protectedvirtual |
Assemble the global right hand side.
Definition at line 378 of file pzstrmatrixot.cpp.
References TPZFMatrix< TVar >::AddFel(), TPZElementMatrix::ApplyConstraints(), TPZCompEl::CalcResidual(), TPZElementMatrix::ComputeDestinationIndices(), TPZElementMatrix::EF, ElementColoring(), TPZCompMesh::ElementVec(), TPZElementMatrix::fConstrMat, TPZElementMatrix::fDestinationIndex, fElBlocked, fElSequenceColor, TPZStructMatrixBase::fEquationFilter, TPZEquationFilter::Filter(), TPZElementMatrix::fMat, TPZStructMatrixBase::fMesh, TPZElementMatrix::fSourceIndex, TPZCompEl::HasDependency(), TPZMaterial::Id(), LOGPZ_DEBUG, TPZCompEl::Material(), TPZStructMatrixBase::Mesh(), OrderElement(), TPZTimer::processName(), ShouldCompute(), TPZVec< T >::size(), RunStatsTable::start(), TPZTimer::start(), stat_ass_graph_ot, RunStatsTable::stop(), and TPZTimer::stop().
|
overridevirtual |
Set the set of material ids which will be considered when assembling the system.
Reimplemented from TPZStructMatrixBase.
Referenced by Assemble().
|
inlineoverridevirtual |
Establish whether the element should be computed.
Reimplemented from TPZStructMatrixBase.
Definition at line 114 of file pzstrmatrixot.h.
References TPZStructMatrixBase::fMaterialIds.
Referenced by Serial_Assemble(), and TPZStructMatrixOT::ThreadData::ShouldCompute().
|
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 TPZSavable.
Definition at line 1633 of file pzstrmatrixot.cpp.
References TPZStructMatrixOT::ThreadData::fElBlocked, TPZStructMatrixOT::ThreadData::fElementCompleted, TPZStructMatrixOT::ThreadData::fElSequenceColor, TPZStructMatrixOT::ThreadData::fSomeoneIsSleeping, TPZStream::Write(), and TPZStructMatrixBase::Write().
Referenced by Assemble().
|
friend |
Definition at line 190 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble().
|
protected |
Mutexes (to choose which element is next)
Definition at line 211 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble().
|
protected |
Definition at line 213 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble().
|
protected |
Vectors for mesh coloring.
Definition at line 194 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble(), Serial_Assemble(), and TPZStructMatrixOT().
|
protected |
All elements below or equal this index have been computed.
Definition at line 200 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble(), and TPZStructMatrixOT().
|
protected |
vector of the size of the elements containing 0 or 1 if the element has been computed (in the order of computation sequence)
Definition at line 197 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble(), and TPZStructMatrixOT().
|
protected |
Definition at line 194 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble(), Serial_Assemble(), and TPZStructMatrixOT().
|
protected |
variable indicating if a thread is sleeping
Definition at line 203 of file pzstrmatrixot.h.
Referenced by MultiThread_Assemble(), and TPZStructMatrixOT().