#include <ConformTransformation.hpp>

Public Types | |
| typedef ConformTransformationQ1Quadrangle | BoundaryConformTransformation |
Public Member Functions | |
| void | dx (const TinyVector< 3, real_t > &X, TinyVector< 3, real_t > &__result) const |
| void | dx (const real_t &x, const real_t &y, const real_t &z, TinyVector< 3, real_t > &__result) const |
| void | dy (const TinyVector< 3, real_t > &X, TinyVector< 3, real_t > &__result) const |
| void | dy (const real_t &x, const real_t &y, const real_t &z, TinyVector< 3, real_t > &__result) const |
| void | dz (const TinyVector< 3, real_t > &X, TinyVector< 3, real_t > &__result) const |
| void | dz (const real_t &x, const real_t &y, const real_t &z, TinyVector< 3, real_t > &__result) const |
| void | value (const TinyVector< 3, real_t > &X, TinyVector< 3, real_t > &__result) const |
| void | value (const real_t &x, const real_t &y, const real_t &z, TinyVector< 3, real_t > &__result) const |
| bool | invertT (const real_t &x, const real_t &y, const real_t &z, TinyVector< 3, real_t > &Xhat) const |
| Computes Xhat, the point which transformed is (x,y,z). | |
| bool | invertT (const TinyVector< 3, real_t > &X, TinyVector< 3, real_t > &Xhat) const |
| Computes Xhat, the point which transformed is X. | |
| real_t | integrate (const ScalarFunctionBase &f) const |
| ConformTransformationQ1Hexahedron (const Hexahedron &H) | |
Private Member Functions | |
| bool | __inside (const real_t &x, const real_t &y, const real_t &z, TinyVector< 6, bool > &faces) const |
Private Attributes | |
| const Hexahedron & | __H |
| TinyVector< 3, real_t > & | __a |
| TinyVector< 3, real_t > & | __b |
| TinyVector< 3, real_t > & | __c |
| TinyVector< 3, real_t > & | __d |
| TinyVector< 3, real_t > & | __e |
| TinyVector< 3, real_t > & | __f |
| TinyVector< 3, real_t > & | __g |
| TinyVector< 3, real_t > & | __h |
| TinyVector< 8, TinyVector < 3, real_t > > | __vertices |
Friends | |
| class | ConformTransformationQ1HexahedronJacobian |
Definition at line 375 of file ConformTransformation.hpp.
| typedef ConformTransformationQ1Quadrangle ConformTransformationQ1Hexahedron::BoundaryConformTransformation |
Definition at line 380 of file ConformTransformation.hpp.
| ConformTransformationQ1Hexahedron::ConformTransformationQ1Hexahedron | ( | const Hexahedron & | H | ) | [inline] |
Definition at line 484 of file ConformTransformation.hpp.
References __vertices.
00485 : __H(H), 00486 __a(__vertices[0]), 00487 __b(__vertices[1]), 00488 __c(__vertices[2]), 00489 __d(__vertices[3]), 00490 __e(__vertices[4]), 00491 __f(__vertices[5]), 00492 __g(__vertices[6]), 00493 __h(__vertices[7]) 00494 { 00495 TinyVector<8,TinyVector<3, real_t> > jCoefs; 00496 00497 jCoefs[0]=H(0); 00498 jCoefs[1]=H(1) - jCoefs[0]; 00499 jCoefs[2]=H(3) - jCoefs[0]; 00500 jCoefs[3]=H(4) - jCoefs[0]; 00501 jCoefs[4]=H(2) + jCoefs[0] - H(1) - H(3); 00502 jCoefs[5]=H(5) + jCoefs[0] - H(1) - H(4); 00503 jCoefs[6]=H(7) + jCoefs[0] - H(3) - H(4); 00504 jCoefs[7] 00505 = H(1) - jCoefs[0] - H(2) + H(3) 00506 + H(4) - H(5) 00507 + H(6) - H(7); 00508 00509 __vertices = jCoefs; 00510 }
| bool ConformTransformationQ1Hexahedron::__inside | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| TinyVector< 6, bool > & | faces | |||
| ) | const [private] |
Definition at line 36 of file ConformTransformation.cpp.
References __H, Hexahedron::faces, Shape::inside(), Quadrangle::normal(), Hexahedron::NumberOfFaces, and Quadrangle::NumberOfVertices.
00040 { 00041 bool inside = true; 00042 faces = false; 00043 for (size_t i = 0 ; i<Hexahedron::NumberOfFaces; ++i) { 00044 TinyVector<3, real_t> faceMassCenter(0,0,0); 00045 TinyVector<Hexahedron::FaceType::NumberOfVertices, Vertex*> face; 00046 00047 for (size_t n=0; n<Hexahedron::FaceType::NumberOfVertices; ++n) { 00048 const Vertex& v = __H(Hexahedron::faces[i][n]); 00049 faceMassCenter += v; 00050 face[n] = const_cast<Vertex*>(&v); 00051 } 00052 Quadrangle Q(face); 00053 faceMassCenter *= (1./Hexahedron::FaceType::NumberOfVertices); 00054 TinyVector<3,real_t> normal = Q.normal(); 00055 00056 TinyVector<3, real_t> X(x,y,z); 00057 X -= faceMassCenter; 00058 if (X*normal > 0) { // must look in that direction 00059 faces[i] = true; 00060 inside = false; 00061 } 00062 } 00063 return inside; 00064 }

| void ConformTransformationQ1Hexahedron::dx | ( | const TinyVector< 3, real_t > & | X, | |
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
Definition at line 401 of file ConformTransformation.hpp.
Referenced by ConformTransformationQ1HexahedronJacobian::ConformTransformationQ1HexahedronJacobian(), and invertT().
00403 { 00404 dx(X[0], X[1], X[2], __result); 00405 }
| void ConformTransformationQ1Hexahedron::dx | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
| void ConformTransformationQ1Hexahedron::dy | ( | const TinyVector< 3, real_t > & | X, | |
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
Definition at line 416 of file ConformTransformation.hpp.
Referenced by ConformTransformationQ1HexahedronJacobian::ConformTransformationQ1HexahedronJacobian(), and invertT().
00418 { 00419 dy(X[0], X[1], X[2], __result); 00420 }
| void ConformTransformationQ1Hexahedron::dy | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
| void ConformTransformationQ1Hexahedron::dz | ( | const TinyVector< 3, real_t > & | X, | |
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
Definition at line 431 of file ConformTransformation.hpp.
Referenced by ConformTransformationQ1HexahedronJacobian::ConformTransformationQ1HexahedronJacobian(), and invertT().
00433 { 00434 dz(X[0], X[1], X[2], __result); 00435 }
| void ConformTransformationQ1Hexahedron::dz | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
| void ConformTransformationQ1Hexahedron::value | ( | const TinyVector< 3, real_t > & | X, | |
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
Definition at line 446 of file ConformTransformation.hpp.
Referenced by MeshOfHexahedra::buildLocalizationTools(), invertT(), and Convection< MeshOfHexahedra >::operator()().
00448 { 00449 value(X[0],X[1],X[2],__result); 00450 }
| void ConformTransformationQ1Hexahedron::value | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| TinyVector< 3, real_t > & | __result | |||
| ) | const [inline] |
Definition at line 452 of file ConformTransformation.hpp.
References __a, __b, __c, __d, __e, __f, __g, and __h.
00454 { 00455 __result = __a; 00456 __result += x*__b; 00457 __result += y*__c; 00458 __result += z*__d; 00459 __result += (x*y)*__e; 00460 __result += (x*z)*__f; 00461 __result += (y*z)*__g; 00462 __result += (x*y*z)*__h; 00463 }
| bool ConformTransformationQ1Hexahedron::invertT | ( | const real_t & | x, | |
| const real_t & | y, | |||
| const real_t & | z, | |||
| TinyVector< 3, real_t > & | Xhat | |||
| ) | const |
Computes Xhat, the point which transformed is (x,y,z).
Computes Xhat, the point which transformed is (x,y,z) returns false if no Xhat is found...
Computing F(Xhat) - (x,y,z).
Definition at line 68 of file ConformTransformation.cpp.
References dx(), dy(), dz(), TinyVector< N, T >::size(), and value().
Referenced by MeshOfHexahedra::find(), invertT(), and Convection< MeshOfHexahedra >::operator()().
00072 { 00073 // initialization 00074 for(size_t i=0; i<3; ++i) 00075 Xhat[i] = 0.5; 00076 00077 TinyVector<3,real_t> X; 00078 TinyVector<3,real_t> f; 00079 TinyVector<3,real_t> delta; 00080 const size_t maxiter = 100; 00081 size_t niter = 0; 00082 00083 do { 00084 niter++; 00085 00087 value(Xhat,f); 00088 f[0] -= x; 00089 f[1] -= y; 00090 f[2] -= z; 00091 00092 // Evaluation of the Jacobian 00093 TinyMatrix<3,3,real_t> J; 00094 dx(Xhat,X); 00095 for (size_t i=0; i<3; ++i) 00096 J(i,0) = X[i]; 00097 00098 dy(Xhat,X); 00099 for (size_t i=0; i<3; ++i) 00100 J(i,1) = X[i]; 00101 00102 dz(Xhat,X); 00103 for (size_t i=0; i<3; ++i) 00104 J(i,2) = X[i]; 00105 00106 delta = f/J; 00107 00108 // Uses relaxation to help convergence (the functional is not convexe) 00109 Xhat -= delta; 00110 00111 if (niter>maxiter) { // or(Norm(f)>10)) { 00112 return false; 00113 } 00114 00115 } while(Norm(f)>1E-3); 00116 00117 for (size_t i = 0; i<Xhat.size(); ++i) { 00118 if ((Xhat[i]<1E-3) or (Xhat[i]>1.001)) { 00119 return false; 00120 } 00121 } 00122 00123 return true; 00124 }

| bool ConformTransformationQ1Hexahedron::invertT | ( | const TinyVector< 3, real_t > & | X, | |
| TinyVector< 3, real_t > & | Xhat | |||
| ) | const [inline] |
Computes Xhat, the point which transformed is X.
Definition at line 472 of file ConformTransformation.hpp.
References invertT().
00474 { 00475 return invertT(X[0],X[1],X[2], Xhat); 00476 }

| real_t ConformTransformationQ1Hexahedron::integrate | ( | const ScalarFunctionBase & | f | ) | const |
Computes the integrale of the function f on an element using the reference element
Definition at line 26 of file ConformTransformation.cpp.
References ErrorHandler::unexpected.
00027 { 00028 throw ErrorHandler(__FILE__,__LINE__, 00029 "not implemented", 00030 ErrorHandler::unexpected); 00031 return 0; 00032 }
friend class ConformTransformationQ1HexahedronJacobian [friend] |
Definition at line 378 of file ConformTransformation.hpp.
const Hexahedron& ConformTransformationQ1Hexahedron::__H [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__a [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__b [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__c [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__d [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__e [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__f [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__g [private] |
TinyVector<3, real_t>& ConformTransformationQ1Hexahedron::__h [private] |
TinyVector<8, TinyVector<3, real_t> > ConformTransformationQ1Hexahedron::__vertices [private] |
Definition at line 394 of file ConformTransformation.hpp.
Referenced by ConformTransformationQ1Hexahedron().
1.5.6