8 #ifndef pzgeom_utility_h 9 #define pzgeom_utility_h 37 template<
class Topology>
61 template<
class Topology>
63 const int nsides = Topology::NSides;
64 if(Topology::IsInParametricDomain(qsi,0.)){
70 REAL winnerDistance = 1e12;
72 for(
int is = 0; is < nsides-1; is++){
76 pt1.Resize(Topology::SideDimension(is));
80 bool IsInSideDomain = IsInSideParametricDomain<Topology>(is,pt1,0.);
81 if(!IsInSideDomain)
continue;
90 REAL
val = qsi[i]-pt2[i];
93 distance =
sqrt(distance);
96 if(distance < winnerDistance){
97 winnerDistance = distance;
109 template<
class Topology>
111 const int nsides = Topology::NSides;
112 const int dim = Topology::Dimension;
116 if(Topology::IsInParametricDomain(qsi,0.))
126 Topology::CenterPoint(nsides-1,InnPt);
129 for(
int c = 0; c < dim; c++)
131 dist += (InnPt[c] - OutPt[c])*(InnPt[c] - OutPt[c]);
137 for(
int c = 0; c < dim; c++)
139 qsiInDomain[c] = (InnPt[c] + OutPt[c])/2.;
141 if(Topology::IsInParametricDomain(qsiInDomain,0.))
150 for(
int c = 0; c < dim; c++)
152 dist += (InnPt[c] - OutPt[c])*(InnPt[c] - OutPt[c]);
160 for(
int is = 0; is < nsides-1; is++)
164 T1.
Apply(qsiInDomain,pt1);
172 for(
int c = 0; c < dim; c++)
174 dist += (qsiInDomain[c]-pt2[c]) * (qsiInDomain[c]-pt2[c]);
193 template<
class Topology>
197 std::stringstream sout;
200 for (
int i=0; i<qsi.size(); i++) {
201 qsi[i] = qsiSide[i].val();
203 if(!IsInSideParametricDomain<Topology>(side,qsi,tol)){
204 sout<<
"The method expects the coordinates in the side's parametric domain. Exiting..."<<std::endl;
205 PZError <<
"\n" << sout.str() <<
"\n";
227 std::stringstream sout;
228 sout<<
"Could not find associated shape function to the side. Details are as follows:"<<std::endl;
231 PZError<<std::endl<<sout.str()<<std::endl;
238 template<
class Topology>
242 std::stringstream sout;
244 if(!IsInSideParametricDomain<Topology>(side,qsiSide,tol)){
245 sout<<
"The method expects the coordinates in the side's parametric domain. Exiting..."<<std::endl;
267 std::stringstream sout;
268 sout<<
"Could not find associated shape function to the side. Details are as follows:"<<std::endl;
271 PZError<<std::endl<<sout.str()<<std::endl;
277 template<
class Topology>
303 std::stringstream sout;
304 sout <<
"Fatal error at " << __PRETTY_FUNCTION__ <<
" - Element type " << type <<
" not found";
305 PZError <<
"\n" << sout.str() <<
"\n";
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
Contains declaration of TPZGeoNode class which defines a geometrical node.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
int ProjectInParametricDomain(TPZVec< REAL > &qsi, TPZVec< REAL > &qsiInDomain)
Projects point pt (in parametric coordinate system) in the element parametric domain.
Contains the TPZPoint class which defines the topology of a point.
std::string MElementType_Name(MElementType elType)
Returns the name of the element type.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
REAL val(STATE &number)
Returns value of the variable.
Contains the TPZTriangle class which defines the topology of a triangle.
Contains the TPZTetrahedron class which defines the topology of the tetrahedron element.
int ProjectBissectionInParametricDomain(TPZVec< REAL > &qsi, TPZVec< REAL > &qsiInDomain)
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
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 TPZGeoTetrahedra class which implements the geometry of a tetrahedral element...
#define DebugStop()
Returns a message to user put a breakpoint in.
Contains the TPZQuadrilateral class which defines the topology of a quadrilateral element...
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
Full matrix class. Matrix.
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
Contains the TPZGeoCube class which implements the geometry of hexahedra element. ...
Contains the TPZPyramid class which defines the topology of a pyramid element.
Contains the TPZGeoPoint class which implements the geometry of a point element or 0-D element...
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
REAL dist(TPZVec< T1 > &vec1, TPZVec< T1 > &vec2)
This class implements a geometric mesh for the pz environment. Geometry.
MElementType
Define the element types.
void GetSideShapeFunction(int side, TPZVec< REAL > &qsiSide, TPZFMatrix< REAL > &phi, TPZFMatrix< REAL > &dphi)
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
static void TShape(const TPZVec< T > &loc, TPZFMatrix< T > &phi, TPZFMatrix< T > &dphi)
Compute the shape being used to construct the x mapping from local parametric coordinates.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=pztopology::gTolerance)
Verifies if the parametric point pt is in the element parametric domain.
Contains the TPZGeoPyramid class which implements the geometry of pyramid element.
int64_t NElements() const
Returns the number of elements of the vector.
static bool IsInParametricDomain(const TPZVec< REAL > &pt, REAL tol=1e-6)
Verifies if the parametric point pt is in the element parametric domain.
Contains the TPZGeoPrism class which implements the geometry of a prism element.
Contains the TPZCube class which defines the topology of the hexahedron element.
Contains the TPZLine class which defines the topology of a line element.
Contains the TPZPrism class which defines the topology of a Prism.
bool IsInSideParametricDomain(int side, const TPZVec< REAL > &pt, REAL tol)
Verifies if pt (in parametric domain of the side) is within boundaries.
#define PZError
Defines the output device to error messages and the DebugStop() function.