25 cout <<
"TPZCheckRestraint created for a wrong large element\n";
33 int smallsize = smallel->
NSideShapeF(fSmall.Side());
36 int smallside = fSmall.Side();
41 cout <<
"TPZCheckRestraint created for an element/side without restraint\n";
49 int largeside = fLarge.Side();
52 fRestraint.Redim(smallsize,largesize);
53 fMesh = smallel->
Mesh();
57 std::map<int, TPZMaterial * >::iterator mit = fMesh->MaterialVec().begin();
58 nstate = mit->second->NStateVariables();
61 fSmallSize.Resize(nsmallconnect);
62 fSmallPos.Resize(nsmallconnect);
63 fSmallConnect.Resize(nsmallconnect);
64 fLargeSize.Resize(nlargeconnect);
65 fLargePos.Resize(nlargeconnect);
66 fLargeConnect.Resize(nlargeconnect);
68 int nc = nsmallconnect;
69 if(nc) fSmallPos[0] = 0;
70 for(ic=0; ic<nc; ic++) {
75 cout <<
"TPZCheckRestraint incompatible small element connect dimensions\n";
77 if(ic) fSmallPos[ic] = fSmallPos[ic-1] + fSmallSize[ic-1];
81 if(nc) fLargePos[0] = 0;
82 for(ic=0; ic<nc; ic++) {
87 cout <<
"TPZCheckRestraint incompatible large element connect dimensions\n";
89 if(ic) fLargePos[ic] = fLargePos[ic-1] + fLargeSize[ic-1];
93 for(ic=0; ic<nc; ic++) {
94 AddConnect(fSmallConnect[ic]);
99 int nc = fSmallConnect.NElements();
101 for(ic=0; ic<nc; ic++)
if(fSmallConnect[ic] == connectid)
return ic;
106 int nc = fLargeConnect.NElements();
108 for(ic=0; ic<nc; ic++)
if(fLargeConnect[ic] == connectid)
return ic;
113 int smalll = SmallConnect(connectindex);
114 TPZConnect &smallc = fMesh->ConnectVec()[connectindex];
115 int large = LargeConnect(connectindex);
119 cout <<
"TPZCheckRestraint::AddConnect data structure error 0\n";
122 int firstl = fSmallPos[smalll];
124 int firstc = fLargePos[large];
125 int lastc = firstc+fLargeSize[large];
127 for(ic=firstc,il=firstl; ic<lastc; ic++,il++) {
128 fRestraint(il,ic) = 1.;
133 cout <<
"TPZCheckRestraint::AddConnect data structure error 1\n";
137 depend = depend->
fNext;
144 int smalll = SmallConnect(smallconnectindex);
146 int large = LargeConnect(largeconnectindex);
148 int firstl = fSmallPos[smalll];
149 int lastl = firstl+fSmallSize[smalll];
150 int firstc = fLargePos[large];
151 int lastc = firstc+fLargeSize[large];
153 if (firstc != lastc && firstl != lastl && (firstc < 0 || lastc > fRestraint.Cols() || firstl < 0 || lastl > fRestraint.Rows())){
154 cout <<
"TPZCheckRestraint::AddDependency : indexing error\n";
159 if ((lastc - firstc) != dependmatrix.
Cols() || (lastl-firstl) != dependmatrix.
Rows()){
160 cout <<
"TPZCheckRestraint::AddDependency : incompatible dimensions\n";
165 for(il=firstl; il<lastl; il++) {
166 int line = il - firstl;
167 for (ic=firstc; ic<lastc; ic ++){
168 int column = ic - firstc;
169 if (ic < 0 || ic >= fRestraint.Cols() || il < 0 || il >= fRestraint.Rows()){
170 cout <<
"TPZCheckRestraint::AddDependency : Should never pass here, was already checked 1\n";
175 if (line >= dependmatrix.
Rows() || column >= dependmatrix.
Cols()){
176 cout <<
"TPZCheckRestraint::AddDependency : Should never pass here, was already checked 2\n";
181 fRestraint(il,ic) += (REAL)dependmatrix(line,column);
185 TPZConnect &largec = fMesh->ConnectVec()[largeconnectindex];
189 cout <<
"TPZCheckRestraint::Error:\tLarge connect without dependency\n";
197 depcols = dependmatrix.
Cols();
199 if (deprows != depcols){
200 cout <<
"TPZCheckRestraint::Error:\tLarge connect without dependency\n";
207 depend = depend->
fNext;
234 PZError <<
"TPZCheckRestraint::CheckRestraint transformation error!\n";
236 int numint = intrule->
NPoints();
237 int numshapes = fRestraint.Rows();
238 int numshapel = fRestraint.Cols();
239 TPZFMatrix<REAL> phis(numshapes,1),dphis(dims,numshapes),phil(numshapel,1),dphil(diml,numshapel);
244 for(
int it=0; it<numint; it++) {
245 intrule->
Point(it,points,weight);
247 t.Apply(points,pointl);
249 fRestraint.Multiply(phis,philcheck,1);
251 for(in=0; in<numshapel; in++) {
252 error += (philcheck(in,0)-phil(in,0))*(philcheck(in,0)-phil(in,0));
254 error =
sqrt(error/numshapel);
257 cout <<
"TPZCheckRestraint failed error = " << error << endl;
266 fSmall.Element()->Print(out);
267 out <<
"Small side: " <<fSmall.Side() << endl;
268 fLarge.Element()->Print(out);
269 out <<
"Large side: " <<fLarge.Side() << endl;
270 fRestraint.Print(
"Restraint Matrix",out);
272 out <<
"hierarqui of elements ";
273 fSmall.Reference().Element()->Print(out);
278 out <<
"Small element side = " << smallgeo.
Side() << endl;
279 out <<
"Small geometric element printout \n";
285 out <<
"TPZCheckRestraint::Print inconsistent datastructure\n";
287 out <<
"Small element side = " << smallgeo.
Side() << endl;
288 out <<
"Small geometric element printout \n";
291 out <<
"Large element side = " << largegeo.
Side() << endl;
292 out <<
"Large geometric element printout \n";
295 int nsmal = fSmallConnect.NElements();
296 int nlarge = fLargeConnect.NElements();
299 out <<
"fSmallConnect" << endl;
300 for (is=0;is<nsmal;is++){
301 out <<
"fSmallConnect [ " << is <<
"] = \t " << fSmallConnect[is] << endl;
305 out <<
"fLargeConnect" << endl;
306 for (il=0;il<nlarge;il++){
307 out <<
"fLargeConnect [ " << il <<
"] = \t " << fLargeConnect[il] << endl;
321 fSmall.Reference().Element()->LowerDimensionSides(fSmall.Side(),smalldim);
324 for(s=0; s<cap; s++) {
327 if(!largedim.Exists())
continue;
330 (cout) <<
"CheckRestraint failed for :" << endl;
332 (cout) <<
"CheckRestraint is consistent for : " << endl;
335 int cind = largedim.Element()->ConnectIndex(largedim.Side());
337 while(largelargedim.
Exists() && LargeConnect(cind) == -1) {
340 (cout) <<
"CheckRestraint failed for :" << endl;
342 (cout) <<
"CheckRestraint is consistent for : " << endl;
345 largedim = largelargedim;
347 if(largelargedim.
Exists()) {
350 (cout) <<
"TPZCheckRestraint::Diagnose inconsistent data structure 2\n";
This class performs a series of consistency tests on geometric transformations between elements...
virtual TPZGeoElSide Father2(int side) const
Returns the father/side of the father which contains the side of the sub element. ...
Contains the TPZInt1d, TPZIntTriang, TPZIntQuad, TPZIntCube3D, TPZIntTetra3D, TPZIntPyram3D and TPZIn...
Will verify the consistency of the restraints of shape functions along a side. Computational Element...
virtual int NPoints() const =0
Returns number of points for the cubature rule related.
TPZCompElSide LowerLevelElementList(int onlyinterpolated)
Returns all connected elements which have level lower to the current element.
Implements computational element and a side. Computational Element.
Represents a set of shape functions associated with a computational element/side. Computational Eleme...
Contains declaration of TPZGeoElSide class which represents an element and its side, and TPZGeoElSideIndex class which represents an TPZGeoElSide index.
Contains declaration of TPZCheckRestraint class which verify the consistency of the restraints of sha...
void Print(std::ostream &out)
Prints the information into the computational elements and side and geometric information also...
virtual int NConnectShapeF(int icon, int order) const =0
Returns the number of shapefunctions associated with a connect.
TPZCheckRestraint(TPZCompElSide smalll, TPZCompElSide large)
Constructor with small and large element with commom side.
TPZGeoElSide Reference() const
Reference to the geometric element.
Contains declaration of TPZCheckGeom class which performs a series of consistency tests on geometric ...
void Diagnose()
Get the small element and check restraints with all elements with lower dimension on side correspondi...
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
virtual int SideDimension(int side) const =0
Return the dimension of side.
void SideTransform3(TPZGeoElSide neighbour, TPZTransform<> &t)
Accumulates the transformations from the current element/side to the neighbour/side.
int CheckDependency(int nshape, TPZCompMesh *mesh, int nstate)
virtual void SideShapeFunction(int side, TPZVec< REAL > &point, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi) override=0
Compute the values of the shape function along the side.
Abstract class defining integration rules. Numerical Integration.
TPZTransform< REAL > ComputeParamTrans(TPZGeoEl *fat, int fatside, int sideson)
virtual TPZIntPoints * CreateSideIntegrationRule(int side, int order)=0
Creates an integration rule for the topology of the corresponding side and able to integrate a polyno...
unsigned char Order() const
Access function to return the order associated with the connect.
void AddDependency(int smallconnectid, int largeconnectid, TPZFMatrix< REAL > &depend)
Structure to reference dependency.
virtual void SetOrder(TPZVec< int > &ord, int type=0)=0
Sets the order of the cubature rule.
int CheckRestraint()
Gets the shape functions over the sides of the small and large elements and check the matrix restrain...
virtual int SideConnectLocId(int icon, int is) const override=0
Returns the local node number of icon along is.
TPZCompMesh * Mesh() const
Return a pointer to the grid of the element.
int64_t Rows() const
Returns number of rows.
int CheckSubFatherTransform(TPZGeoEl *subel, int sidesub)
verify if the transformation between sons and father are conforming
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
int Exists() const
Verifies if the object is non null (initialized)
Contains declaration of TPZCompMesh class which is a repository for computational elements...
virtual TPZConnect & Connect(int i) const
Returns a pointer to the ith node.
int LargeConnect(int connectid)
std::map< int,TPZMaterial *> & MaterialVec()
Returns a reference to the material pointers vector.
virtual int64_t ConnectIndex(int i) const =0
Returns the index of the ith connectivity of the element.
int CheckRefinement(TPZGeoEl *gel)
check the maps between the element and its father
TPZGeoEl * Element() const
TPZFNMatrix< 50, REAL > fDepMatrix
int NSideShapeF(int side) const
Returns the number of shape functions on a side.
TPZCompEl * Element() const
Gives a pointer to the reference computational element.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
TPZCompElSide Reference() const
Returns a pointer to the elementside referenced by the geometric elementside.
virtual int NSideConnects(int iside) const override=0
Returns the number of dof nodes along side iside.
int Dimension() const
the dimension associated with the element/side
int64_t SideConnectIndex(int icon, int is) const
Returns the index of the c th connect object along side is.
TPZDepend * FirstDepend()
Contains declaration of TPZInterpolatedElement class which implements computational element of the in...
int64_t Cols() const
Returns number of cols.
int NeighbourExists(const TPZGeoElSide &neighbour) const
Returns 1 if neighbour is a neighbour of the element along side.
int64_t NElements() const
Returns the number of elements of the vector.
void AddConnect(int connectindex)
virtual void Print(std::ostream &out=std::cout)
Print all relevant data of the element to cout.
TPZFMatrix< REAL > & RestraintMatrix()
Returns the restraint matrix.
Implements computational element based on an interpolation space. Computational Element.
virtual void Point(int i, TPZVec< REAL > &pos, REAL &w) const =0
Returns i-th point at master element and related weight.
#define PZError
Defines the output device to error messages and the DebugStop() function.
int SmallConnect(int connectid)