@@ -40,35 +40,35 @@ class CFreeFormDefBox : public CGridMovement {
4040 unsigned short nDim; /* !< \brief Number of dimensions of the problem. */
4141 unsigned short nCornerPoints, /* !< \brief Number of corner points of the FFDBox. */
4242 nControlPoints, nControlPoints_Copy; /* !< \brief Number of control points of the FFDBox. */
43- su2double **Coord_Corner_Points, /* !< \brief Coordinates of the corner points. */
44- ****Coord_Control_Points, /* !< \brief Coordinates of the control points. */
45- ****ParCoord_Control_Points, /* !< \brief Coordinates of the control points. */
46- ****Coord_Control_Points_Copy, /* !< \brief Coordinates of the control points (copy). */
47- ****Coord_SupportCP; /* !< \brief Coordinates of the support control points. */
48- unsigned short lOrder, lOrder_Copy, /* !< \brief Order of the FFDBox in the i direction. */
49- mOrder , mOrder_Copy , /* !< \brief Order of the FFDBox in the j direction. */
50- nOrder, nOrder_Copy; /* !< \brief Order of the FFDBox in the k direction. */
43+ su2double **Coord_Corner_Points, /* !< \brief Coordinates of the corner points. */
44+ ****Coord_Control_Points, /* !< \brief Coordinates of the control points. */
45+ ****ParCoord_Control_Points, /* !< \brief Coordinates of the control points. */
46+ ****Coord_Control_Points_Copy, /* !< \brief Coordinates of the control points (copy). */
47+ ****Coord_SupportCP; /* !< \brief Coordinates of the support control points. */
48+ unsigned short lOrder, lOrder_Copy, /* !< \brief Order of the FFDBox in the i direction. */
49+ mOrder , mOrder_Copy , /* !< \brief Order of the FFDBox in the j direction. */
50+ nOrder, nOrder_Copy; /* !< \brief Order of the FFDBox in the k direction. */
5151 unsigned short lDegree, lDegree_Copy, /* !< \brief Degree of the FFDBox in the i direction. (lOrder - 1)*/
52- mDegree , mDegree_Copy , /* !< \brief Degree of the FFDBox in the j direction. (mOrder - 1)*/
53- nDegree, nDegree_Copy; /* !< \brief Degree of the FFDBox in the k direction. (nOrder - 1)*/
54- su2double *ParamCoord, *ParamCoord_, /* !< \brief Parametric coordinates of a point. */
55- *cart_coord, *cart_coord_; /* !< \brief Cartesian coordinates of a point. */
56- su2double ObjFunc; /* !< \brief Objective function of the point inversion process. */
57- su2double *Gradient; /* !< \brief Gradient of the point inversion process. */
52+ mDegree , mDegree_Copy , /* !< \brief Degree of the FFDBox in the j direction. (mOrder - 1)*/
53+ nDegree, nDegree_Copy; /* !< \brief Degree of the FFDBox in the k direction. (nOrder - 1)*/
54+ su2double *ParamCoord, *ParamCoord_, /* !< \brief Parametric coordinates of a point. */
55+ *cart_coord, *cart_coord_; /* !< \brief Cartesian coordinates of a point. */
56+ su2double ObjFunc; /* !< \brief Objective function of the point inversion process. */
57+ su2double *Gradient; /* !< \brief Gradient of the point inversion process. */
5858 su2double **Hessian; /* !< \brief Hessian of the point inversion process. */
59- su2double MaxCoord[3 ]; /* !< \brief Maximum coordinates of the FFDBox. */
60- su2double MinCoord[3 ]; /* !< \brief Minimum coordinates of the FFDBox. */
61- string Tag; /* !< \brief Tag to identify the FFDBox. */
62- unsigned short Level; /* !< \brief Nested level of the FFD box. */
63-
64- vector<su2double> CartesianCoord[3 ]; /* !< \brief Vector with all the cartesian coordinates in the FFD FFDBox. */
65- vector<su2double> ParametricCoord[3 ]; /* !< \brief Vector with all the parametrics coordinates in the FFD FFDBox. */
66- vector<unsigned short > MarkerIndex; /* !< \brief Vector with all markers in the FFD FFDBox. */
67- vector<unsigned long > VertexIndex; /* !< \brief Vector with all vertex index in the FFD FFDBox. */
68- vector<unsigned long > PointIndex; /* !< \brief Vector with all points index in the FFD FFDBox. */
69- unsigned long nSurfacePoint; /* !< \brief Number of surfaces in the FFD FFDBox. */
70- vector<string> ParentFFDBox; /* !< \brief Vector with all the parent FFD FFDBox. */
71- vector<string> ChildFFDBox; /* !< \brief Vector with all the child FFD FFDBox. */
59+ su2double MaxCoord[3 ]; /* !< \brief Maximum coordinates of the FFDBox. */
60+ su2double MinCoord[3 ]; /* !< \brief Minimum coordinates of the FFDBox. */
61+ string Tag; /* !< \brief Tag to identify the FFDBox. */
62+ unsigned short Level; /* !< \brief Nested level of the FFD box. */
63+
64+ vector<su2double> CartesianCoord[3 ]; /* !< \brief Vector with all the cartesian coordinates in the FFD FFDBox. */
65+ vector<su2double> ParametricCoord[3 ]; /* !< \brief Vector with all the parametrics coordinates in the FFD FFDBox. */
66+ vector<unsigned short > MarkerIndex; /* !< \brief Vector with all markers in the FFD FFDBox. */
67+ vector<unsigned long > VertexIndex; /* !< \brief Vector with all vertex index in the FFD FFDBox. */
68+ vector<unsigned long > PointIndex; /* !< \brief Vector with all points index in the FFD FFDBox. */
69+ unsigned long nSurfacePoint; /* !< \brief Number of surfaces in the FFD FFDBox. */
70+ vector<string> ParentFFDBox; /* !< \brief Vector with all the parent FFD FFDBox. */
71+ vector<string> ChildFFDBox; /* !< \brief Vector with all the child FFD FFDBox. */
7272 vector<unsigned short > Fix_IPlane; /* !< \brief Fix FFD I plane. */
7373 vector<unsigned short > Fix_JPlane; /* !< \brief Fix FFD J plane. */
7474 vector<unsigned short > Fix_KPlane; /* !< \brief Fix FFD K plane. */
@@ -173,8 +173,8 @@ class CFreeFormDefBox : public CGridMovement {
173173 * \param[in] val_coord - New coordinate inside the FFD box.
174174 */
175175 inline void Set_CartesianCoord (su2double *val_coord) { CartesianCoord[0 ].push_back (val_coord[0 ]);
176- CartesianCoord[1 ].push_back (val_coord[1 ]);
177- CartesianCoord[2 ].push_back (val_coord[2 ]); }
176+ CartesianCoord[1 ].push_back (val_coord[1 ]);
177+ CartesianCoord[2 ].push_back (val_coord[2 ]); }
178178
179179
180180 /* !
@@ -183,17 +183,17 @@ class CFreeFormDefBox : public CGridMovement {
183183 * \param[in] val_iSurfacePoints - Surface points of FFD box.
184184 */
185185 inline void Set_CartesianCoord (const su2double *val_coord, unsigned long val_iSurfacePoints) { CartesianCoord[0 ][val_iSurfacePoints] = val_coord[0 ];
186- CartesianCoord[1 ][val_iSurfacePoints] = val_coord[1 ];
187- CartesianCoord[2 ][val_iSurfacePoints] = val_coord[2 ]; }
186+ CartesianCoord[1 ][val_iSurfacePoints] = val_coord[1 ];
187+ CartesianCoord[2 ][val_iSurfacePoints] = val_coord[2 ]; }
188188
189189
190190 /* !
191191 * \brief Add to the vector of parametric coordinates a new coordinate.
192192 * \param[in] val_coord - New coordinate inside the FFD box.
193193 */
194194 inline void Set_ParametricCoord (su2double *val_coord) { ParametricCoord[0 ].push_back (val_coord[0 ]);
195- ParametricCoord[1 ].push_back (val_coord[1 ]);
196- ParametricCoord[2 ].push_back (val_coord[2 ]); }
195+ ParametricCoord[1 ].push_back (val_coord[1 ]);
196+ ParametricCoord[2 ].push_back (val_coord[2 ]); }
197197
198198
199199 /* !
@@ -214,8 +214,8 @@ class CFreeFormDefBox : public CGridMovement {
214214 * \param[in] val_iSurfacePoints - Surface points of FFD box.
215215 */
216216 inline void Set_ParametricCoord (const su2double *val_coord, unsigned long val_iSurfacePoints) { ParametricCoord[0 ][val_iSurfacePoints] = val_coord[0 ];
217- ParametricCoord[1 ][val_iSurfacePoints] = val_coord[1 ];
218- ParametricCoord[2 ][val_iSurfacePoints] = val_coord[2 ]; }
217+ ParametricCoord[1 ][val_iSurfacePoints] = val_coord[1 ];
218+ ParametricCoord[2 ][val_iSurfacePoints] = val_coord[2 ]; }
219219
220220
221221 /* !
@@ -241,22 +241,22 @@ class CFreeFormDefBox : public CGridMovement {
241241 * \param[in] Get_VertexIndex - Surface points of FFD box.
242242 */
243243 inline su2double *Get_CartesianCoord (unsigned long val_iSurfacePoints) {
244- cart_coord_[0 ] = CartesianCoord[0 ][val_iSurfacePoints];
245- cart_coord_[1 ] = CartesianCoord[1 ][val_iSurfacePoints];
246- cart_coord_[2 ] = CartesianCoord[2 ][val_iSurfacePoints];
247- return cart_coord_; }
248-
244+ cart_coord_[0 ] = CartesianCoord[0 ][val_iSurfacePoints];
245+ cart_coord_[1 ] = CartesianCoord[1 ][val_iSurfacePoints];
246+ cart_coord_[2 ] = CartesianCoord[2 ][val_iSurfacePoints];
247+ return cart_coord_;
248+ }
249249
250250 /* !
251251 * \brief Get parametric coordinates.
252252 * \param[in] Get_VertexIndex - Surface points of FFD box.
253253 */
254254 inline su2double *Get_ParametricCoord (unsigned long val_iSurfacePoints) {
255- ParamCoord_[0 ] = ParametricCoord[0 ][val_iSurfacePoints];
256- ParamCoord_[1 ] = ParametricCoord[1 ][val_iSurfacePoints];
257- ParamCoord_[2 ] = ParametricCoord[2 ][val_iSurfacePoints];
258- return ParamCoord_; }
259-
255+ ParamCoord_[0 ] = ParametricCoord[0 ][val_iSurfacePoints];
256+ ParamCoord_[1 ] = ParametricCoord[1 ][val_iSurfacePoints];
257+ ParamCoord_[2 ] = ParametricCoord[2 ][val_iSurfacePoints];
258+ return ParamCoord_;
259+ }
260260
261261 /* !
262262 * \brief Get number of surface points.
@@ -333,8 +333,8 @@ class CFreeFormDefBox : public CGridMovement {
333333 * \param[in] val_icornerpoints - Index of the corner point.
334334 */
335335 inline void SetCoordCornerPoints (const su2double *val_coord, unsigned short val_icornerpoints) {
336- for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
337- Coord_Corner_Points[val_icornerpoints][iDim] = val_coord[iDim];
336+ for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
337+ Coord_Corner_Points[val_icornerpoints][iDim] = val_coord[iDim];
338338 }
339339
340340
@@ -346,9 +346,9 @@ class CFreeFormDefBox : public CGridMovement {
346346 * \param[in] val_icornerpoints - Index of the corner point.
347347 */
348348 inline void SetCoordCornerPoints (su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, unsigned short val_icornerpoints) {
349- Coord_Corner_Points[val_icornerpoints][0 ] = val_xcoord;
350- Coord_Corner_Points[val_icornerpoints][1 ] = val_ycoord;
351- Coord_Corner_Points[val_icornerpoints][2 ] = val_zcoord;
349+ Coord_Corner_Points[val_icornerpoints][0 ] = val_xcoord;
350+ Coord_Corner_Points[val_icornerpoints][1 ] = val_ycoord;
351+ Coord_Corner_Points[val_icornerpoints][2 ] = val_zcoord;
352352 }
353353
354354
@@ -360,9 +360,9 @@ class CFreeFormDefBox : public CGridMovement {
360360 * \param[in] kDegree - Index of the FFDBox, k direction.
361361 */
362362 inline void SetCoordControlPoints (const su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree ) {
363- for (unsigned short iDim = 0 ; iDim < nDim; iDim++) {
364- Coord_Control_Points[iDegree][jDegree][kDegree ][iDim] = val_coord[iDim];
365- }
363+ for (unsigned short iDim = 0 ; iDim < nDim; iDim++) {
364+ Coord_Control_Points[iDegree][jDegree][kDegree ][iDim] = val_coord[iDim];
365+ }
366366 }
367367
368368
@@ -374,11 +374,10 @@ class CFreeFormDefBox : public CGridMovement {
374374 * \param[in] kDegree - Index of the FFDBox, k direction.
375375 */
376376 inline void SetCoordControlPoints_Copy (const su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree ) {
377- for (unsigned short iDim = 0 ; iDim < nDim; iDim++) {
378- Coord_Control_Points_Copy[iDegree][jDegree][kDegree ][iDim] = val_coord[iDim];
379- }
377+ for (unsigned short iDim = 0 ; iDim < nDim; iDim++) {
378+ Coord_Control_Points_Copy[iDegree][jDegree][kDegree ][iDim] = val_coord[iDim];
379+ }
380380 }
381-
382381
383382 /* !
384383 * \brief Set the coordinates of the control points.
@@ -388,10 +387,9 @@ class CFreeFormDefBox : public CGridMovement {
388387 * \param[in] kDegree - Index of the FFDBox, k direction.
389388 */
390389 inline void SetParCoordControlPoints (const su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree ) {
391- for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
392- ParCoord_Control_Points[iDegree][jDegree][kDegree ][iDim] = val_coord[iDim];
390+ for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
391+ ParCoord_Control_Points[iDegree][jDegree][kDegree ][iDim] = val_coord[iDim];
393392 }
394-
395393
396394 /* !
397395 * \brief Get the coordinates of the corner points.
@@ -443,26 +441,24 @@ class CFreeFormDefBox : public CGridMovement {
443441 * \param[in] movement - Movement of the control point.
444442 */
445443 inline void SetControlPoints (const unsigned short *val_index, const su2double *movement) {
446- for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
447- Coord_Control_Points[val_index[0 ]][val_index[1 ]][val_index[2 ]][iDim] += movement[iDim];
444+ for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
445+ Coord_Control_Points[val_index[0 ]][val_index[1 ]][val_index[2 ]][iDim] += movement[iDim];
448446 }
449-
450447
451448 /* !
452449 * \brief Set the original value of the control points.
453450 */
454451 inline void SetOriginalControlPoints () {
455- for (unsigned short iDegree = 0 ; iDegree <= lDegree_Copy; iDegree++)
456- for (unsigned short jDegree = 0 ; jDegree <= mDegree_Copy ; jDegree++)
457- for (unsigned short kDegree = 0 ; kDegree <= nDegree_Copy; kDegree ++)
458- for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
459- Coord_Control_Points[iDegree][jDegree][kDegree ][iDim] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree ][iDim];
452+ for (unsigned short iDegree = 0 ; iDegree <= lDegree_Copy; iDegree++)
453+ for (unsigned short jDegree = 0 ; jDegree <= mDegree_Copy ; jDegree++)
454+ for (unsigned short kDegree = 0 ; kDegree <= nDegree_Copy; kDegree ++)
455+ for (unsigned short iDim = 0 ; iDim < nDim; iDim++)
456+ Coord_Control_Points[iDegree][jDegree][kDegree ][iDim] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree ][iDim];
460457
461458 lDegree = lDegree_Copy; mDegree = mDegree_Copy ; nDegree = nDegree_Copy;
462459 lOrder = lOrder_Copy; mOrder = mOrder_Copy ; nOrder = nOrder_Copy;
463460 nControlPoints = nControlPoints_Copy;
464461 }
465-
466462
467463 /* !
468464 * \brief Set the tecplot file of the FFD chuck structure.
@@ -485,7 +481,6 @@ class CFreeFormDefBox : public CGridMovement {
485481 */
486482 void SetCGNS (CGeometry *geometry, unsigned short iFFDBox, bool original);
487483
488-
489484 /* !
490485 * \brief Set Cylindrical to Cartesians_ControlPoints.
491486 * \param[in] config - Definition of the particular problem.
@@ -767,8 +762,7 @@ class CFreeFormDefBox : public CGridMovement {
767762 * \result Determinant of the matrix
768763 */
769764 inline su2double Determinant_3x3 (su2double A00, su2double A01, su2double A02, su2double A10, su2double A11, su2double A12, su2double A20, su2double A21, su2double A22) {
770- return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
765+ return A00*(A11*A22-A12*A21) - A01*(A10*A22-A12*A20) + A02*(A10*A21-A11*A20);
771766 }
772-
773-
767+
774768};
0 commit comments