8 #ifndef TPZCylinder_hpp 9 #define TPZCylinder_hpp 34 TPZCylinderMap() : TGeo(), fCornerCo(2*TGeo::NNodes,-1), fOrigin(3,0.), fRadius(0.), fRotation(3,3,0.)
71 static std::string
TypeName() {
return "CylinderMap";}
78 CornerCoordinates(gel, coord);
89 TGeo::X(fCornerCo,par,ft);
90 TGeo::GradX(fCornerCo, par, gradphi);
92 gradxloc(0,0) = -fRadius*
sin(ft[0])*gradphi(0,0);
93 gradxloc(1,0) = fRadius*
cos(ft[0])*gradphi(0,0);
94 gradxloc(2,0) = gradphi(1,0);
95 gradxloc(0,1) = -fRadius*
sin(ft[0])*gradphi(0,1);
96 gradxloc(1,1) = fRadius*
cos(ft[0])*gradphi(0,1);
97 gradxloc(2,1) = gradphi(1,1);
99 for (int64_t i=0; i<3; i++) {
100 for (int64_t j=0; j<2; j++) {
102 for (int64_t k=0; k<3; k++) {
103 gradx(i,j) += fRotation.
GetVal(k,i)*gradxloc(k,j);
113 TGeo::X(this->fCornerCo,loc,localcylinder);
116 localcartesian[0] = fRadius*
cos(localcylinder[0]);
117 localcartesian[1] = fRadius*
sin(localcylinder[0]);
118 localcartesian[2] = localcylinder[1];
120 for (int64_t i=0; i<3; i++) {
121 result[i] = fOrigin[i];
122 for (int64_t j=0; j<3; j++) {
123 result[i] += fRotation.
GetVal(j,i)*localcartesian[j];
140 fCornerCo.
Read(buf,0);
145 TGeo::Write(buf, withclassid);
146 fCornerCo.
Write(buf,0);
TPZCylinderMap & operator=(const TPZCylinderMap &cp)
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
TPZManVector< REAL, 3 > fOrigin
node around which we rotate the coordinates
TPZCylinderMap(TPZVec< int64_t > &nodeindices)
REAL fRadius
radius of the cylinder
static std::string TypeName()
Returns the type name of the element.
void X(const TPZFMatrix< REAL > &nodes, TPZVec< T > &loc, TPZVec< T > &result) const
virtual void Identity()
Converts the matrix in an identity matrix.
void SetCylinderAxis(const TPZVec< REAL > &axis)
axis direction with the vertical axis
static void InsertExampleElement(TPZGeoMesh &gmesh, int matid, TPZVec< REAL > &lowercorner, TPZVec< REAL > &size)
void X(const TPZGeoEl &gel, TPZVec< T > &loc, TPZVec< T > &result) const
void Read(TPZStream &buf, void *context) override
Creates a geometric element according to the type of the father element.
void SetOrigin(TPZVec< REAL > &origin, REAL radius)
TPZFNMatrix< 9, REAL > fRotation
rotation matrix
void Read(TPZStream &buf, void *context) override
read objects from the stream
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
TPZFNMatrix< TGeo::NNodes *3, REAL > fCornerCo
corner coordinates in cylindrical system (theta, z)
TPZCylinderMap(const TPZCylinderMap &cp)
This class implements a geometric mesh for the pz environment. Geometry.
void GradX(const TPZGeoEl &gel, TPZVec< T > &par, TPZFMatrix< T > &gradx) const
Defines the interface for saving and reading data. Persistency.
void Write(TPZStream &buf, int withclassid) const override
Groups all classes which model the geometry.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
void ComputeCornerCoordinates(TPZGeoMesh &gmesh)
compute the corner coordinates of the corner nodes
const TVar & GetVal(const int64_t row, const int64_t col) const override
Get values without bounds checking This method is faster than "Get" if DEBUG is defined.