29 QsiEtaIni[0] = StartPoint[0];
30 const double deltaQsi = 0.1;
33 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
"\n";
34 std::cout <<
"deltaQsi = const = " << deltaQsi <<
"\n\n";
40 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
42 for(
int i = 0; i < 11; i++)
45 Object.
X(QsiEtaIni,Out);
49 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,0);
50 OutAprox[0] = Out[0] + dX;
52 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,1);
53 OutAprox[1] = Out[1] + dY;
55 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,2);
56 OutAprox[2] = Out[2] + dZ;
58 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
60 Object.
X(StartPoint,Out);
67 Out[0] -= OutAprox[0];
68 Out[1] -= OutAprox[1];
69 Out[2] -= OutAprox[2];
71 double XDiffNorm =
sqrt(Out[0]*Out[0] + Out[1]*Out[1] + Out[2]*Out[2]);
72 error(
int(i),0) = XDiffNorm;
77 std::cout <<
"Convergence Order:\n";
78 for(
int j = 2; j < 11; j++)
82 std::cout <<
"\nIf another kind of results are needed, edit the ConvTest Class on source code!\n";
93 QsiEtaIni[0] = StartPoint[0];
94 QsiEtaIni[1] = StartPoint[1];
95 const double deltaQsi = 0.1;
96 const double deltaEta = 0.1;
99 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
" | initial Eta = " << QsiEtaIni[1] <<
"\n";
100 std::cout <<
"deltaQsi = const = " << deltaQsi <<
" | deltaEta = const = " << deltaEta <<
"\n\n";
106 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
108 for(
int i = 0; i <= 10; i++)
111 Object.
X(QsiEtaIni,Out);
115 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);
116 OutAprox[0] = Out[0] + dX;
118 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);
119 OutAprox[1] = Out[1] + dY;
121 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);
122 OutAprox[2] = Out[2] + dZ;
124 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
125 StartPoint[1] = QsiEtaIni[1] + alpha*deltaEta;
126 Object.
X(StartPoint,Out);
133 Out[0] -= OutAprox[0];
134 Out[1] -= OutAprox[1];
135 Out[2] -= OutAprox[2];
137 double XDiffNorm =
sqrt(Out[0]*Out[0] + Out[1]*Out[1] + Out[2]*Out[2]);
138 error(
int(i),0) = XDiffNorm;
143 std::cout <<
"Convergence Order:\n";
144 for(
int j = 2; j < 11; j++)
148 std::cout <<
"\nIf another kind of results are needed, edit the ConvTest Class on source code!\n";
159 QsiEtaIni[0] = StartPoint[0];
160 QsiEtaIni[1] = StartPoint[1];
161 QsiEtaIni[2] = StartPoint[2];
162 const double deltaQsi = 0.1;
163 const double deltaEta = 0.1;
164 const double deltaZeta = 0.1;
167 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
" | initial Eta = " << QsiEtaIni[1] <<
" | initial Zeta = " << QsiEtaIni[2] <<
"\n";
168 std::cout <<
"deltaQsi = const = " << deltaQsi <<
" | deltaEta = const = " << deltaEta <<
" | deltaZeta = const = " << deltaZeta <<
"\n\n";
174 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
176 for(
int i = 0; i <= 10; i++)
179 Object.
X(QsiEtaIni,Out);
183 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);
184 OutAprox[0] = Out[0] + dX;
186 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);
187 OutAprox[1] = Out[1] + dY;
189 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);
190 OutAprox[2] = Out[2] + dZ;
192 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
193 StartPoint[1] = QsiEtaIni[1] + alpha*deltaEta;
194 StartPoint[2] = QsiEtaIni[2] + alpha*deltaZeta;
195 Object.
X(StartPoint,Out);
202 Out[0] -= OutAprox[0];
203 Out[1] -= OutAprox[1];
204 Out[2] -= OutAprox[2];
206 double XDiffNorm =
sqrt(Out[0]*Out[0] + Out[1]*Out[1] + Out[2]*Out[2]);
207 error(
int(i),0) = XDiffNorm;
212 std::cout <<
"Convergence Order:\n";
213 for(
int j = 2; j < 11; j++)
217 std::cout <<
"\nIf another kind of results are needed, edit the ConvTest Class on source code!\n";
222 std::cout <<
"Element don't fit in an option of Convergence Analys!\nSee ConvTest Class...\n";
238 QsiEtaIni[0] = StartPoint[0];
239 const double deltaQsi = 0.1;
242 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
"\n";
243 std::cout <<
"deltaQsi = const = " << deltaQsi <<
"\n\n";
249 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
251 for(
int i = 0; i < 11; i++)
254 Object.
X(QsiEtaIni,Out);
258 dX = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,0);
259 OutAprox[0] = Out[0] + dX;
261 dY = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,1);
262 OutAprox[1] = Out[1] + dY;
264 dZ = alpha*( jacobian.
GetVal(0,0)*deltaQsi )*Axes(0,2);
265 OutAprox[2] = Out[2] + dZ;
267 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
269 Object.
X(StartPoint,Out);
276 Out[0] -= OutAprox[0];
277 Out[1] -= OutAprox[1];
278 Out[2] -= OutAprox[2];
280 double XDiffNorm =
sqrt(Out[0]*Out[0] + Out[1]*Out[1] + Out[2]*Out[2]);
281 error(
int(i),0) = XDiffNorm;
286 std::cout <<
"Convergence Order:\n";
287 for(
int j = 2; j < 11; j++)
291 std::cout <<
"\nIf another kind of results are needed, edit the ConvTest Class on source code!\n";
302 QsiEtaIni[0] = StartPoint[0];
303 QsiEtaIni[1] = StartPoint[1];
304 const double deltaQsi = 0.1;
305 const double deltaEta = 0.1;
308 std::cout <<
"\ninitial Qsi = " << QsiEtaIni[0] <<
" | initial Eta = " << QsiEtaIni[1] <<
"\n";
309 std::cout <<
"deltaQsi = const = " << deltaQsi <<
" | deltaEta = const = " << deltaEta <<
"\n\n";
315 Object.
Jacobian(QsiEtaIni,jacobian,Axes,detJacobian,InvJac);
317 for(
int i = 0; i <= 10; i++)
320 Object.
X(QsiEtaIni,Out);
324 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);
325 OutAprox[0] = Out[0] + dX;
327 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);
328 OutAprox[1] = Out[1] + dY;
330 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);
331 OutAprox[2] = Out[2] + dZ;
333 StartPoint[0] = QsiEtaIni[0] + alpha*deltaQsi;
334 StartPoint[1] = QsiEtaIni[1] + alpha*deltaEta;
335 Object.
X(StartPoint,Out);
342 Out[0] -= OutAprox[0];
343 Out[1] -= OutAprox[1];
344 Out[2] -= OutAprox[2];
346 double XDiffNorm =
sqrt(Out[0]*Out[0] + Out[1]*Out[1] + Out[2]*Out[2]);
347 error(
int(i),0) = XDiffNorm;
352 std::cout <<
"Convergence Order:\n";
353 for(
int j = 2; j < 11; j++)
357 std::cout <<
"\nIf another kind of results are needed, edit the ConvTest Class on source code!\n";
363 std::cout <<
"Element don't fit in an option of Convergence Analys!\nSee ConvTest Class...\n";
void JacobianConv(TPZGeoEl &Object, TPZVec< REAL > QsiEta)
Evaluates the Jacobian by obtained Convergence Order.
ConvTest()
Default constructor.
Contains ConvTest class which implements methods to evaluate jacobians by obtained convergence order ...
Utility class which represents an element with its side. The Geometric approximation classes Geometry...
Defines the behaviour of all geometric elements. GeometryTPZGeoEl is the common denominator for all g...
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
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...
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.
~ConvTest()
Default destructor.
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.