31 QsiEtaIni[0] = StartPoint[0];
32 const double deltaQsi = 0.01;
35 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
"\n";
36 std::cout <<
"deltaQsi = const = " << deltaQsi <<
"\n\n";
42 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
44 for(
int i = 0; i < 11; i++)
48 Object.
X(QsiEtaIni,OutReal);
52 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,0);
53 OutAprox[0] = OutReal[0] + dX;
55 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,1);
56 OutAprox[1] = OutReal[1] + dY;
58 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,2);
59 OutAprox[2] = OutReal[2] + dZ;
62 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
63 Object.
X(StartPoint,OutReal);
70 OutReal[0] -= OutAprox[0];
71 OutReal[1] -= OutAprox[1];
72 OutReal[2] -= OutAprox[2];
74 double XDiffNorm =
sqrt(OutReal[0]*OutReal[0] + OutReal[1]*OutReal[1] + OutReal[2]*OutReal[2]);
75 error(
int(i),0) = XDiffNorm;
80 std::cout <<
"Convergence Order:\n";
81 for(
int j = 2; j < 11; j++)
85 std::cout <<
"\nIf another kind of results are needed, edit the TPZMathTools Class on source code!\n";
96 QsiEtaIni[0] = StartPoint[0];
97 QsiEtaIni[1] = StartPoint[1];
98 const double deltaQsi = 0.01;
99 const double deltaEta = 0.01;
102 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
" | initial Eta = " << QsiEtaIni[1] <<
"\n";
103 std::cout <<
"deltaQsi = const = " << deltaQsi <<
" | deltaEta = const = " << deltaEta <<
"\n\n";
109 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
111 for(
int i = 0; i <= 10; i++)
114 Object.
X(QsiEtaIni,OutReal);
118 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta )*Axes(0,0) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta )*Axes(1,0);
119 OutAprox[0] = OutReal[0] + dX;
121 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta )*Axes(0,1) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta )*Axes(1,1);
122 OutAprox[1] = OutReal[1] + dY;
124 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta )*Axes(0,2) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta )*Axes(1,2);
125 OutAprox[2] = OutReal[2] + dZ;
127 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
128 StartPoint[1] = QsiEtaIni[1] + alpha*deltaEta;
129 Object.
X(StartPoint,OutReal);
136 OutReal[0] -= OutAprox[0];
137 OutReal[1] -= OutAprox[1];
138 OutReal[2] -= OutAprox[2];
140 double XDiffNorm =
sqrt(OutReal[0]*OutReal[0] + OutReal[1]*OutReal[1] + OutReal[2]*OutReal[2]);
141 error(
int(i),0) = XDiffNorm;
146 std::cout <<
"Convergence Order:\n";
147 for(
int j = 2; j < 11; j++)
151 std::cout <<
"\nIf another kind of results are needed, edit the TPZMathTools Class on source code!\n";
162 QsiEtaIni[0] = StartPoint[0];
163 QsiEtaIni[1] = StartPoint[1];
164 QsiEtaIni[2] = StartPoint[2];
165 const double deltaQsi = 0.01;
166 const double deltaEta = 0.01;
167 const double deltaZeta = 0.01;
170 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
" | initial Eta = " << QsiEtaIni[1] <<
" | initial Zeta = " << QsiEtaIni[2] <<
"\n";
171 std::cout <<
"deltaQsi = const = " << deltaQsi <<
" | deltaEta = const = " << deltaEta <<
" | deltaZeta = const = " << deltaZeta <<
"\n\n";
177 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
179 for(
int i = 0; i <= 10; i++)
182 Object.
X(QsiEtaIni,OutReal);
186 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta + jacobian.
GetVal(0,2)*deltaZeta)*Axes(0,0) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta + jacobian.
GetVal(1,2)*deltaZeta)*Axes(1,0) + alpha*( jacobian.
GetVal(2,0)*deltaQsi + jacobian.
GetVal(2,1)*deltaEta + jacobian.
GetVal(2,2)*deltaZeta)*Axes(2,0);
187 OutAprox[0] = OutReal[0] + dX;
189 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta + jacobian.
GetVal(0,2)*deltaZeta)*Axes(0,1) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta + jacobian.
GetVal(1,2)*deltaZeta)*Axes(1,1) + alpha*( jacobian.
GetVal(2,0)*deltaQsi + jacobian.
GetVal(2,1)*deltaEta + jacobian.
GetVal(2,2)*deltaZeta)*Axes(2,1);
190 OutAprox[1] = OutReal[1] + dY;
192 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta + jacobian.
GetVal(0,2)*deltaZeta)*Axes(0,2) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta + jacobian.
GetVal(1,2)*deltaZeta)*Axes(1,2) + alpha*( jacobian.
GetVal(2,0)*deltaQsi + jacobian.
GetVal(2,1)*deltaEta + jacobian.
GetVal(2,2)*deltaZeta)*Axes(2,2);
193 OutAprox[2] = OutReal[2] + dZ;
195 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
196 StartPoint[1] = QsiEtaIni[1] + alpha*deltaEta;
197 StartPoint[2] = QsiEtaIni[2] + alpha*deltaZeta;
199 Object.
X(StartPoint,OutReal);
206 OutReal[0] -= OutAprox[0];
207 OutReal[1] -= OutAprox[1];
208 OutReal[2] -= OutAprox[2];
210 double XDiffNorm =
sqrt(OutReal[0]*OutReal[0] + OutReal[1]*OutReal[1] + OutReal[2]*OutReal[2]);
211 error(
int(i),0) = XDiffNorm;
216 std::cout <<
"Convergence Order:\n";
217 for(
int j = 2; j < 11; j++)
221 std::cout <<
"\nIf another kind of results are needed, edit the TPZMathTools Class on source code!\n";
226 std::cout <<
"Element don't fit in an option of Convergence Analys!\nSee TPZMathTools Class...\n";
242 QsiEtaIni[0] = StartPoint[0];
243 const double deltaQsi = 0.01;
246 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
"\n";
247 std::cout <<
"deltaQsi = const = " << deltaQsi <<
"\n\n";
253 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
255 for(
int i = 0; i < 11; i++)
258 Object.
X(QsiEtaIni,OutReal);
262 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,0);
263 OutAprox[0] = OutReal[0] + dX;
265 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,1);
266 OutAprox[1] = OutReal[1] + dY;
268 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,2);
269 OutAprox[2] = OutReal[2] + dZ;
271 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
273 Object.
X(StartPoint,OutReal);
280 OutReal[0] -= OutAprox[0];
281 OutReal[1] -= OutAprox[1];
282 OutReal[2] -= OutAprox[2];
284 double XDiffNorm =
sqrt(OutReal[0]*OutReal[0] + OutReal[1]*OutReal[1] + OutReal[2]*OutReal[2]);
285 error(
int(i),0) = XDiffNorm;
290 std::cout <<
"Convergence Order:\n";
291 for(
int j = 2; j < 11; j++)
295 std::cout <<
"\nIf another kind of results are needed, edit the TPZMathTools Class on source code!\n";
306 QsiEtaIni[0] = StartPoint[0];
307 QsiEtaIni[1] = StartPoint[1];
308 const double deltaQsi = 0.01;
309 const double deltaEta = 0.01;
312 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
" | initial Eta = " << QsiEtaIni[1] <<
"\n";
313 std::cout <<
"deltaQsi = const = " << deltaQsi <<
" | deltaEta = const = " << deltaEta <<
"\n\n";
319 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
321 for(
int i = 0; i <= 10; i++)
324 Object.
X(QsiEtaIni,OutReal);
328 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta )*Axes(0,0) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta )*Axes(1,0);
329 OutAprox[0] = OutReal[0] + dX;
331 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta )*Axes(0,1) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta )*Axes(1,1);
332 OutAprox[1] = OutReal[1] + dY;
334 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi + jacobian.
GetVal(0,1)*deltaEta )*Axes(0,2) + alpha*( jacobian.
GetVal(1,0)*deltaQsi + jacobian.
GetVal(1,1)*deltaEta )*Axes(1,2);
335 OutAprox[2] = OutReal[2] + dZ;
337 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
338 StartPoint[1] = QsiEtaIni[1] + alpha*deltaEta;
339 Object.
X(StartPoint,OutReal);
346 OutReal[0] -= OutAprox[0];
347 OutReal[1] -= OutAprox[1];
348 OutReal[2] -= OutAprox[2];
350 double XDiffNorm =
sqrt(OutReal[0]*OutReal[0] + OutReal[1]*OutReal[1] + OutReal[2]*OutReal[2]);
351 error(
int(i),0) = XDiffNorm;
356 std::cout <<
"Convergence Order:\n";
357 for(
int j = 2; j < 11; j++)
361 std::cout <<
"\nIf another kind of results are needed, edit the TPZMathTools Class on source code!\n";
367 std::cout <<
"Element don't fit in an option of Convergence Analys!\nSee TPZMathTools Class...\n";
375 REAL temp = 1./
pow(x[0]*x[0]+x[1]*x[1],(REAL).5);
376 REAL ang =
atan(x[1]/x[0]);
380 fx = temp*
cos(ang*3./2.);
389 REAL detjac, weight, fval;
396 int intrulepoints = intrule->
NPoints();
397 for(
int int_ind = 0; int_ind < intrulepoints; int_ind++)
399 intrule->
Point(int_ind,qsi,weight);
401 Geo->
Jacobian(qsi, jacobian, axes, detjac , jacinv);
404 Result += fval * weight *
fabs(detjac);
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
virtual int NPoints() const =0
Returns number of points for the cubature rule related.
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
virtual int NSides() const =0
Returns the number of connectivities of the element.
Abstract class defining integration rules. Numerical Integration.
virtual TPZIntPoints * CreateSideIntegrationRule(int side, int order)=0
Creates an integration rule for the topology of the corresponding side and able to integrate a polyno...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
virtual void SetOrder(TPZVec< int > &ord, int type=0)=0
Sets the order of the cubature rule.
void X(TPZVec< REAL > &loc, TPZVec< REAL > &result) const
X coordinate of a point loc of the side.
void Jacobian(TPZVec< REAL > &qsi, TPZFMatrix< REAL > &jac, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv) const
Compute a decomposition of the gradient of the mapping function, as a rotation matrix (Jacobian) and ...
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ sqrt
TPZFlopCounter pow(const TPZFlopCounter &orig, const TPZFlopCounter &xp)
Returns the power and increments the counter of the power.
virtual int Dimension() const =0
Returns the dimension of the element.
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_ log
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...
expr_ expr_ expr_ expr_ expr_ expr_ expr_ expr_ atan
virtual int GetMaxOrder() const
Returns the minimum order to integrate polinomials exactly for all implemented cubature rules...
int Dimension() const
the dimension associated with the element/side
void Jacobian(TPZVec< REAL > ¶m, TPZFMatrix< REAL > &jacobian, TPZFMatrix< REAL > &axes, REAL &detjac, TPZFMatrix< REAL > &jacinv) const
Jacobian associated with the side of the element.
Contains the TPZIntPoints class which defines integration rules.
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.
virtual void Point(int i, TPZVec< REAL > &pos, REAL &w) const =0
Returns i-th point at master element and related weight.