89 int Local(int64_t global);
94 std::cout <<
"TPZFront ExtractFrontMatrix should never be called\n";
113 for(mineq=0; mineq<maxeq; mineq++)
if(
fLocal[mineq] != -1)
break;
114 int numeq = maxeq-mineq;
119 virtual int64_t
NFree();
121 void Reset(int64_t GlobalSize=0);
124 void Print(
const char *name, std::ostream& out)
const;
125 void PrintGlobal(
const char *name, std::ostream& out = std::cout);
215 this->fMat = frontMat;
216 this->fRunning =
true;
218 fWorkSem.
Resize(nthreads);
223 fThreads.
Resize(nthreads);
224 fThreadData.
Resize(nthreads);
227 threadData->first = i;
228 threadData->second =
this;
229 fThreadData[i] = threadData;
242 this->fRunning =
false;
249 delete fThreadData[i];
250 fThreadData[i] = NULL;
254 for(
int i = 0; i < fWorkSem.
NElements(); i++){
263 STensorProductThreadData * mypair =
static_cast< STensorProductThreadData *
>(data);
281 this->fAuxVecCol = &AuxVecCol;
282 this->fAuxVecRow = &AuxVecRow;
283 this->fWorkDoneCount = 0;
284 for(
int i = 0; i <
NThreads(); i++){
307 this->fProductMTData->Run(AuxVecCol,AuxVecRow);
318 return Hash(
"TPZFront") ^ ClassIdOrHash<TVar>() << 1;
virtual ~TPZFront()
Simple destructor.
TPZFront()
Simple constructor.
void DeleteSemaphore(pz_semaphore_t &s)
Implements semaphore to threads. Utility.
static void * Execute(void *data)
destrutor
TPZVec< TVar > fData
Frontal matrix data.
It is an equation array, generally in its decomposed form. Frontal.
TPZVec< int64_t > fLocal
Front equation to each global equation.
int InitializeSemaphore(pz_semaphore_t &s)
Semaforos.
TVar fDiagonal
valor da diagonal
TPZVec< TVar > * fAuxVecCol
vetores de operacao
Templated vector implementation.
TPZVec< TVar > * fAuxVecRow
void LeaveCriticalSection(pz_critical_section_t &cs)
struct para paralelizar a decomposicao da matriz
int NThreads()
num threads
STensorProductMTData * fProductMTData
void EnterCriticalSection(pz_critical_section_t &cs)
void ProductTensorMTInitData(int nthreads)
TPZVec< STensorProductThreadData * > fThreadData
TPZVec< pz_semaphore_t > fWorkSem
semaforos para sincronizar os threads de calculo
Abstract class implements storage and decomposition process of the frontal matrix. Frontal.
void CreateThread(pz_thread_t &thread, void *(*function)(void *param), void *data)
Threads.
void ProductTensorMT(TPZVec< TVar > &AuxVecCol, TPZVec< TVar > &AuxVecRow)
void
virtual void ExtractFrontMatrix(TPZFMatrix< TVar > &front)
Extracts the so far condensed matrix.
void FreeGlobal(int64_t global)
Sets the global equation as freed, allowing the space used by this equation to be used...
DecomposeType fDecomposeType
Used Decomposition method.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
void SymbolicAddKel(TPZVec< int64_t > &destinationindex)
Add a contribution of a stiffness matrix using the indexes to compute the frontwidth.
void InitializeCriticalSection(pz_critical_section_t &cs)
Critical sections.
void ThreadWaitFor(pz_thread_t &thread)
#define DebugStop()
Returns a message to user put a breakpoint in.
DecomposeType GetDecomposeType() const
Returns decomposition type. Default LU.
void ProductTensorMTFinish()
void
int FrontSize()
returns the actual front size
virtual int64_t NFree()
Returns the number of free equations.
std::pair< int, STensorProductMTData *> STensorProductThreadData
pz_semaphore_t fWorkDoneSem
dados para sincronizar o thread principal
int fExpandRatio
Expansion Ratio of frontal matrix.
int Local(int64_t global)
return a local index corresponding to a global equation number
void SetNumRigidBodyModes(int nrigid)
Indicate the first equation dedicated to rigid body modes.
~STensorProductMTData()
construtor
int64_t fNextRigidBodyMode
Equation where rigid body modes can be stored.
Full matrix class. Matrix.
void PrintGlobal(const char *name, std::ostream &out=std::cout)
int32_t Hash(std::string str)
Contains TPZMatrix<TVar>class, root matrix class.
int64_t fFront
Actual front size.
virtual void SetDecomposeType(DecomposeType dectype)=0
Set the decomposition type.
STensorProductMTData(int nthreads, TPZFront< TVar > *frontMat)
construtor padrao
int NonNullFrontSize() const
Return the number of equations in the condensed front matrix It would be equal to FrontSize if the fr...
void SemaphoreWait(pz_semaphore_t &s)
void SemaphorePost(pz_semaphore_t &s)
void Print(const char *name, std::ostream &out) const
It prints TPZFront data.
int fMaxFront
Maximum size of the front.
void Reset(int64_t GlobalSize=0)
virtual void TensorProductIJ(int ithread, typename TPZFront< TVar >::STensorProductMTData *data)
void
int64_t NElements() const
Returns the number of elements of the vector.
TPZVec< pz_thread_t > fThreads
array de threads
void SymbolicDecomposeEquations(int64_t mineq, int64_t maxeq)
Decompose these equations in a symbolic way and store freed indexes in fFree.
int64_t NElements()
Static main used for testing.
void Run(TPZVec< TVar > &AuxVecCol, TPZVec< TVar > &AuxVecRow)
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
TPZStack< int > fFree
Colection of already decomposed equations still on the front.
TPZManVector< int64_t > fGlobal
Global equation associated to each front equation.
pz_critical_section_t fWorkDoneCS
TPZFront< TVar > * fMat
matriz TPZFront
int ClassId() const override
Define the class id associated with the class.
DecomposeType
Defines decomposition type for any matrix classes.
void DeleteCriticalSection(pz_critical_section_t &cs)