41 static LoggerPtr logger(Logger::getLogger(
"pz.mesh.tpzgeomesh"));
48 fName(), fElementVec(0), fNodeVec(0)
69 for(i = 0; i < n; i++)
75 for(i = 0; i < n; i++)
100 std::cout <<
"Deleting TPZGeoMesh " << (
void *)
this << std::endl;
108 for (i = 0; i < nel; i++) {
132 out <<
"\n\t\t GEOMETRIC TPZGeoMesh INFORMATIONS:\n\n";
133 out <<
"TITLE-> " <<
fName <<
"\n\n";
138 out <<
"\n\tGeometric Node Information:\n\n";
141 for(i=0; i<nnodes; i++)
143 out <<
"Index: " << i <<
" ";
146 out <<
"\n\tGeometric Element Information:\n\n";
148 for(i=0; i<nelem; i++)
154 out <<
"\nInterface materials : \n\n";
159 out <<
"number = " << n <<
"\n";
160 out <<
"left material / right material -> interface material\n";
166 out << l <<
" / " << r <<
" -> " << m <<
"\n";
171 out <<
"TITLE-> " <<
fName <<
"\n";
175 out <<
"\n\tGeometric Node Information:\n";
178 for(i=0; i<nnodes; i++)
182 out <<
"\n\tGeometric Element Information:\n";
184 for(i=0; i<nelem; i++)
194 for(i = 0; i < nnodes; i++) nodep[i] = &
fNodeVec[nos[i]];
201 for(i=0;i<nelements;i++)
224 PZError <<
"RestoreReference incomplete. Exist computational element with geometrical\n";
225 PZError <<
"element not belongs to the current geometrical mesh.\n";
243 map<int64_t,TPZGeoEl *> elmap;
245 for(i=0;i<nelements;i++)
251 int64_t currentnode = NodFrom;
253 int candidateside = 0;
254 while(currentnode != NodTo)
260 if (logger->isDebugEnabled())
262 std::stringstream sout;
263 std::map<int64_t, TPZGeoEl *>::iterator it;
264 sout <<
"Elements around node " << currentnode <<
" : ";
265 for(it=elmap.begin(); it!=elmap.end(); it++)
267 sout << it->second->Index() <<
"|";
269 for(in=0; in<it->second->NNodes(); in++)
271 sout << it->second->NodeIndex(in) <<
":";
281 FindElement(elmap, currentnode, candidate, candidateside);
286 LOGPZ_WARN(logger,
"GetBoundaryElements no adjacent element found");
291 while(index<nelvec && ElementVec[index] != candidate) index++;
292 if(index <nelvec && Sides[index]==candidateside)
break;
293 ElementVec.
Push(candidate);
294 Sides.
Push(candidateside);
295 elmap.erase(elmap.begin(), elmap.end());
296 elmap[candidate->
Id()] = candidate;
308 map<int64_t, TPZGeoEl *>::iterator ielprev,iel=elmap.begin();
311 while(iel!=elmap.end())
316 int numnode = el->
NNodes();
317 for(i=0; i< numnode; i++)
319 if(el->
NodeIndex(i) == currentnode)
break;
323 elmap.erase(ielprev);
327 while(iel!=elmap.end())
332 for(
int is=0; is<nside; is++)
335 if(!neigh.
Exists())
continue;
337 for(i=0; i< numnode; i++)
341 if(elmap.find(neigh.
Element()->
Id())==elmap.end())
362 map<int64_t , TPZGeoEl *>::iterator ielprev, iel = elmap.begin();
363 while(iel!=elmap.end()) {
369 for(; is < ns; is++) {
376 std::stringstream sout;
377 sout << __PRETTY_FUNCTION__ <<
" for elidx " << el->
Index() << std::endl;
378 sout <<
"\tthiside " << el->
Index() <<
"/" << is << std::endl;
388 sout <<
"\t\t\tNew Candidate found el/side = " << el <<
"/" << is << std::endl;
398 sout <<
"candidate doesn't match...";
407 std::stringstream sout;
408 sout <<
"No neighbour found for node " << currentnode <<
" elmap \n";
409 for(iel=elmap.begin(); iel!=elmap.end(); iel++)
411 iel->second->Print(sout);
422 while(i<nnodes &&
fNodeVec[i].Id() == -1) i++;
423 if(i == nnodes)
return 0;
427 distkeep += (co[in]-(gnkeep->
Coord(in)))*(co[in]-(gnkeep->
Coord(in)));
431 for(in=0;in<3;in++) dist += (co[in]-gn->
Coord(in))*(co[in]-gn->
Coord(in));
438 while(i<nnodes &&
fNodeVec[i].Id() == -1) i++;
446 while(i<nnodes &&
fNodeVec[i].Id() == -1) i++;
447 if(i == nnodes)
return 0;
453 distkeep += (co[in]-(gnkeep->
Coord(in)))*(co[in]-(gnkeep->
Coord(in)));
457 for(in=0;in<3;in++) dist += (co[in]-gn->
Coord(in))*(co[in]-gn->
Coord(in));
465 while(i<nnodes &&
fNodeVec[i].Id() == -1) i++;
489 std::map<REAL,int> cornerdist;
490 while (gel != gelnext) {
499 for (
int i=0; i<3; i++) {
500 dist += (x[i]-xcorner[i])*(x[i]-xcorner[i]);
511 geldist =
dist(x,xcenter);
514 if (logger->isDebugEnabled()) {
515 std::stringstream sout;
516 sout <<
"FindClosestElement Tried element index " << gel->
Index() << std::endl;
517 sout <<
"Distance from the center " << geldist << std::endl;
522 REAL closestcorner = cornerdist.begin()->first;
524 if (geldist < closestcorner || closestcorner < 1.e-15) {
526 if (logger->isDebugEnabled()) {
527 std::stringstream sout;
528 sout <<
"Distance from the closest corner " << closestcorner <<
"bailing out " << std::endl;
532 InitialElIndex = gel->
Index();
538 std::map<REAL,int> distneigh;
539 while (neighbour != gelside)
541 if (neighbour.Element()->Dimension() == targetDim)
544 TPZGeoElSide centerneigh(neighbour.Element(),neighbour.Element()->NSides()-1);
546 REAL distcenter =
dist(center,x);
547 distneigh[distcenter] = neighbour.Element()->Index();
549 neighbour = neighbour.Neighbour();
552 REAL gelnextdist = 0.;
553 if (distneigh.size() == 0) {
555 gelnextdist = geldist;
558 gelnext =
ElementVec()[distneigh.begin()->second];
559 gelnextdist = distneigh.
begin()->first;
562 if (logger->isDebugEnabled()) {
563 std::stringstream sout;
564 sout <<
"Closest element index " << gelnext->
Index() << std::endl;
565 sout <<
"Distance from the center " << gelnextdist << std::endl;
570 if (geldist <= gelnextdist) {
571 InitialElIndex = gel->
Index();
575 InitialElIndex = gel->
Index();
584 for (
int i=0; i<3; i++) {
585 dist += (xaprox[i]-x[i])*(xaprox[i]-x[i]);
592 std::stringstream sout;
593 sout <<
"Element not found for coordinate x " << x << std::endl;
594 sout <<
"Coordinate found " << xaprox << std::endl;
595 sout <<
"Distance error " << dist << std::endl;
596 sout <<
"Closest element index " << res->
Index() <<
" El param " << qsi << std::endl;
608 qsi.
Resize(targetDim, 0.);
615 bool foundDim =
false;
616 for(
int s = 0; s < gel->
NSides(); s++)
620 while(neighSide != gelSide)
622 if(neighSide.Element()->Dimension() == targetDim)
624 gel = neighSide.Element();
648 bool mustStop =
false;
649 bool projectOrthogonal =
true;
650 int bissectionCalled = 0;
655 if(projectOrthogonal)
662 projectOrthogonal =
true;
666 bool targetNeighFound =
false;
667 while(mySide != neighSide && targetNeighFound ==
false)
674 else if(neighSide.Element()->Dimension() != targetDim)
684 targetNeighFound =
true;
695 bissectionCalled = 0;
699 projectOrthogonal =
false;
701 if(bissectionCalled == 2)
708 if(logger->isDebugEnabled())
710 std::stringstream sout;
712 neighSide.CenterPoint(par);
713 neighSide.X(par, xloc);
715 for (
int i=0; i<3; i++) {
716 dist += (x[i]-xloc[i])*(x[i]-xloc[i]);
719 sout <<
"within element " << gel->
Index() <<
" parameter is " << qsi <<
" projected parameter " << projection;
720 sout <<
"\nBest guess is on side " << side <<
" which gives neighSide " << neighSide << std::endl;
721 sout <<
"Distance of the center point is " <<
dist;
752 if (logger->isDebugEnabled()) {
753 std::stringstream sout;
754 sout <<
"x coordinate " << x << std::endl;
755 sout <<
"element index " << gel->
Index() << std::endl;
756 sout <<
"coordinates of the corner nodes of the element\n";
757 for (
int i=0; i<gel->
NNodes(); i++) {
759 for (
int ic=0; ic<3; ic++) {
760 sout << ptr->
Coord(ic) <<
" ";
767 qsi.
Resize(targetDim, 0.);
782 std::set<TPZGeoEl *> tested;
788 if (logger->isDebugEnabled())
790 LOGPZ_DEBUG(logger,
"Going into the FindSubElement alternative")
798 if (logger->isDebugEnabled())
800 std::stringstream sout;
801 sout <<
"Looking for x = " << x << std::endl;
802 sout <<
"Tried out gel index " << gel->
Index() << std::endl;
803 sout <<
"found qsi " << qsi << std::endl;
806 sout <<
"found x co " << locx << std::endl;
818 gel->
X(projection, xclose);
820 for (
int i=0; i<3; i++) {
821 mindist += (xclose[i]-x[i])*(xclose[i]-x[i]);
829 while (neighSide != mySide) {
830 if (neighSide.Element()->Dimension() == targetDim && tested.find(neighSide.Element()) == tested.end()) {
831 allneigh.
Push(neighSide);
833 neighSide = neighSide.Neighbour();
836 while (allneigh.
size())
840 if (tested.find(locgel) != tested.end()) {
847 if (logger->isDebugEnabled())
LOGPZ_DEBUG(logger,
"FOUND ! Going into the FindSubElement alternative")
854 if (logger->isDebugEnabled())
856 std::stringstream sout;
857 sout <<
"Looking for x = " << x << std::endl;
858 sout <<
"Tried out gel index " << locgel->
Index() << std::endl;
859 sout <<
"found qsi " << qsi << std::endl;
862 sout <<
"found x co " << locx << std::endl;
868 tested.insert(locgel);
873 locgelside.
X(projection, xclose);
875 for (
int i=0; i<3; i++) {
876 dist += (xclose[i]-x[i])*(xclose[i]-x[i]);
878 if (dist < mindist) {
880 bestside = locgelside;
881 bestproj = projection;
885 while (neighSide != mySide) {
886 if (neighSide.Element()->Dimension() == targetDim && tested.find(neighSide.Element()) == tested.end()) {
887 allneigh.
Push(neighSide);
889 neighSide = neighSide.Neighbour();
909 std::cout <<
"FindSubElement called for non conforming point\n";
916 InitialElIndex = gel->
Index();
927 for(
int s = 0; s < nsons; s++)
929 son = subElements[s];
934 InitialElIndex = son->
Index();
941 std::map<REAL,int>
dist;
942 for(
int s = 0; s < nsons; s++)
944 son = subElements[s];
947 REAL distToProj = 0.;
948 for(
int c = 0; c < son->
Dimension(); c++)
950 distToProj += (qsiSonProj[c] - qsiSonVec[s][c]) * (qsiSonProj[c] - qsiSonVec[s][c]);
952 dist[
sqrt(distToProj)] = s;
954 int sonPosition = dist.begin()->second;
956 qsi = qsiSonVec[sonPosition];
957 son = subElements[sonPosition];
958 InitialElIndex = son->
Index();
974 for(iel=0; iel<nelem; iel++)
980 for(in=0; in<ncor; in++) {
982 if(SideNum[nod] == -1)
984 NeighNode[nod] = gel;
999 for(iel=0; iel<nelem; iel++)
1004 int nsides = gel->
NSides();
1006 for(is=ncor; is<nsides; is++)
1014 int64_t nneigh = neighbours.
NElements();
1016 for(in=0; in<nneigh; in++) {
1017 if(neighbours[in].Side() == -1)
1019 std::cout <<
"TPZGeoMesh::BuildConnectivity : Inconsistent mesh detected analysing element/side:" ;
1020 std::cout << gelside ;
1021 std::cout << std::endl;
1024 if(neighbours[in].
Element()->SideIsUndefined(neighbours[in].Side()))
1026 neighbours[in].Element()->SetSideDefined(neighbours[in].Side());
1037 for(int64_t el = 0; el < nel; el++)
1047 for(int64_t el = 0; el < Qelem; el++)
1064 int64_t numsearch =1;
1066 while(iel < nelem) {
1068 int numsides = el->
NSides();
1070 for(side = 0;side<numsides;side++)
1077 TPZGeoEl *neigh = NeighNode[sidenode];
1078 int sidenumber = SideNum[sidenode];
1079 for(int64_t sn = 0;sn < numsidenodes; sn++)
1082 if (neigh != NeighNode[sidenode])
1089 if(equalnode && neigh == 0)
1094 for(
int in=0; in<el->
NNodes(); in++)
1096 if(NeighNode[el->
NodeIndex(in)] == el) elloaded = 1;
1101 for(
int sn=0;!elloaded && sn < numsidenodes; sn++) \
1104 NeighNode[sidenode] = el;
1105 SideNum[sidenode] = side;
1109 }
else if(equalnode && side == sidenumber && neigh == el)
1112 for(
int sn=0;sn < numsidenodes; sn++)
1115 NeighNode[sidenode] = 0;
1116 SideNum[sidenode] = -1;
1124 else if(equalnode && neigh != el)
1129 for(
int sn=0;sn < numsidenodes; sn++)
1132 SideNodes[sn] = sidenode;
1134 int neighside = neigh->
WhichSide(SideNodes);
1147 if(iel==nelem && numsearch)
1161 for(int64_t i=0;i<nel;i++)
1164 if(gel && gel->
Id()==elid)
break;
1172 int64_t index = gel->
Index();
1173 if (
ElementVec()[index] == gel)
return index;
1181 if(i<numel)
return i;
1191 if (&
NodeVec()[i] == nod)
break;
1242 (nodeindexes, matid, *
this, index);
1249 (nodeindexes, matid, *
this, index);
1256 (nodeindexes, matid, *
this, index);
1263 (nodeindexes, matid, *
this, index);
1270 (nodeindexes, matid, *
this, index);
1277 (nodeindexes, matid, *
this, index);
1284 (nodeindexes, matid, *
this, index);
1289 PZError <<
"TPZGeoMesh::CreateGeoElement type element not exists:" 1290 <<
" type = " << type << std::endl;
1304 for (
int i=0; i<nodeindexes.
size(); i++) {
1305 if (nodeindexes[i] < 0) {
1332 PZError <<
"TPZGeoMesh::CreateGeoElement type element not exists:" 1333 <<
" type = " << type << std::endl;
1391 PZError <<
"TPZGeoMesh::CreateGeoElement type element not exists:" 1392 <<
" type = " << type << std::endl;
1445 PZError <<
"TPZGeoMesh::CreateGeoElementRefPattern type element not exists:" 1446 <<
" type = " << type << std::endl;
1453 return Hash(
"TPZGeoMesh");
1465 PZError <<
"TPZGeoMesh::DeleteElement index error\n";
1495 int64_t ninterfacemaps;
1496 buf.
Read(&ninterfacemaps);
1498 for (c = 0; c < ninterfacemaps; c++) {
1507 if (logger->isDebugEnabled()) {
1524 buf.
Write(&ninterfacemaps);
1527 vals[0] = elem.first.first;
1528 vals[1] = elem.first.second;
1529 vals[2] = elem.second;
1536 std::pair<int, int> leftright(leftmaterial, rightmaterial);
1537 InterfaceMaterialsMap::iterator w, e;
1550 std::pair<int, int> leftright(leftmaterial, rightmaterial);
1551 InterfaceMaterialsMap::iterator w, e;
1556 if (w != e)
return w->second;
1559 if (leftmaterial == rightmaterial)
return leftmaterial;
1562 std::stringstream mess;
1563 mess <<
"\nTPZGeoMesh::InterfaceMaterial - Interface material not found left " << leftmaterial <<
" right " << rightmaterial ;
1564 PZError << mess.str() << std::endl;
1570 InterfaceMaterialsMap::iterator b, e;
1580 const int64_t nelem = this->
NElements();
1581 for(iel = 0; iel < nelem; iel++)
1585 const int nsides = gel->
NSides();
1587 for(is = 0; is < nsides; is++)
1598 std::set<int> matids;
1599 matids.insert(matid);
1600 return Area(matids);
1608 std::set<int> matids;
1609 for (int64_t el=0; el<nel; el++) {
1611 if (!gel || gel->
Dimension() != meshdim) {
1616 return Area(matids);
1626 for (int64_t el=0; el<nel; el++) {
1628 if (!gel || !NeedsComputing[el]) {
1632 NeedsComputing[el] = 0;
1637 while (neighbour != gelside) {
1639 NeedsComputing[neighindex] = 0;
1640 neighbour = neighbour.Neighbour();
virtual int64_t SideNodeIndex(int side, int nodenum) const =0
Returns the index of the nodenum node of side.
void GetNodePtr(TPZVec< int64_t > &nos, TPZVec< TPZGeoNode *> &nodep)
Fills the nodep vector with pointers to the nodes identified by their indexes.
Contains TPZShapeTetra class which implements the shape functions of a tetrahedral element...
int fDim
dimension of the geometric domain
virtual TPZGeoElSide Father2(int side) const
Returns the father/side of the father which contains the side of the sub element. ...
const int64_t numel
Number of elements to test.
TPZGeoNode * NodePtr(int i) const
Returns a pointer to the ith node of the element.
TPZGeoEl * FindSubElement(TPZGeoEl *gel, TPZVec< REAL > &x, TPZVec< REAL > &qsi, int64_t &InitialElIndex) const
Returns the subelement that contains the given point x and it respective point in parametric domain q...
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 BuildElementsAroundNode(int64_t currentnode, std::map< int64_t, TPZGeoEl *> &elmap)
Find all elements in elmap or neighbour of elements in elmap which contain a node.
int MaterialId() const
Returns the material index of the element.
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...
TPZAdmChunkVector< TPZGeoEl * > fElementVec
List of pointers to finite elements.
virtual void SetNeighbour(int side, const TPZGeoElSide &neighbour)=0
Fill in the data structure for the neighbouring information.
Contains declaration of TPZGeoNode class which defines a geometrical node.
REAL Coord(int i) const
Returns i-th coordinate of the current node.
void CleanUp()
Deletes all items in the TPZGeoMesh.
Contains declaration of TPZCompEl class which defines the interface of a computational element...
Templated vector implementation.
void WritePointers(const TPZVec< TPZAutoPointer< T >> &vec)
Implements a generic geometric element with a uniform refinement pattern. Geometry.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
groups all classes dedicated to the computation of shape functions
virtual int NCornerNodes() const =0
Returns the number of corner nodes of the element.
Contains the TPZRefQuad class which implements the uniform refinement of a geometric quadrilateral el...
int64_t NElements() const
Number of elements of the mesh.
int64_t fNodeMaxId
Maximum id used by all nodes of this mesh.
Declarates the TPZBlock<REAL>class which implements block matrices.
int64_t fElementMaxId
Maximum id used by all elements of this mesh.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
InterfaceMaterialsMap fInterfaceMaterials
Datastructure which indicates the index of the interface material which needs to be created between t...
int64_t NElements() const
Access method to query the number of elements of the vector.
#define LOGPZ_WARN(A, B)
Define log for warnings.
TPZGeoElSide Neighbour() const
int ClassId() const override
Define the class id associated with the class.
virtual int NSides() const =0
Returns the number of connectivities of the element.
static TPZSavable * GetInstance(const int64_t &objId)
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 ReadPointers(TPZVec< TPZAutoPointer< T >> &vec)
This class implements a geometric element which uses its ancestral to compute its jacobian...
virtual TPZGeoEl * CreateGeoBlendElement(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index)
Creates a geometric element in same fashion of CreateGeoElement but here the elements are blend...
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
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Contains the TPZRefPyramid class which implements the uniform refinement of a geometric hexahedral el...
int64_t NodeIndex(TPZGeoNode *nod)
Returns the index of the given node into the fNodeVec.
TPZGeoNode * FindNode(TPZVec< REAL > &co)
Returns the nearest node to the coordinate. This method is VERY INEFFICIENT.
void RestoreReference(TPZCompMesh *cmesh)
Restore all reference in elements from computational mesh criated from current geometrical mesh previ...
Contains declaration of TPZGeoElMapped class which implements a geometric element using its ancestral...
Contains TPZShapeCube class which implements the shape functions of a hexaedral element.
virtual TPZGeoEl * SubElement(int is) const =0
Returns a pointer to the subelement is.
TPZGeoEl * LowestFather()
Returns a pointer to the higher level father.
void ClearInterfaceMaterialsMap()
Delete all interface materials in map.
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...
Contains the TPZRefPrism class which implements the uniform refinement of a geometric prism element...
virtual void GetAllSiblings(TPZStack< TPZGeoEl *> &unrefinedSons)
[deprecated] use YoungestChildren
void Resize(const int newsize)
Increase the size of the chunk vector.
Contains declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
void Push(const T object)
Pushes a copy of the object on the stack.
std::string fName
TPZGeoMesh name for model identification.
void BuildConnectivityOld()
Alternative method for computing the connectivity.
virtual void Write(const bool val)
virtual void Print(std::ostream &out=std::cout) const
Print the information of the grid to an ostream.
Implements a generic geometric element which is refined according to a generic refinement pattern...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Contains the TPZGeoBlend class which implements a blending map from curved boundaries to the interior...
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.
Contains the TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
#define DebugStop()
Returns a message to user put a breakpoint in.
int64_t NNodes() const
Number of nodes of the mesh.
void CenterX(TPZVec< REAL > &Xcenter) const
return the coordinates of the center of the side in real space
#define LOGPZ_DEBUG(A, B)
Define log for debug info.
void X(TPZVec< REAL > &loc, TPZVec< REAL > &result) const
X coordinate of a point loc of the side.
int64_t NFreeElements() const
Access method to return the number of free elements.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
void BuildBlendConnectivity()
Set connectivity information elements with blend geometric map.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
TPZCompMesh * fReference
Computational mesh associated.
TPZGeoEl * FindElement(TPZVec< REAL > &x, TPZVec< REAL > &qsi, int64_t &InitialElIndex, int targetDim) const
Returns the element that contains the given point x and it respective point in parametric domain qsi...
Contains declaration of TPZGeoElRefPattern class which implements a generic geometric element which i...
virtual void PrintTopologicalInfo(std::ostream &out=std::cout) const
void SetConnectivity(const TPZGeoElSide &neighbour) const
Groups all classes which model the h refinement These classes are used as template arguments of...
REAL co[8][3]
Coordinates of the eight nodes.
TPZGeoMesh()
Constructors and destructor.
Contains TPZShapePoint class which implements the shape function associated with a point...
virtual TPZGeoElSide Neighbour(int side)=0
Returns a pointer to the neighbour and the neighbourside along side of the current element...
#define LOGPZ_ERROR(A, B)
Define log for errors (cout)
Contains declaration of TPZCompMesh class which is a repository for computational elements...
Contains the TPZRefPattern class which defines the topology of the current refinement pattern to a me...
TPZGeoMesh & operator=(const TPZGeoMesh &cp)
Operator of copy.
void CompactDataStructure(CompactScheme type=CompactScheme::ALWAYS)
Sets the method to compact the data structure based on the.
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
virtual int NSideNodes(int side) const =0
Returns the number of nodes for a particular side.
int32_t Hash(std::string str)
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
Contains TPZMatrix<TVar>class, root matrix class.
virtual int HasSubElement() const =0
Return 1 if the element has subelements.
void ComputeNeighbours(TPZStack< TPZGeoElSide > &compneigh)
Returns the set of neighbours as computed by the intersection of neighbours along vertices...
virtual int NNodes() const =0
Returns the number of nodes of the element.
Contains TPZShapePrism class which implements the shape functions of a prism element.
TPZGeoEl * Element() const
int NeighbourExists(int side, const TPZGeoElSide &gel)
Returns 1 if gel is a neighbour of the element along side.
Contains the TPZRefTriangle class which implements the uniform refinement of a geometric triangular e...
void GetBoundaryElements(int64_t IndexNodeFrom, int64_t IndexNodeTo, TPZStack< TPZGeoEl *> &ElementVec, TPZStack< int > &Sides)
GetBoundaryElements returns all elements beweeen NodFrom and NodTo counterclock wise this method uses...
void BuildConnectivity()
Build the connectivity of the grid.
virtual int SideIsUndefined(int side)=0
Returns 1 if the side has not been defined by buildconnectivity.
virtual void SetSideDefined(int side)=0
Flags the side as defined, this means no neighbouring element was found.
Contains the TPZRefTetrahedra class which implements the uniform refinement of a geometric tetrahedra...
void DeleteElement(TPZGeoEl *gel, int64_t index=-1)
Centralized method to delete elements.
T Pop()
Retrieve an object from the stack.
Contains the TPZRefPatternDataBase class which defines data base of patterns.
virtual int Dimension() const =0
Returns the dimension of the element.
REAL dist(TPZVec< T1 > &vec1, TPZVec< T1 > &vec2)
int AddInterfaceMaterial(int leftmaterial, int rightmaterial, int interfacematerial)
Add an interface material associated to left and right element materials.
int64_t Id() const
Returns the Id of the element.
int Dimension()
Get Dimension.
bool ComputeXInverse(TPZVec< REAL > &XD, TPZVec< REAL > &ksi, REAL Tol)
Computes the XInverse and returns true if ksi belongs to master element domain.
TPZGeoEl * Reference() const
Return a pointer to the corresponding geometric element if such exists, return 0 otherwise.
Implements a geometric node in the pz environment. Geometry.
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...
virtual REAL SideArea(int side)
Returns the area from the face.
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.
int Dimension() const
the dimension associated with the element/side
void ResetReference()
Reset the element referenced by the geometric element to NULL.
Implements computational mesh. Computational Mesh.
TPZAdmChunkVector< TPZCompEl * > & ElementVec()
Returns a reference to the element pointers vector.
void RemoveConnectivities()
It removes the connectivities of the element.
void SetReference(TPZCompEl *elp)
Make the current element reference to the computational element.
virtual TPZGeoEl * CreateGeoElementMapped(MElementType type, TPZVec< int64_t > &nodeindexes, int matid, int64_t &index)
Generic method for creating a geometric element. Putting this method centrally facilitates the modifi...
REAL Area()
Compute the area of the domain.
Contains the TPZRefLinear class which implements the uniform refinement of a geometric linear element...
void ResetConnectivities()
Reset all connectivities.
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.
virtual ~TPZGeoMesh()
Destructor.
Contains TPZShapePiram class which implements the shape functions of a pyramid element.
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
int InterfaceMaterial(int leftmaterial, int rightmaterial)
Returns the interface material associated to left and right element materials. If no interface materi...
bool VerifyNodeCoordinates(REAL tol=1e-1)
Verify coordinate of element nodes checking if they are coincident to the X mapping of the corner nod...
Defines the interface for saving and reading data. Persistency.
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.
#define GMESHNOMATERIAL
Identifier indicating the no material is associated.
TPZGeoEl * FindApproxElement(TPZVec< REAL > &x, TPZVec< REAL > &qsi, int64_t &InitialElIndex, int targetDim) const
find an element/parameter close to the point
Contains the TPZGeoPrism class which implements the geometry of a prism element.
TPZGeoEl * FindCloseElement(TPZVec< REAL > &x, int64_t &InitialElIndex, int targetDim) const
Returns the element that is close to the given point x.
Contains declaration of TPZGeoElement class which implements a generic geometric element with a unifo...
clarg::argString m("-m", "input matrix file name (text format)", "matrix.txt")
void GetCoordinates(TPZVec< REAL > &co)
Fill the coordinates of the node.
TPZAdmChunkVector< TPZGeoNode > fNodeVec
List of nodes.
void Read(TPZStream &buf, void *context) override
read objects from the stream
Groups all classes which model the geometry.
REAL ZeroTolerance()
Returns the tolerance to Zero value. Actually: .
void ResetReference()
Resets all load references in elements and nodes.
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
Defines the interface of a computational element. Computational Element.
virtual int NSubElements() const =0
Returns the number of subelements of the element independent of the fact whether the element has alr...
Contains TPZShapeQuad class which implements the shape functions of a quadrilateral element...
int64_t ElementIndex(TPZGeoEl *gel)
Returns the index of the given element into the fElementVec.
virtual void ResetSubElements()=0
Reset all subelements to NULL.
Contains the TPZRefCube class which implements the uniform refinement of a geometric hexahedral eleme...
Contains the TPZRefPoint class which implements the uniform refinement of a geometric point element...
virtual int ProjectBissectionInParametricDomain(TPZVec< REAL > &qsi, TPZVec< REAL > &qsiInDomain)=0
Projection from given qsi to a qsiInDomain (in the element boundary) using bissection method from giv...
TPZGeoEl * FindElementCaju(TPZVec< REAL > &x, TPZVec< REAL > &qsi, int64_t &InitialElIndex, int targetDim)
Returns the element that contains the given point x and it respective point in parametric domain qsi...
static void WritePointer(const TPZSavable *obj, TPZStream *stream)
Contains TPZShapeTriang class which implements the shape functions of a triangular element...
void SetName(const std::string &nm)
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.
virtual void Read(bool &val)
TPZAdmChunkVector< TPZGeoEl * > & ElementVec()
Methods for handling pzlists.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.