13 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzelmat"));
19 short BlSizei,
short BlSizej) {
22 if(fMat.Rows() != NumBli*BlSizei || fMat.Cols() != NumBlj*BlSizej) {
23 fMat.Redim(NumBli*BlSizei,NumBlj*BlSizej);
28 short BlSizei,
short BlSizej) {
31 if(fMat.Rows() < NumBli*BlSizei || fMat.Cols() < NumBlj*BlSizej) {
32 fMat.Redim(NumBli*BlSizei,NumBlj*BlSizej);
37 fType(cp.fType), fMesh(cp.fMesh), fConnect(cp.fConnect), fMat(cp.fMat),
38 fBlock(cp.fBlock), fConstrConnect(cp.fConstrConnect), fConstrMat(cp.fConstrMat),
39 fConstrBlock(cp.fConstrBlock), fDestinationIndex(cp.fDestinationIndex),
40 fSourceIndex(cp.fSourceIndex)
52 out <<
"Connect vector\n";
53 for(ic=0; ic<ncon; ic++) {
55 out <<
"ic = " << ic <<
" index " <<
fConnect[ic] <<
" ";
58 out <<
"Constrained connect vector\n";
61 for(ic=0; ic<ncon; ic++) {
63 out <<
"ic = " << ic <<
' ';
72 for(in=0; in<size; in++)
74 for (jn=0; jn<size; jn++) {
87 std::stringstream sout;
101 for(in=0; in<size; in++)
114 std::stringstream sout;
130 int64_t destindex = 0L;
131 int64_t fullmatindex = 0L;
133 for(
int in = 0; in < numnod; in++){
151 if (logger->isDebugEnabled())
153 std::stringstream sout;
161 int64_t destindex = 0L;
162 int64_t fullmatindex = 0L;
166 for(
int in = 0; in < numnod; in++){
196 std::set<int64_t> origlist,connectlist;
197 for(in=0; in<totalnodes; in++) connectlist.insert(this->fConnect[in]);
199 for (
int c=0; c< it->fFaces.size(); c++) {
200 connectlist.insert(it->fFaces[c].first);
203 origlist = connectlist;
207 std::set<int64_t>::iterator it = connectlist.begin();
208 for (int64_t i=0; i<connectlist.size(); i++) {
232 for(in=0; in<totalnodes; in++) {
258 for(in=0; in<numnod; in++) {
262 while(irnode < totalnodes && this->
fConstrConnect[irnode] != idfn) irnode++;
274 for(i=ifirst,ir=irfirst;i<ilast;i++,ir++) {
275 for(ieq=0; ieq<nrhs; ieq++) {
282 for(jn=0; jn<numnod; jn++) {
286 while(jrnode < totalnodes && this->
fConstrConnect[jrnode] != jdfn) jrnode++;
287 if(jrnode == totalnodes) {
288 LOGPZ_WARN(logger,
"node not found in node list");
297 for(i=ifirst,ir=irfirst;i<ilast; i++,ir++) {
298 for(j=jfirst,jr=jrfirst;j<jlast; j++,jr++) {
306 int numnodes_processed = 0;
307 int current_order = 0;
308 while(numnodes_processed < totalnodes) {
310 for(in=0; in<totalnodes; in++) {
313 if(DependenceOrder[in] != current_order)
continue;
317 numnodes_processed++;
330 while(depindex < totalnodes && this->
fConstrConnect[depindex] != depnodeindex) depindex++;
331 if(depindex == totalnodes) {
332 LOGPZ_WARN(logger,
"node not found in node list");
346 int numstate = dfn->
NState();
347 for(send=inpos; send<inpos+insize; send += numstate) {
348 for(receive=deppos; receive<deppos+depsize; receive += numstate) {
349 coef = dep->
fDepMatrix((send-inpos)/numstate,(receive-deppos)/numstate);
351 for(ieq=0; ieq<toteq; ieq++)
for(idf=0; idf<numstate; idf++) {
356 for(ieq=0; ieq<nrhs; ieq++)
for(idf=0; idf<numstate; idf++) {
364 for(send=inpos; send<inpos+insize; send += numstate) {
365 for(receive=deppos; receive<deppos+depsize; receive += numstate) {
366 coef = dep->
fDepMatrix((send-inpos)/numstate,(receive-deppos)/numstate);
367 for(ieq=0; ieq<toteq; ieq++)
for(idf=0; idf<numstate; idf++) {
398 if (it->fFaces[0].first != dfnindex) {
403 if (count && logger->isDebugEnabled()) {
404 std::stringstream sout;
405 sout <<
"Element matrix before ApplyOneShapeConstraint\n";
415 if (it->fFaces[0].first != dfnindex) {
418 int64_t send = inpos+it->fFaces[0].second;
419 for (
int id=1;
id<4;
id++) {
420 int64_t depindex = it->fFaces[id].first;
431 int64_t receive = deppos+it->fFaces[id].second;
432 REAL coef = -it->fOrient[id]/it->fOrient[0];
434 for(
int ieq=0; ieq<toteq; ieq++) {
441 for(
int ieq=0; ieq<nrhs; ieq++) {
447 for(
int ieq=0; ieq<toteq; ieq++)
455 for(
int ieq=0; ieq<toteq; ieq++)
464 for(
int ieq=0; ieq<nrhs; ieq++) {
471 if (count && logger->isDebugEnabled()) {
472 std::stringstream sout;
473 sout <<
"Element matrix after ApplyOneShapeConstraint\n";
489 for(in=0; in<nconnects; in++)
514 if (logger->isDebugEnabled()) {
515 std::stringstream sout;
527 for (int64_t
idf=0;
idf<iblsize; ++
idf) {
528 for (int64_t jdf=0; jdf<jblsize; ++jdf) {
541 for (int64_t
idf=0;
idf<iblsize; ++
idf) {
542 for (int64_t jdf=0; jdf<jblsize; ++jdf) {
554 int64_t totalnodes = connectlist.
NElements();
555 DependenceOrder.
Resize(totalnodes);
556 DependenceOrder.
Fill(0,0);
559 int CurrentOrder = 0;
561 int64_t numnodes_processed = totalnodes;
564 for (
int i=1; i<4; i++)
566 int64_t index = it->fFaces[1].first;
574 while(numnodes_processed) {
576 numnodes_processed = 0;
578 for(i=0; i<totalnodes; i++) {
579 int64_t dfnindex = connectlist[i];
581 if(dfn.
HasDependency() && DependenceOrder[i] == CurrentOrder) {
585 numnodes_processed++;
590 numnodes_processed++;
int Position(const int block_diagonal) const
Returns the position of first element block dependent on matrix diagonal.
int Set(const int index, const int dim, const int pos=-1)
Modifies existing block dimensions or creates a new block with given index.
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 SetMatrixMinSize(short NumBli, short NumBlj, short BlMinSizei, short BlMinSizej)
TPZBlock< STATE > fConstrBlock
Block structure associated with fConstrMat.
void BuildDependencyOrder(TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder, TPZCompMesh &mesh)
Compute the dependency order of the connects, considering the one shape restraints.
virtual void resize(const int64_t newsize)
TPZStack< int64_t > fConnect
Vector of pointers to TPZConnect objects.
void ApplyOneShapeConstraints(int constraintindex)
Apply the constraint of the one shape restraints.
TPZFNMatrix< 1000, STATE > fMat
Pointer to a blocked matrix object.
std::list< TPZOneShapeRestraint > fOneRestraints
list of one degree of freedom restraints
int NDof(TPZCompMesh &mesh)
Number of degrees of freedom associated with the object.
#define LOGPZ_WARN(A, B)
Define log for warnings.
TPZBlock< STATE > fBlock
Block structure associated with fMat.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
TPZManVector< int64_t > fDestinationIndex
void ComputeDestinationIndices()
#define LOGPZ_FATAL(A, B)
Define log for fatal errors (cout)
Contains declaration of TPZElementMatrix struct which associates an element matrix with the coeficien...
int64_t ConnectIndex(int i) const
Returns the pointer to the ith node of the element.
void Print(std::ostream &out)
int64_t size() const
Returns the number of elements of the vector.
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...
int64_t SequenceNumber() const
Returns the Sequence number of the connect object.
int NConnects()
Returns the number of nodes of TElementMatrix.
Structure to reference dependency.
void SetMatrixSize(short NumBli, short NumBlj, short BlSizei, short BlSizej)
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
TPZStack< int64_t > fConstrConnect
Vector of all nodes connected to the element.
unsigned int NShape() const
int64_t Rows() const
Returns number of rows.
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.
TPZManVector< int64_t > fSourceIndex
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...
int SetNBlocks(const int num_of_blocks)
Sets number of blocks on diagonal matrix.
Contains declaration of TPZCompMesh class which is a repository for computational elements...
int Redim(const int64_t newRows, const int64_t newCols) override
Redimension a matrix and ZERO your elements.
unsigned char NState() const
Number of state variables associated with the connect.
This class associates an element matrix with the coeficients of its contribution in the global stiffn...
TPZFNMatrix< 1000, STATE > fConstrMat
Pointer to the constrained matrix object.
int NBlocks() const
Returns number of blocks on diagonal.
void ApplyConstraints()
Apply the constraints applied to the nodes by transforming the tangent matrix and right hand side...
TPZFNMatrix< 50, REAL > fDepMatrix
void PermuteGather(TPZVec< int64_t > &permute)
permute the order of the connects
TPZDepend * FirstDepend()
Implements computational mesh. Computational Mesh.
int Size(const int block_diagonal) const
Returns block dimension.
void SetMatrix(TPZMatrix< TVar > *const other)
Changes pointer to other.
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
int64_t NElements() const
Returns the number of elements of the vector.
void Print(const char *title="", TPZostream &out=std::cout, TPZMatrix< TVar > *mat=NULL)
Prints all the blocks of the matrix.
void SetDependenceOrder(int64_t myindex, TPZCompMesh &mesh, int CurrentOrder, TPZVec< int64_t > &connectlist, TPZVec< int > &DependenceOrder)
bool IsCondensed() const
Access method to return the indication whether the connect is condensed or not.
bool HasDependency()
Returns true if the element has at least one dependent node. Returns false otherwise.
Non abstract class which implements full matrices with preallocated storage with (N+1) entries...
int Resequence(const int start=0)
Resequences blocks positioning.