34 if(SemiAxeX.
size() != 3 || SemiAxeY.
size() != 3 || Origin.
size() != 3)
36 cout <<
"\nThe two semi-axes and origin of TPZEllipse3D must be in 3D!!!\n";
40 double dotXY = (SemiAxeX[0]*SemiAxeY[0] + SemiAxeX[1]*SemiAxeY[1] + SemiAxeX[2]*SemiAxeY[2]);
43 cout <<
"\nThe two semi-axes of TPZEllipse3D must be orthogonal!!!\n";
47 double dotXX =
sqrt(SemiAxeX[0]*SemiAxeX[0] + SemiAxeX[1]*SemiAxeX[1] + SemiAxeX[2]*SemiAxeX[2]);
48 double dotYY =
sqrt(SemiAxeY[0]*SemiAxeY[0] + SemiAxeY[1]*SemiAxeY[1] + SemiAxeY[2]*SemiAxeY[2]);
51 cout <<
"Null semi-axe(s) on TPZEllipse3D!!! or semi-axes not orthogonal\n";
57 fsAxeX =
sqrt(SemiAxeX[0]*SemiAxeX[0] + SemiAxeX[1]*SemiAxeX[1] + SemiAxeX[2]*SemiAxeX[2]);
58 fsAxeY =
sqrt(SemiAxeY[0]*SemiAxeY[0] + SemiAxeY[1]*SemiAxeY[1] + SemiAxeY[2]*SemiAxeY[2]);
60 for(
int i = 0; i < 3; i++)
62 fAxes(0,i) = SemiAxeX[i]/fsAxeX;
63 fAxes(1,i) = SemiAxeY[i]/fsAxeY;
65 fAxes(2,0) = fAxes(0,1)*fAxes(1,2)-fAxes(0,2)*fAxes(1,1);
66 fAxes(2,1) = -fAxes(0,0)*fAxes(1,2)+fAxes(0,2)*fAxes(1,0);
67 fAxes(2,2) = fAxes(0,0)*fAxes(1,1)-fAxes(0,1)*fAxes(1,0);
71 fAxes.MultAdd(fAxes, fAxes, ident,1.,0.,1);
72 for (
int i=0; i<3; i++) {
75 REAL norm =
Norm(ident);
82 gmesh.
NodeVec()[fNodeIndexes[0]].GetCoordinates(xini);
83 gmesh.
NodeVec()[fNodeIndexes[1]].GetCoordinates(xfinal);
84 fAngleIni = ComputeAngle(xini);
85 fAngleFinal = ComputeAngle(xfinal);
86 if (fAngleFinal < fAngleIni) {
87 fAngleFinal += 2.*M_PI;
96 for(
int i=0; i<3; i++) comat(i,0) = co[i]-fOrigin[i];
97 fAxes.Multiply(comat, localco);
103 localco(0,0) /= fsAxeX;
104 localco(1,0) /= fsAxeY;
107 double r = localco(0,0)*localco(0,0)+localco(1,0)*localco(1,0);
108 if (
fabs(r-1.) > 1.e-6) {
113 double angle =
atan2(localco(1,0),localco(0,0));
122 REAL
angle = fAngleIni;
124 xcoloc(0,0) = fsAxeX*
cos(angle);
125 xcoloc(1,0) = fsAxeY*
sin(angle);
127 fAxes.MultAdd(xcoloc, xcoloc, xcoglob,1.,0.,transp);
128 for (
int i=0; i<3; i++) {
129 x[i] = fOrigin[i]+xcoglob(i,0)-nodeCoord(i,0);
132 for (
int i=0; i<3; i++) {
141 REAL
angle = fAngleFinal;
143 xcoloc(0,0) = fsAxeX*
cos(angle);
144 xcoloc(1,0) = fsAxeY*
sin(angle);
146 fAxes.MultAdd(xcoloc, xcoloc, xcoglob,1.,0.,transp);
147 for (
int i=0; i<3; i++) {
148 x[i] = fOrigin[i]+xcoglob(i,0)-nodeCoord(i,1);
151 for (
int i=0; i<3; i++) {
160 REAL delangle = fAngleFinal - fAngleIni;
161 T
angle = fAngleIni + (qsi[0]+1.)/2.*delangle;
163 xcoloc(0,0) = fsAxeX*
cos(angle);
164 xcoloc(1,0) = fsAxeY*
sin(angle);
168 for (
int i=0; i<3; i++) {
169 for (
int j=0; j<3; j++) {
170 axloc(i,j) = fAxes.
GetVal(i,j);
173 axloc.
MultAdd(xcoloc, xcoloc, xcoglob,one,zero,transp);
174 for (
int i=0; i<3; i++) {
175 x[i] = fOrigin[i]+xcoglob(i,0);
182 REAL delangle = fAngleFinal - fAngleIni;
183 T dangledqsi = 1./2.*delangle;
184 T
angle = fAngleIni + (par[0]+1.)/2.*delangle;
186 dxcoloc(0,0) = -fsAxeX*
sin(angle);
187 dxcoloc(1,0) = fsAxeY*
cos(angle);
190 for (
int i=0; i<3; i++) {
191 for (
int j=0; j<3; j++) {
192 axloc(i,j) = fAxes.
GetVal(i,j);
195 axloc.
MultAdd(dxcoloc, dxcoloc, dxcoglob,1.,0.,transp);
196 for (
int i=0; i<3; i++) {
197 gradx(i,0) = dangledqsi*dxcoglob(i,0);
206 for(
int i = 0; i < NNodes; i++)
208 const int64_t nodeindex = this->fNodeIndexes[i];
210 for(
int j = 0; j < 3; j++)
212 nodes(j,i) = np->
Coord(j);
219 for(
int i = 0; i < NNodes; i++)
221 const int64_t nodeindex = this->fNodeIndexes[i];
223 for(
int j = 0; j < 3; j++)
229 for(
int i=0; i<3; i++)
231 Ax0[i] = fAxes(0,i)*fsAxeX;
232 Ax1[i] = fAxes(1,i)*fsAxeY;
234 SetAxes(origin, Ax0, Ax1, mesh);
243 REAL
angle = fAngleIni;
245 xcoloc(0,0) = fsAxeX*
cos(angle);
246 xcoloc(1,0) = fsAxeY*
sin(angle);
248 fAxes.MultAdd(xcoloc, xcoloc, xcoglob,1.,0.,transp);
249 for (
int i=0; i<3; i++) {
250 nodes(i,0) = fOrigin[i]+xcoglob(i,0);
254 REAL
angle = fAngleFinal;
256 xcoloc(0,0) = fsAxeX*
cos(angle);
257 xcoloc(1,0) = fsAxeY*
sin(angle);
259 fAxes.MultAdd(xcoloc, xcoloc, xcoglob,1.,0.,transp);
260 for (
int i=0; i<3; i++) {
261 nodes(i,1) = fOrigin[i]+xcoglob(i,0);
265 SetNodesCoords(mesh, nodes);
309 void TPZEllipse3D::ParametricDomainNodeCoord(int64_t node,
TPZVec<REAL> &nodeCoord)
311 if(node > this->NNodes)
315 nodeCoord.
Resize(Dimension, 0.);
335 int TPZEllipse3D::ClassId()
const{
343 for (
int i=0; i<3; i++) {
344 for (
int j=0; j<3; j++) {
345 vander(i,j) =
pow(i+1.,j);
348 vander.GramSchmidt(rotation, jac);
350 REAL ax1 = 3., ax2 = 1.;
351 REAL angle1 = M_PI/5.5;
352 REAL angle2 = M_PI*0.96;
354 xloc(0,0) = ax1*
cos(angle1);
355 xloc(1,0) = ax2*
sin(angle1);
356 xloc(0,1) = ax1*
cos(angle2);
357 xloc(1,1) = ax2*
sin(angle2);
359 for (
int i=0; i<3; i++) {
360 orig[i] = lowercorner[i]+3.;
364 rotation.Multiply(xloc, xfinal);
366 for (
int i=0; i<3; i++) {
367 axis1[i] = rotation(i,0)*ax1;
368 axis2[i] = rotation(i,1)*ax2;
369 for (
int j=0; j<2; j++) {
370 xfinal(i,j) += orig[i];
376 for(
int i=0; i<3; i++) xco[i] = xfinal(i,0);
377 gmesh.
NodeVec()[index[0]].Initialize(xco, gmesh);
379 for(
int i=0; i<3; i++) xco[i] = xfinal(i,1);
380 gmesh.
NodeVec()[index[1]].Initialize(xco, gmesh);
static REAL cornerco[8][3]
TPZFlopCounter atan2(const TPZFlopCounter &val1, const TPZFlopCounter &val2)
Returns the arc tangent in radians and increments the counter of the Arc Tangent. ATAN2 returns the ...
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ fabs
int AllocateNewElement()
Makes more room for new elements.
void SetCoord(const TPZVec< REAL > &x)
Sets all coordinates into the current node. It gets the dim values from x.
const double tolerance
Tolerance value (Is zero)
Contains declaration of TPZGeoNode class which defines a geometrical node.
REAL Coord(int i) const
Returns i-th coordinate of the current node.
Templated vector implementation.
groups all classes dedicated to the computation of shape functions
void SetAxes(TPZVec< REAL > Origin, TPZVec< REAL > SemiAxeX, TPZVec< REAL > SemiAxeY, TPZGeoMesh &gmesh)
Origin defines the translation of ellipse while semi-axes defines the rotation of ellipse...
Implements the mapping between the master element and deformed element. Geometry. ...
Contains TPZShapeLinear class which implements the shape functions of a linear one-dimensional elemen...
Contains declaration of TPZGeoElMapped class which implements a geometric element using its ancestral...
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 declaration of TPZMesh class which defines a geometrical mesh and contains a corresponding l...
Groups all classes defining the structure of the master element.
Implements a generic geometric element which is refined according to a generic refinement pattern...
TVar Norm(const TPZFMatrix< TVar > &A)
Returns the norm of the matrix A.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZAdmChunkVector< TPZGeoNode > & NodeVec()
Contains the TPZNodeRep class which implements ... Clase intermediaria que guarda.
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
REAL co[8][3]
Coordinates of the eight nodes.
Implements ... Geometry Topology.
int32_t Hash(std::string str)
static REAL angle
Angle in radians to test.
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
Implements a geometric node in the pz environment. Geometry.
This class implements a geometric mesh for the pz environment. Geometry.
Contains the implementation of the TPZNodeRep methods.
virtual void MultAdd(const TPZFMatrix< TVar > &x, const TPZFMatrix< TVar > &y, TPZFMatrix< TVar > &z, const TVar alpha=1., const TVar beta=0., const int opt=0) const override
It computes z = beta * y + alpha * opt(this)*x but z and x can not overlap in memory.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Contains the implementation of the TPZGeoElRefPattern methods.
Groups all classes which model the geometry.
TPZFlopCounter cos(const TPZFlopCounter &orig)
Returns the cosine in radians and increments the counter of the Cosine.
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.
Contains the TPZEllipse3D class which defines a linear geometric element which maps a line segment to...
Implements an interface to register a class id and a restore function. Persistence.