NeoPZ
pzhyperplane.h
Go to the documentation of this file.
1 
5 /*****************************************************************************
6  * O contedo desse arquivo �de propriedade do LabMeC-DES-FEC-UNICAMP e do
7  * CENPES-Petrobras.
8  * O uso de qualquer parte ou do todo est�condicionado �expressa autoriza�o
9  * dos propriet�ios.
10  *****************************************************************************/
11 
12 #ifndef PZREADMESHHR_H
13 #define PZREADMESHHR_H
14 
15 #include "pzmanvector.h"
16 #include <string>
17 
18 class TPZGeoMesh;
19 class TPZGeoEl;
20 class TPZCompMesh;
21 class TPZGeoElSide;
22 
34 {
35 
38 
41 
42 public:
43 
44  TPZHyperPlane(TPZVec<REAL> &center, TPZVec<REAL> &normal) : fCenter(center), fNormal(normal)
45  {
46 
47  }
48 
49  bool IsLeft(TPZVec<REAL> &point) const
50  {
51  REAL val=0.;
52  for (int i=0; i<3; i++) {
53  val += (point[i]-fCenter[i])*fNormal[i];
54  }
55  return val <= 0;
56  }
57 
58  REAL Distance(const TPZVec<REAL> &point, TPZVec<REAL> &jacobian) const
59  {
60  REAL distance = 0;
61  for (int i=0; i<3; i++) {
62  distance += (point[i]-fCenter[i])*fNormal[i];
63  jacobian[i] = fNormal[i];
64  }
65  return distance;
66  }
67 };
68 
70 {
71 public:
73  void Intersect(TPZGeoMesh &input, const TPZHyperPlane &plane, TPZGeoMesh &target);
74 
76  REAL EdgeIntersect(const TPZGeoElSide &gelside, const TPZHyperPlane &plane);
77 
78 private:
80  void Reorder(TPZGeoEl *gel, TPZGeoMesh &target, TPZVec<std::pair<int64_t,int64_t> > &sidenodepair);
82  int ReorderGeneral(TPZGeoMesh &target, TPZVec<std::pair<int64_t,int64_t> > &sidenodepair);
83 };
84 
85 #endif
TPZManVector< REAL, 3 > fNormal
normal to the hyperplane
Definition: pzhyperplane.h:40
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Definition: pzgeoelside.h:83
clarg::argString input("-if", "input file", "cube1.txt")
REAL val(STATE &number)
Returns value of the variable.
Definition: pzartdiff.h:23
TPZManVector< REAL, 3 > fCenter
center of the hyperplane
Definition: pzhyperplane.h:37
TPZHyperPlane(TPZVec< REAL > &center, TPZVec< REAL > &normal)
Definition: pzhyperplane.h:44
void Intersect(const TPZVec< T > &one, const TPZVec< T > &two, TPZStack< T, N > &result)
Gets commom elements into the one and two vectors.
Definition: pzvec_extras.h:188
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
Definition: pzgeoel.h:43
Free store vector implementation.
bool IsLeft(TPZVec< REAL > &point) const
Definition: pzhyperplane.h:49
REAL Distance(const TPZVec< REAL > &point, TPZVec< REAL > &jacobian) const
Definition: pzhyperplane.h:58
This class implements a geometric mesh for the pz environment. Geometry.
Definition: pzgmesh.h:48
Implements computational mesh. Computational Mesh.
Definition: pzcmesh.h:47
Reads a mesh in a "human readable" format, i.e. in text format and with coments. Getting Data...
Definition: pzhyperplane.h:33