16 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzconnect"));
27 cout <<
"The dependency list should be NULL - Index " <<
fSequenceNumber <<
"\n";
31 cout <<
"Connect index = " << depindex << endl;
52 if(
this == ©)
return *
this;
71 out <<
"TPZConnect : " <<
"Sequence number = " <<
fSequenceNumber <<
" Order = " << orde <<
" NState = " << nstate <<
" NShape " << nshape <<
" IsCondensed " <<
IsCondensed() <<
" IsLagrMult " << (int)
LagrangeMultiplier();
75 out <<
"\tEquation = " << pos;
87 out <<
"Dependency :\n";
92 out <<
"Connect index = " << depindex << endl;
103 out <<
" coordinate " << cp;
117 out <<
"Dependency :\n";
122 out <<
"Connect index = " << depindex << endl;
131 if(dependindex == myindex)
return 0;
133 if(dependindex == -1)
135 cout <<
"dependindex = -1 in " << __PRETTY_FUNCTION__ <<
"DebugStop() called!" << endl;
138 if (isize == 0 || jsize == 0) {
143 connect =
new TPZDepend(dependindex,depmat,ipos,jpos,isize,jsize);
149 for(i=0; i<isize; i++)
for(j=0; j<jsize; j++) temp(i,j) = depmat(ipos+i,jpos+j);
153 cout <<
"TPZConnect::Dependency inconsistent \t" 154 <<
"temp(r,c): (" << temp.
Rows() <<
" , " << temp.
Cols() <<
" )\t fDepMatrix(r,c): ( " 164 cout <<
"TPZConnect::Dependency inconsistent\n";
193 maxdep = depth > maxdep ? depth : maxdep;
222 int64_t in=0, cap = connectlist.
NElements();
223 while(in < cap && connectlist[in] != myindex) in++;
224 if(in == cap) connectlist.
Push(myindex);
235 connectlist.insert(myindex);
246 int64_t in=0,cap = ConnectList.
NElements();
248 while(in<cap && ConnectList[in] != myindex) in++;
250 cout <<
"TPZConnect::SetDependenceOrder node not encountered in list\n";
254 DependenceOrder[in] = (DependenceOrder[in] < CurrentOrder) ? CurrentOrder : DependenceOrder[in];
274 for(i=0; i<isize; i++)
for(j=0; j<jsize; j++)
fDepMatrix(i,j) = depmat(ipos+i,jpos+j);
306 while(run && run->
fNext != ptr) run = run->
fNext;
319 PZError <<
"TPZConnect::NDof. Connect is inactive.\n";
334 cout <<
"TPZConnect::CheckDependency inconsistent dependency nshape = " << nshape <<
" nrows " << nr << endl;
338 if(nc*nstate != c2.
NDof(*mesh)) {
339 cout <<
"TPZConnect::CheckDependency inconsistent dependency ndof = " << c2.
NDof(*mesh) <<
" ncols " << nc << endl;
346 if(c2result == -1)
return c2result;
347 first = first->
fNext;
356 int64_t dim = dphi.
Rows();
360 while(locind < ncon && connectlist[locind] != cind) {
361 eqloc += blocksize[locind];
365 cout <<
"TPZConnect::ExpandShape wrong data structure locind\n";
373 eqrem += blocksize[remind];
377 cout <<
"TPZConnect::ExpandShape wrong data structure remind\n";
382 if(rows != blocksize[locind] || cols != blocksize[remind]) {
383 cout <<
"TPZConnect::ExpandShape wrong data structure sizes\n";
387 for(r=0; r<rows; r++) {
388 for(c=0; c<cols; c++) {
389 phi(eqrem+c,0) += phi(eqloc+r)*(REAL)(dep->
fDepMatrix(r,c));
390 for(d=0; d<dim; d++) {
391 dphi(d,eqrem+c) += dphi(d,eqloc+r)*(REAL)(dep->
fDepMatrix(r,c));
398 for(r=0; r<blocksize[locind]; r++) {
400 for(d=0; d<dim; d++) {
401 dphi(d,eqloc+r) = 0.;
407 return Hash(
"TPZConnect::TPZDepend");
455 bool copydepend =
true;
460 depend = depend->
fNext;
477 int64_t loccondepIdx = -1;
479 if (gl2lcIdx.find(origdepconIdx) != gl2lcIdx.end()) loccondepIdx = gl2lcIdx[origdepconIdx];
482 std::stringstream sout;
483 sout <<
"ERROR in : " << __PRETTY_FUNCTION__
484 <<
" trying to clone a dependency connect index: " << origdepconIdx
485 <<
" wich is not in mapped connect indexes!" ;
504 depend = depend->
fNext;
512 depconnectlist.insert(index);
523 depconnectlist.insert(index);
527 indepconnectlist.insert(index);
534 int64_t nconnects = ConnectIndex.
NElements();
536 for(in = 0; in < nconnects; in++){
537 dfnindex = ConnectIndex[in];
539 dfn->
AddToList(dfnindex,mesh,connectlist);
548 std::set<int64_t>::iterator it;
549 for(it = additional.begin() ; it != additional.end(); it++){
551 dfn = & connectvec[ dfnindex ];
552 dfn->
AddToList(dfnindex,mesh,connectlist);
559 int64_t totalnodes = connectlist.
NElements();
560 DependenceOrder.
Resize(totalnodes);
561 DependenceOrder.
Fill(0,0);
564 int CurrentOrder = 0;
566 int64_t numnodes_processed = totalnodes;
569 while(numnodes_processed) {
571 numnodes_processed = 0;
573 for(i=0; i<totalnodes; i++) {
574 int64_t dfnindex = connectlist[i];
576 if(dfn.
HasDependency() && DependenceOrder[i] == CurrentOrder) {
580 numnodes_processed++;
int ClassId() const override
Define the class id associated with the class.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
unsigned int fNShape
Number of shape functions associated with the connect.
int64_t fSequenceNumber
Node block number.
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Contains definitions to LOGPZ_DEBUG, LOGPZ_INFO, LOGPZ_WARN, LOGPZ_ERROR and LOGPZ_FATAL, and the implementation of the inline InitializePZLOG(string) function using log4cxx library or not. It must to be called out of "#ifdef LOG4CXX" scope.
void RemoveDepend()
Deletes all dependency information.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
void SetOrder(int order, int64_t index)
Set the order of the shapefunction associated with the connect.
Templated vector implementation.
void SetLagrangeMultiplier(unsigned char mult)
Set the connect as a pressure connect or not.
TPZDepend * AddDependency(int64_t myindex, int64_t dependindex, TPZFMatrix< REAL > &depmat, int64_t ipos, int64_t jpos, int isize, int jsize)
Add dependency between connects.
REAL val(STATE &number)
Returns value of the variable.
int NDof(TPZCompMesh &mesh)
Number of degrees of freedom associated with the object.
struct TPZConnect::@47::@49 fCompose
static TPZSavable * GetInstance(const int64_t &objId)
int CheckDependency(int nshape, TPZCompMesh *mesh, int nstate)
void Read(TPZStream &buf, void *context) override
read objects from the stream
int DependencyDepth(TPZCompMesh &mesh)
the maximum number of recursive dependencies
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
TPZDepend * fDependList
Dependency list of the connect (NULL if the connect is not constrained)
unsigned char LagrangeMultiplier() const
Access method to return the indication whether the connect is associated with a pressure lagrange mul...
int NumDepend() const
size of the dependency list
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 Push(const T object)
Pushes a copy of the object on the stack.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void Reset()
Reset the data of the connect.
virtual void Write(const bool val)
Structure to reference dependency.
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
TPZConnect()
Default constructor.
#define DebugStop()
Returns a message to user put a breakpoint in.
Contains declaration of TPZConnect class which represents a set of shape functions associated with a ...
void SetNState(int nstate)
Set the number of state variables.
int64_t Rows() const
Returns number of rows.
void SetNShape(int nshape)
Set the number of shape functions associated with the connect.
int HasDependency() const
Returns whether exist dependecy information.
const TPZBlock< STATE > & Block() const
Access the block structure of the solution vector.
TPZAdmChunkVector< TPZConnect > & ConnectVec()
Return a reference to the connect pointers vector.
void BuildConnectList(int64_t index, std::set< int64_t > &indepconnectlist, std::set< int64_t > &depconnectlist, TPZCompMesh &mesh)
Builds the list of all connectivities related to ConnectIndex including the connects pointed to by de...
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Contains declaration of TPZCompMesh class which is a repository for computational elements...
void SetCondensed(bool flag)
Set the connect as a condensed connect or not.
int32_t Hash(std::string str)
void AddToList(int64_t myindex, TPZCompMesh &mesh, TPZStack< int64_t > &connectlist)
Adds itself and the connects from which it depends to the list.
TPZFNMatrix< 50, REAL > fDepMatrix
TPZConnect & operator=(const TPZConnect &con)
TPZDepend * HasDepend(int64_t DepConnectIndex)
int fNElConnected
Number of element connected.
TPZDepend * FirstDepend()
Implements computational mesh. Computational Mesh.
int NDof() const
Number of degrees of freedom associated with the object.
static void BuildDependencyOrder(TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder, TPZCompMesh &mesh)
This method builds the vector DependenceOrder which indicates in which order constrained nodes need t...
int Size(const int block_diagonal) const
Returns block dimension.
~TPZConnect()
Default destructor.
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
int64_t Cols() const
Returns number of cols.
virtual void Print(std::ostream &out) const
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
void SetDependenceOrder(int64_t myindex, TPZCompMesh &mesh, int CurrentOrder, TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder)
void Print(const TPZCompMesh &mesh, std::ostream &out=std::cout)
Print the information for the connect element.
void CopyFrom(TPZDepend *orig, std::map< int64_t, int64_t > &gl2lcIdx)
Copy a depend data structure to a clone depend in a clone mesh.
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
TPZDepend * RemoveDepend(TPZDepend *Ptr)
void ExpandShape(int64_t cind, TPZVec< int64_t > &connectlist, TPZVec< int > &blocksize, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
Implements an interface to register a class id and a restore function. Persistence.
#define PZError
Defines the output device to error messages and the DebugStop() function.
void CopyFrom(TPZConnect &orig, std::map< int64_t, int64_t > &gl2lcIdx)
Copy a connect data structure from an original connect to a new connect mapping their indexes...
virtual void Read(bool &val)