35 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.TPZRefPattern"));
40 fSideRefPattern(0), fPermutedRefPatterns(0), fNSubEl(0){
80 std::ifstream
input(file.c_str());
98 if(father->
Type() != compfather->
Type())
105 std::map<int,int> nodemap;
110 for(in = 0; in < nnodes; in++){
114 for(
int i = 0; i < 3; i++){
120 for(jn = 0; jn < nnodes; jn++){
122 for(j = 0; j < 3; j++){
126 for(j=0 ; j<dim; j++){
127 diff[jn] += (coord[j]-coordcompare[j])*(coord[j]-coordcompare[j]);
130 diff[jn] =
sqrt(diff[jn]);
144 std::map<int,int> elementmap;
147 for(iel = 0; iel < nelem; iel++)
149 std::set<int> nodeset;
151 int nnode = igel->
NNodes();
154 for(in = 0; in < nnode; in++)
156 nodeset.insert(nodemap[igel->
NodeIndex(in)]);
160 for(jel = 0; jel < nelem; jel++)
162 if(elementmap.find(jel) != elementmap.end())
166 std::set<int> compnodeset;
168 int jnnode = jgel->
NNodes();
176 for(jn = 0; jn < jnnode; jn++)
181 if(nodeset == compnodeset)
183 elementmap[jel] = iel;
200 out <<
"TPZRefPattern::PrintMore\n\n";
202 out <<
"Refinement Pattern named " <<
fName << std::endl;
204 out<<
"SUB-ELEMENT INFO"<<std::endl;
206 for(iSubEl=0;iSubEl<nSubs;iSubEl++){
207 out<<
"sub-el: "<<iSubEl<<std::endl;
209 for(iSide=0;iSide<nSides;iSide++){
210 out<<
"\tside: "<<iSide<<std::endl;
211 out<<
"\tfather side: "<<
fSubElSideInfo[iSubEl][iSide].first<<std::endl;
213 out <<
"\tsub/side = " << iSubEl + 1 <<
"/" << iSide <<
" FatherSide = " <<
fSubElSideInfo[iSubEl][iSide].first << std::endl;
214 out <<
"\tTransform = " << std::endl;
215 transform.Mult().
Print(
"Transformation T: ", out);
216 transform.Sum().Print(
"Translation b: ", out);
220 out<<
"FATHER SIDES INFO"<<std::endl;
222 for(iSide=0;iSide<nSidesFather;iSide++){
223 out<<
"side :"<<iSide<<std::endl;
226 out<<
"\tInternal nodes:"<<std::endl;
228 for(
int iNode = 0; iNode < nNodes; iNode++){
229 out<<
"\t\tnode "<<iNode<<
" index: "<<fatherInfo.
fSideNodes[iNode]<<std::endl;
232 out<<
"\tSubGeoElSides:"<<std::endl;
234 for(
int iGeoElSide = 0; iGeoElSide < nSideSons; iGeoElSide++){
236 out<<
" side: "<< fatherInfo.
fSideSons[iGeoElSide].Side()<<std::endl;
249 int nsides = fatherEl->
NSides();
253 out <<
" Id " <<
fId <<
" Sides " ;
254 for (
int p=0 ; p<nsides; p++){
264 for(
int c = 0; c < 3; c++)
280 int64_t nNodes = rGmesh.
NNodes();
284 for(int64_t i = 0; i < nNodes; i++) NodeCoord[i].Resize(3,0.);
287 for(int64_t n = 0; n < nNodes; n++)
289 NodeCoord[n][0] = rGmesh.
NodeVec()[n].Coord(0);
290 NodeCoord[n][1] = rGmesh.
NodeVec()[n].Coord(1);
291 NodeCoord[n][2] = rGmesh.
NodeVec()[n].Coord(2);
297 for(int64_t n = 0; n < nNodes; n++)
299 Node[n].SetNodeId(n);
300 Node[n].SetCoord(NodeCoord[n]);
303 for(int64_t el = 1; el < nElements; el++)
307 int64_t
id = Elem->
Id();
308 for(
int n = 0; n < Elem->
NNodes(); n++)
321 out <<
fId <<
' ' <<
fName << std::endl << std::endl ;
325 for (
int k=0; k<3; k++)
352 for(
int el = 0; el < nperm; el++)
359 int nsides = father->
NSides();
361 for(is=0; is<nsides; is++)
369 return Hash(
"TPZRefPattern");
373 int nSubElSides = -1;
374 buf.
Read(&nSubElSides);
376 for(
int iSubElSide = 0; iSubElSide < nSubElSides; iSubElSide++){
380 for(
int iSide = 0; iSide < nSides; iSide++){
384 second.
Read(buf,context);
399 buf.
Write(&nSubElSides);
400 for(
int iSubElSide = 0; iSubElSide < nSubElSides; iSubElSide++){
403 for(
int iSide = 0; iSide < nSides; iSide++){
423 PZError <<
"The refinement pattern is not in a consistent state."<<std::endl;
424 PZError <<
"It has two different values of number of sub-elements, namely: "<<std::endl;
426 PZError <<
"Aborting..."<<std::endl;
437 PZError <<
"TPZRefPattern::FatherSide: wrong parameter 'sub'."<<std::endl;
438 PZError <<
"The current ref pattern has "<<
NSubElements()<<
" and the parameter 'sub' was "<<sub<<std::endl;
443 PZError <<
"TPZRefPattern::FatherSide: wrong parameter 'side'."<<std::endl;
445 PZError <<
"and the parameter 'side' was "<<side<<std::endl;
477 if(subElSide<0 || subElSide >= subEl->
NSides()){
507 const int side = fatherSide.
Side();
510 if(geoElSide.Element() == son)
return true;
517 if(iel < 0 || iel >= nel){
518 PZError <<
"TPZRefPattern::Element the element with the following id does not exist: " << iel << std::endl;
533 if(subElSide.Dimension() == 0){
535 nodeIndexes[count].SetElementIndex(nodeIndexes[count].ElementIndex());
548 sideIndexes.
Resize(nSubElSides);
549 for(
int iSub = 0; iSub < nSubElSides; iSub++){
551 sideIndexes[iSub].SetElementIndex(sideIndexes[iSub].ElementIndex());
563 return gelvec.
size();
577 newnodeindexes.
Resize(totalNodes);
580 std::cout <<
"CreateNewNodes called for an element which is already divided. \n";
585 int nSides = gel->
NSides();
586 for (
int side = nNodes;side<nSides;side++){
601 while(neighbour.Element() && neighbour != gelside){
602 if(neighbour.HasSubElement() && neighbour.Element()->NSideSubElements(neighbour.Side()) > 1)
604 neighbour.Element()->MidSideNodeIndices(neighbour.Side(),sideindices);
607 neighbour = neighbour.Neighbour();
609 for (
int j=0;j<sideNodes.
NElements();j++){
610 int index = sideNodes[j];
615 for (
int k=0;k<3;k++){
617 refnodecoord_X[k] = coord;
623 for(
int iX = 0; iX <
Element(0)->
Dimension(); iX++) newnodecoord_xi[iX] = refnodecoord_X[iX];
627 gel->
X(newnodecoord_xi,newnodecoord_X);
629 newnodeindexes[index] = -1;
630 REAL smallestDiff = -1.;
631 int smallestDiffIndex = -1;
633 for(
int i=0; i< sideindices.NElements(); i++)
635 for(
int k=0; k<3; k++) neighbourcoord_X[k] = gmesh->
NodeVec()[sideindices[i]].Coord(k);
637 for (
int k=0;k<3;k++)
639 dif += (newnodecoord_X[k] - neighbourcoord_X[k]) * (newnodecoord_X[k] - neighbourcoord_X[k]);
641 if(smallestDiffIndex < 0. || smallestDiff > dif)
644 smallestDiffIndex = i;
647 if (smallestDiff < 1e-2 && sideindices.NElements() != 0)
649 newnodeindexes[index] = sideindices[smallestDiffIndex];
651 if (smallestDiff >= 1.e-2 && sideindices.NElements() != 0)
655 std::stringstream sout;
656 sout <<
"Incompatible refinement patterns detected\n";
657 sout <<
"Closest node at distance " << smallestDiff << std::endl;
662 std::cout <<
"Refpattern is trying to create midnode but there is another node which is not in the right position!\n";
663 std::cout <<
"Either the refinement patterns are incompatible or there is an issue with the mapping.\n";
664 std::cout <<
"newnodecoord_X(" << newnodecoord_X[0] <<
"," << newnodecoord_X[1] <<
"," << newnodecoord_X[2] <<
")" << std::endl;
665 std::cout <<
"neighbourcoord_X(" << neighbourcoord_X[0] <<
"," << neighbourcoord_X[1] <<
"," << neighbourcoord_X[2] <<
")" << std::endl;
668 if (newnodeindexes[index] == -1)
672 gmesh->
NodeVec()[newindex].Initialize(newnodecoord_X,*gmesh);
673 newnodeindexes[index] = newindex;
687 int nsides = fatherEl->
NSides();
691 int thisId = this->
Id();
695 for(is=0; is<nsides-1; is++)
712 if(!found.operator ->())
742 std::list<TPZRefPatternPermute> &permlist =
fPermutations[geltype];
743 std::list<TPZRefPatternPermute>::iterator it;
747 for(it=permlist.begin(), counter=0; it != permlist.end(); it++,counter++)
753 if (logger->isDebugEnabled())
755 std::stringstream sout;
756 sout <<
"Permutation " << it->fPermute;
757 sout <<
"Created refpattenr refp ";
759 sout <<
"found refpattern ";
760 if(found) found->
Print(sout);
761 else sout <<
"Pattern not found";
783 if(!sideref)
return nullptr;
795 std::list<TPZRefPatternPermute> &permlist =
fPermutations[type];
796 std::list<TPZRefPatternPermute>::iterator it;
797 for(it = permlist.begin(); it != permlist.end(); it++)
822 for(
int n = 0; n < nNodes; n++)
829 for(
int n = 0; n < nNodes; n++)
835 for(c = 0; c < dim; c++)
837 double qsi = coordQSIprojected[c];
850 PZError <<
"Error at " << __PRETTY_FUNCTION__ <<
" at line " << __LINE__ <<
" Father Element is NULL\n";
863 int iNode, nNodes = fatherEl->
NNodes();
864 for(iNode = 0; iNode < nNodes; iNode++)
869 for(iNode = 0; iNode < nNodes; iNode++)
878 refpermute.fPermute = permute;
879 refpermute.fTransform = trans;
886 permute.
Permute(nodes,nodesPerm);
892 for(
int iPermute = 1; iPermute < nPermutes; iPermute++){
894 for(iNode = 0; iNode < nNodes; iNode++) {
895 if ( permutedSides[iNode] != nodesPerm[iNode])
break;
917 PZError <<
"TPZRefPattern::ComputePartition Father not exists?!\n";
928 for(
int iSubEl=0; iSubEl < nSubEls; iSubEl++)
932 int nSides = son->
NSides();
934 for(
int iSide = 0; iSide < nSides; iSide++)
939 son->
X(massCenter,xPoint);
940 for(
int iX = 0; iX < dim; iX++) fatherParam[iX] = xPoint[iX];
941 const int fatherSide = fatherEl->
WhichSide(fatherParam);
952 int nSides = fatherEl->
NSides();
955 for(
int iSide = 0; iSide < nSides; iSide++){
960 const int nSideNodes = fatherEl->
NSideNodes(iSide);
961 for(
int iNode = 0; iNode < nSideNodes; iNode++){
965 for(
auto iSubEl = 0; iSubEl <
NSubElements(); iSubEl++){
967 for(
auto iSubElSide = 0; iSubElSide < subEl->
NSides(); iSubElSide ++){
968 int fatherSide =
FatherSide(iSubElSide,iSubEl);
969 if(fatherSide == iSide){
971 bool isInList =
false;
972 for(
int iGelSide = 0; iGelSide < sideSonsStack.
size(); iGelSide++){
976 if(neighbour == sideSonsStack[iGelSide]){
984 sideSonsStack.
push_back(geoElSideCandidate);
986 const int nodeIndex = subEl->
NodeIndex(iSubElSide);
987 bool isNodeInList =
false;
988 const int nCornerNodes = cornerNodeStack.
size();
989 const int nInternalNodes = internalNodesStack.
size();
990 for(
int iNode = 0; iNode < nInternalNodes; iNode++){
991 if(internalNodesStack[iNode] == nodeIndex) isNodeInList =
true;
994 for(
int iNode = 0; iNode < nCornerNodes && fatherEl->
SideDimension(iSide) > 0; iNode++){
995 if(cornerNodeStack[iNode] == nodeIndex) isNodeInList =
true;
1006 for(
auto iNode = 0; iNode < internalNodesStack.
size(); iNode++){
1010 for(
auto iSubEl = 0; iSubEl < sideSonsStack.
size(); iSubEl++){
1018 for(
int i = 0; i < nSubEls; i++){
1023 PZError<<
"TPZRefPattern::FindSubEl: ERROR"<<std::endl;
1024 PZError<<
"This method should not be called with an element ";
1025 PZError<<
"that is not a sub-element of this Refinement Pattern."<<std::endl;
1026 PZError<<
"Aborting..."<<std::endl;
1033 if(fatherSide < 0 || fatherSide >= nSides)
1035 PZError <<
"TPZRefPattern::NSideSubElements: wrong argument\n";
1036 PZError <<
"father side = " << fatherSide << std::endl;
1045 if(fatherSide < 0 || fatherSide >= nSides || subEl < 0 || subEl >= nSubGeoElSides)
1047 PZError <<
"TPZRefPattern::CheckSideAndSubElConsistency: wrong argument\n";
1048 PZError <<
"father side = " << fatherSide << std::endl;
1049 PZError <<
"subEl = " << subEl << std::endl;
1063 std::map<int,int> allsidenodes;
1066 allsides.
Push(side);
1075 if(!allsidenodes.count(sidenodes[t])) allsidenodes[sidenodes[t]] = count++;
1079 std::map<int,int>::iterator it;
1080 for(it = allsidenodes.begin(); it!= allsidenodes.end(); it++)
1082 int nodeorig = (*it).first;
1083 int nodedest = (*it).second;
1086 SideRefPatternMesh.
NodeVec()[nodedest].SetNodeId(nodedest);
1091 for(in=0; in<nodeindices.
NElements(); in++)
1093 nodeindices[in] = allsidenodes[gel->
SideNodeIndex(side,in)];
1103 for(subel=0; subel<
nsub; subel++)
1105 if(gelvec[subel].Dimension() != sidedim)
1110 for(in=0; in<nodeindices.
NElements(); in++)
1112 nodeindices[in] = allsidenodes[gelvec[subel].SideNodeIndex(in)];
1114 MElementType type = gelvec[subel].Element()->Type(gelvec[subel].Side());
1131 int nn = father->
NNodes();
1133 for(in=0; in<nn; in++){
1136 permute.
Permute(nodes,nodeperm);
1137 for(in=0; in<nn; in++){
1146 pattern >> nNodes >> nElems;
1153 for(
int iNode = 0; iNode < nNodes; iNode++)
1155 pattern >> coord[0];
1156 pattern >> coord[1];
1157 pattern >> coord[2];
1162 int ntype, nummat, naorners, incid, el;
1163 for(el=0; el<nElems; el++)
1165 pattern >> ntype >> nummat;
1169 for(incid = 0; incid < naorners; incid++)
1171 pattern >> nodes[incid];
1196 for(
int iSubEl = 0; iSubEl <
fNSubEl; iSubEl++){
1213 int dimFather = geoElFather->
Dimension();
1217 if(dimSideFather < dimSideSon){
1218 PZError <<
"\nTPZRefPattern::ComputeParamTransform called with sides error\n";
1230 int tam = (dimSideSon+1);
1237 REAL D2Edaikdaij,D2Edcidaij,D2Edci2;
1240 for(ij=0;ij<dimSideSon;ij++){
1241 for(ik=ij;ik<dimSideSon;ik++){
1244 for(indp = 0; indp < intrule->
NPoints(); ++indp){
1245 intrule->
Point(indp,intpoint,weight);
1246 D2Edaikdaij += intpoint[ik]*intpoint[ij]*weight;
1247 if(ik==ij) D2Edcidaij += intpoint[ij]*weight;
1248 if(ij==0 && ik==0) D2Edci2 += weight;
1250 hess(ij,ik) = 2.*D2Edaikdaij;
1251 hess(ik,ij) = hess(ij,ik);
1253 hess(ij,dimSideSon) = 2.*D2Edcidaij;
1254 hess(dimSideSon,ij) = hess(ij,dimSideSon);
1256 if(ij==0 && ik==0) hess(dimSideSon,dimSideSon) = 2.*D2Edci2;
1265 TPZFNMatrix<9> Amat(dimSideFather,dimSideSon,0.),Bmat(dimSideFather,1,0.);
1270 for(
int ifat=0;ifat<dimSideFather;ifat++){
1272 for(j=0;j<(dimSideSon+1);j++){
1274 for(indp = 0; indp < intrule->
NPoints(); ++indp){
1275 intrule->
Point(indp,intpoint,weight);
1276 transformSideToSon.
Apply(intpoint,sidepoint);
1277 geoElSon->
X(sidepoint,x);
1278 for(
int iX = 0; iX < dimFather; iX++) xiFather[iX] = x[iX];
1279 fatelside.
Apply(xiFather,xiFatherSide);
1280 if(j<dimSideSon) DEdaij += xiFatherSide[ifat]*intpoint[j]*weight;
1281 if(j==0) DEdci += xiFatherSide[ifat]*weight;
1283 if(j<dimSideSon) grad0(j,0) = 2.*DEdaij;
1284 if(j==0) grad0(dimSideSon,0) = 2.*DEdci;
1285 if(!dimSideSon) grad0(0,0) = DEdci;
1289 for(
int k=0;k<dimSideSon;k++) Amat(ifat,k) = grad0(k,0);
1290 Bmat(ifat,0) = grad0(dimSideSon,0);
1300 return Hash(
"TPZRefPattern::TPZRefPatternPermute");
1304 fPermute.Read(buf, context);
1305 fTransform.Read(buf, context);
1309 fPermute.Write(buf, withclassid);
1310 fTransform.Write(buf, withclassid);
1314 buf.
Read(fSideNodes);
1315 buf.
Read(fSideSons);
1319 buf.
Write(fSideNodes);
1320 buf.
Write(fSideSons);
virtual int64_t SideNodeIndex(int side, int nodenum) const =0
Returns the index of the nodenum node of side.
void PermuteMesh(const TPZPermutation &permute)
Copy the mesh structure applying the permutation on the nodenumbers of the first element.
void Print(std::ostream &out=std::cout)
Prints the structural information of the vector object to the output stream. This method will not p...
TPZVec< TPZVec< std::pair< int, TPZTransform< REAL > > > > fSubElSideInfo
Data structure with sub element info.
bool CheckSideConsistency(const int fatherSide) const
void Permute(const TPZVec< int > &in, TPZVec< int > &out) const
Applies the current permutation on the vector in and produces the vector out.
TPZVec< TPZGeoElSide > fSideSons
a vector of TPZGeoElSide relative to its sons
int AllocateNewElement()
Makes more room for new elements.
virtual int NPoints() const =0
Returns number of points for the cubature rule related.
virtual void LowerDimensionSides(int side, TPZStack< int > &smallsides) const =0
TPZVec< int > fSideRefPattern
Refinement for elements associated with a certain side of the current element. Usually, this is used for boundary/interface elements.
void ExportPattern(std::ostream &out) const
void ReadAndCreateRefinementPattern(std::istream &file)
int MaterialId() const
Returns the material index of the element.
static const int fNonInitializedId
Id for identifying a non initialized pattern.
virtual TPZGeoEl * CreateGeoElement(MElementType type, TPZVec< int64_t > &cornerindexes, int matid, int64_t &index, int reftype=1)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
bool IsFatherNeighbour(TPZGeoElSide fatherSide, TPZGeoEl *son) const
Verifies the neighbouring relationship between a son and a father's side.
virtual void resize(const int64_t newsize)
TPZTransform fTransform
Transformation to the nodes.
int ClassId() const override
Define the class id associated with the class.
clarg::argInt nsub("-nsub", "number of substructs", 4)
TPZTransform ComputeParamTransform(TPZGeoEl *geoElFrom, TPZGeoEl *geoElTo, int sideFrom, int sideTo)
void InsertRefPattern(TPZAutoPointer< TPZRefPattern > &refpat)
Insert the refinement pattern in the list of availabe refinement patterns assigns an Id to refPattern...
TPZGeoEl * Element(int iel)
It returns the element number iel from the stack of elements of the geometric mesh.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
int64_t NElements() const
Number of elements of the mesh.
void InsertPermuted()
Generate all permuted partitions and insert them in the mesh.
int operator==(const TPZAutoPointer< TPZRefPattern > compare) const
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
TPZAutoPointer< TPZRefPattern > FindRefPattern(TPZTransform<> &trans)
clarg::argString input("-if", "input file", "cube1.txt")
int64_t NElements() const
Access method to query the number of elements of the vector.
TPZGeoElSide Neighbour() const
AutoPointerMutexArrayInit tmp
TPZGeoMesh * Mesh() const
Returns the mesh to which the element belongs.
virtual int NSides() const =0
Returns the number of connectivities of the element.
TPZTransform Transform(int subElSide, int sub)
It returns the TPZTransform associated with a certain sub-element's side to the father's coordinates...
void SetRefPatternMeshToMasterDomain()
Sets the RefPatternMesh in (x,y,z)_coordinates to (qsi,eta,zeta)_coordinates, always respecting the R...
virtual int64_t NodeIndex(int i) const =0
Returns the index of the ith node the index is the location of the node in the nodevector of the mesh...
void InternalNodesIndexes(int side, TPZVec< TPZGeoElSideIndex > &nodeIndexes)
TPZGeoMesh fRefPatternMesh
Geometric mesh which defines the topology of the current refinement pattern.
virtual int SideDimension(int side) const =0
Return the dimension of side.
void CreateMidSideNodes(TPZGeoEl *gel, int side, TPZVec< int64_t > &newnodeindexes)
This method is used to create / identify the midside nodes for element elindex in its division proces...
void SetDimension(int dim)
Set Dimension.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object.
Data structure for storage of refinement information for a father's side.
virtual void GetPermutation(const int &i, TPZVec< int > &permutation) const =0
TPZAutoPointer< TPZRefPattern > FindRefPattern(TPZAutoPointer< TPZRefPattern > &refpat)
Check whether the refinement pattern already exists.
int WhichSide(TPZVec< int64_t > &SideNodeIds)
Returns the side number which is connected to the SideNodes returns -1 if no side is found...
void Read(TPZStream &buf, void *context) override
read objects from the stream
int SidePartition(TPZVec< TPZGeoElSide > &gelvec, int side)
It returns a stack from sub-elements and its sides. This stack partitions side of the element father...
TPZRefPatternDataBase gRefDBase
External variable to data base of patterns.
TPZAutoPointer< TPZRefPattern > SideRefPattern(int side)
Abstract class defining integration rules. Numerical Integration.
void CreateNewNodes(TPZGeoEl *gel, TPZVec< int64_t > &newnodeindexes)
This method is used to create / identify the nodes of the refined elements.
virtual void CenterPoint(int side, TPZVec< REAL > &masscent) const =0
It returns the coordinates from the center of the side of the element in the element coordinate space...
virtual std::string TypeName() const
Returns the type of the element as a string.
Utility class which represents an element index with its side. Geometry.
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...
int64_t size() const
Returns the number of elements of the vector.
void PrintVTK(std::ofstream &file, bool matColor=false) const
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 Resize(const int newsize)
Increase the size of the chunk vector.
bool CheckSideAndSubElConsistency(const int fatherSide, const int subEl) const
void Push(const T object)
Pushes a copy of the object on the stack.
virtual void SetNodeIndex(int i, int64_t nodeindex)=0
Initializes the node i of the element.
void Read(TPZStream &buf, void *context) override
read objects from the stream
void InternalSidesIndexes(int side, TPZVec< TPZGeoElSideIndex > &sideIndexes)
Fill a vector with TPZGeoElSideIndex_s with respect to internal subelements of a given side...
virtual void Write(const bool val)
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
int Id() const
Return the id of the refinement pattern.
int FatherSide(int side, int sub) const
Returns the father side associated with a given side of a certain sub element.
TPZGeoEl * Element(int64_t iel)
virtual void SetFatherIndex(int64_t fatherindex)
Sets the father element index This method is not called SetFather in order to avoid implicit conversi...
int64_t Index() const
Returns the index of the element within the element vector of the mesh.
int FindSubEl(TPZGeoEl *) const
#define DebugStop()
Returns a message to user put a breakpoint in.
void BuildSideMesh(int side, TPZGeoMesh &SideRefPatternMesh)
Build a geometric mesh associated with the side of the refinement pattern.
int64_t NNodes() const
Number of nodes of the mesh.
virtual void SetOrder(TPZVec< int > &ord, int type=0)=0
Sets the order of the cubature rule.
int fNSubEl
Number of subelements. Must be available before the mesh is generated.
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
int MElementType_NNodes(MElementType elType)
constant which defines the type of HDiv approximation space
virtual MElementType Type() const =0
Returns the element type acording to pzeltype.h.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Auxiliar structure to permute nodes.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
void SideNodes(int fatherSide, TPZVec< int > &vecNodes)
It returns a TPZVec containing the nodes contained in a given father's side.
virtual void PrintTopologicalInfo(std::ostream &out=std::cout) const
void Read(TPZStream &buf, void *context)
void SideSubGeoElSide(int fatherSide, int subElPos, TPZGeoElSide &subGeoEl) const
Gives information about the ith subelement contained in a given father's side.
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
static std::map< MElementType, std::list< TPZRefPatternPermute > > fPermutations
Map of all valid permutations.
static void PrintGMeshVTK(TPZGeoMesh *gmesh, std::ofstream &file, bool matColor=true)
Default constructor for graphical mesh with VTK format.
Contains the TPZRefPattern class which defines the topology of the current refinement pattern to a me...
int NSideNodes(int fatherSide) const
Returns the number of internal nodes of side.
virtual int NSideNodes(int side) const =0
Returns the number of nodes for a particular side.
int32_t Hash(std::string str)
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
virtual int NNodes() const =0
Returns the number of nodes of the element.
TPZGeoEl * Element() const
TPZVec< SPZFatherSideInfo > fFatherSideInfo
Data structure for storage of refinement information for each father's side fFatherSideInfo[i] will ...
int NSideSubGeoElSides(int fatherSide) const
Returns the number of TPZGeoElSides associated with a father's side.
void BuildConnectivity()
Build the connectivity of the grid.
int fId
id of the refinement pattern
Contains the TPZRefPatternDataBase class which defines data base of patterns.
virtual int Dimension() const =0
Returns the dimension of the element.
virtual TPZTransform< REAL > SideToSideTransform(int sidefrom, int sideto)=0
Compute the transformation between the master element space of one side of an element to the master e...
Defines the topology of the current refinement pattern to a mesh. Refine.
int64_t Id() const
Returns the Id of the element.
TPZVec< int > fSideNodes
a vector of nodes contained in the i-th side
bool ComputeXInverse(TPZVec< REAL > &XD, TPZVec< REAL > &ksi, REAL Tol)
Computes the XInverse and returns true if ksi belongs to master element domain.
virtual void X(TPZVec< REAL > &qsi, TPZVec< REAL > &result) const =0
Return the coordinate in real space of the point coordinate in the master element space...
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
virtual int ProjectInParametricDomain(TPZVec< REAL > &qsi, TPZVec< REAL > &qsiInDomain)=0
Ortogonal projection from given qsi to a qsiInDomain (all in the element parametric domain) ...
This class implements a stack object. Utility.
void Print(std::ostream &out=std::cout) const
Prints the useful information of a Refinement Pattern in a ostream file.
void PrintMore(std::ostream &out=std::cout) const
void ResetConnectivities()
Reset all connectivities.
void SetFather(TPZGeoEl *father)
Sets the father element.
static const std::string fNonInitializedName
Name for identifying a non initialized pattern.
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.
void ComputeTransforms()
Calculates the transforms between the parametric coordinates of the sides of the son to the father's ...
void Write(TPZStream &buf, int withclassid) const
TPZVec< int > fPermutedRefPatterns
Vector containing refinement patterns for each permutation of the master element. ...
void GeneratePermutations(TPZGeoEl *gel)
Automatically generate all permuted numberings for the father element of RefPatternMesh.
Defines the interface for saving and reading data. Persistency.
int64_t NElements() const
Returns the number of elements of the vector.
void WritePattern(std::ofstream &out) const
virtual int NPermutations() const =0
virtual void Print(std::ostream &out=std::cout)
Print all relevant data of the element to cout.
void GenerateSideRefPatterns()
Generate the refinement patterns associated with the sides of the father element. ...
REAL ZeroTolerance()
Returns the tolerance to Zero value. Actually: .
Contains the TPZVTKGeoMesh class which implements the graphical mesh to VTK environment to geometric ...
void push_back(const T object)
void Read(TPZStream &buf, void *context) override
read objects from the stream
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void ShortPrint(std::ostream &out=std::cout) const
This class generates all permutations of n values. Utility.
virtual int SolveDirect(TPZFMatrix< TVar > &F, const DecomposeType dt, std::list< int64_t > &singular)
Solves the linear system using Direct methods.
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.
void ComputePartition()
It computers the partition of the sides of the father element using the sides of the children...
void CreateRefinementPattern()
virtual void Read(bool &val)
TPZPermutation fPermute
permutation of the nodes
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
int ClassId() const override
Define the class id associated with the class.
int NNodes() const
Returns the number of nodes of the mesh.