@@ -978,9 +978,9 @@ bool CFreeFormDefBox::GetPointFFD(CGeometry *geometry, CConfig *config, unsigned
978978 bool spherical = (config->GetFFD_CoordSystem () == SPHERICAL);
979979 bool polar = (config->GetFFD_CoordSystem () == POLAR);
980980
981-
982- // nijso: subdivide the box into separate tetrahedrons
983- // unsigned short Index[5][7] = {
981+
982+ // subdivide the box into separate tetrahedrons
983+ // unsigned short Index[5][7] = {
984984 // {0, 1, 2, 5, 0, 1, 2},
985985 // {0, 2, 7, 5, 0, 2, 7},
986986 // {0, 2, 3, 7, 0, 2, 3},
@@ -996,9 +996,12 @@ bool CFreeFormDefBox::GetPointFFD(CGeometry *geometry, CConfig *config, unsigned
996996 {4 ,5 ,1 ,0 ,4 }, // bottom side
997997 {4 ,7 ,6 ,5 ,4 }}; // back side
998998
999- // nijso: better to subdivide each of the 6 faces into 4 triangles by defining a supporting middle point
1000- // note that the definition of the FFD box is as follows: we first define one face counterclockwise when looking from outside of the ffd box
1001- // then we define the second face counterclockwise when looking from the inside of the ffd box
999+ /* --- The current approach is to subdivide each of the 6 faces of the hexahedral FFD box into 4 triangles
1000+ by defining a supporting middle point. This allows nonplanar FFD boxes.
1001+ Note that the definition of the FFD box is as follows: the FFD box is a 6-sided die and we are looking at the side "1".
1002+ The opposite side is side "6".
1003+ If we are looking at side "1", we define the nodes counterclockwise.
1004+ If we are looking at side "6", we define the face clockwise ---*/
10021005
10031006
10041007 unsigned short nDim = geometry->GetnDim ();
@@ -1047,56 +1050,11 @@ bool CFreeFormDefBox::GetPointFFD(CGeometry *geometry, CConfig *config, unsigned
10471050 P);
10481051 if (Distance_Point < 0 ) {
10491052 Inside = false ;
1050- cout << " outside of the FFD box" << endl;
10511053 return Inside;
10521054 }
1053- // cout <<"__new: "<< Coord[0] << ", "<< Coord[1] << ", "<< Coord[2] << ", " << endl;
1054- // cout <<"__new: "<< Coord_Corner_Points[Index[iVar][jVar]][0] << ", "<< Coord_Corner_Points[Index[iVar][jVar]][1] << ", "<< Coord_Corner_Points[Index[iVar][jVar]][2] << ", " << endl;
1055- // cout <<"__new: "<< Coord_Corner_Points[Index[iVar][jVar+1]][0] << ", "<< Coord_Corner_Points[Index[iVar][jVar+1]][1] << ", "<< Coord_Corner_Points[Index[iVar][jVar+1]][2] << ", " << endl;
1056- // cout <<"__new: "<< P[0] << ", "<< P[1] << ", "<< P[2] << ", " << endl;
1057- // cout << "__ dp = " << Distance_Point << endl;
1058- }
1059- }
1060-
1061-
1062-
1063-
1064- /* --- 1st tetrahedron {V0, V1, V2, V5}
1065- 2nd tetrahedron {V0, V2, V7, V5}
1066- 3th tetrahedron {V0, V2, V3, V7}
1067- 4th tetrahedron {V0, V5, V7, V4}
1068- 5th tetrahedron {V2, V7, V5, V6} ---*/
1069-
1070- // loop over the tetrahedrons
1071- /*
1072- for (iVar = 0; iVar < 5; iVar++) {
1073- Inside = true;
1074- for (jVar = 0; jVar < 4; jVar++) {
1075- su2double Distance_Point = geometry->Point2Plane_Distance(Coord,
1076- Coord_Corner_Points[Index[iVar][jVar+1]],
1077- Coord_Corner_Points[Index[iVar][jVar+2]],
1078- Coord_Corner_Points[Index[iVar][jVar+3]]);
1079-
1080- su2double Distance_Vertex = geometry->Point2Plane_Distance(Coord_Corner_Points[Index[iVar][jVar]],
1081- Coord_Corner_Points[Index[iVar][jVar+1]],
1082- Coord_Corner_Points[Index[iVar][jVar+2]],
1083- Coord_Corner_Points[Index[iVar][jVar+3]]);
1084- if (Distance_Point*Distance_Vertex < 0.0) Inside = false;
1085-
1086- cout <<"__ "<<iVar << " , " << jVar << " , "
1087- << Coord[0] << ", "<< Coord[1] << ", "<< Coord[2] << ", " << endl;
1088- cout <<"__ "<< Coord_Corner_Points[Index[iVar][jVar]][0] << ", "<< Coord_Corner_Points[Index[iVar][jVar]][1] << ", "<< Coord_Corner_Points[Index[iVar][jVar]][2] << ", " << endl;
1089- cout <<"__ "<< Coord_Corner_Points[Index[iVar][jVar+1]][0] << ", "<< Coord_Corner_Points[Index[iVar][jVar+1]][1] << ", "<< Coord_Corner_Points[Index[iVar][jVar+1]][2] << ", " << endl;
1090- cout <<"__ "<< Coord_Corner_Points[Index[iVar][jVar+2]][0] << ", "<< Coord_Corner_Points[Index[iVar][jVar+2]][1] << ", "<< Coord_Corner_Points[Index[iVar][jVar+2]][2] << ", " << endl;
1091- cout <<"__ "<< Coord_Corner_Points[Index[iVar][jVar+3]][0] << ", "<< Coord_Corner_Points[Index[iVar][jVar+3]][1] << ", "<< Coord_Corner_Points[Index[iVar][jVar+3]][2] << ", " << endl;
1092- cout << "__ dp = " << Distance_Point << " , " << Distance_Vertex << ", inside="<<Inside << endl;
1093-
10941055 }
1095- if (Inside) break;
10961056 }
1097- */
10981057
1099- cout << " inside = " << Inside << endl;
11001058 return Inside;
11011059
11021060}
0 commit comments