Skip to content

Commit d576687

Browse files
committed
Fixed comments after initial pull request
1 parent c419e2a commit d576687

7 files changed

Lines changed: 270 additions & 371 deletions

File tree

Common/include/CConfig.hpp

Lines changed: 22 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,14 @@ class CConfig {
108108
unsigned short FFD_Blending; /*!< \brief Kind of FFD Blending function. */
109109
su2double* FFD_BSpline_Order; /*!< \brief BSpline order in i,j,k direction. */
110110
su2double FFD_Tol; /*!< \brief Tolerance in the point inversion problem. */
111-
bool FFD_IntPrev; /*!< \brief Enables self-intersection prevention procedure within the FFD box. */
112-
unsigned short FFD_IntPrev_Iter; /*!< \brief Amount of iterations for FFD box self-intersection prevention procedure. */
113-
unsigned short FFD_IntPrev_Depth; /*!< \brief Maximum recursion depth for FFD box self-intersection procedure. */
114-
bool ConvexityCheck; /*!< \brief Enables convexity check on all mesh elements. */
115-
unsigned short ConvexityCheck_Iter; /*!< \brief Amount of iterations for convexity check in deformations. */
116-
unsigned short ConvexityCheck_Depth; /*!< \brief Maximum recursion depth for convexity check in deformations.*/
117-
su2double** TotalDeformation; /*!< \brief Total deformation of the design variables. */
118-
su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */
119-
su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */
111+
bool FFD_IntPrev; /*!< \brief Enables self-intersection prevention procedure within the FFD box. */
112+
unsigned short FFD_IntPrev_MaxIter; /*!< \brief Amount of iterations for FFD box self-intersection prevention procedure. */
113+
unsigned short FFD_IntPrev_MaxDepth; /*!< \brief Maximum recursion depth for FFD box self-intersection procedure. */
114+
bool ConvexityCheck; /*!< \brief Enables convexity check on all mesh elements. */
115+
unsigned short ConvexityCheck_MaxIter; /*!< \brief Amount of iterations for convexity check in deformations. */
116+
unsigned short ConvexityCheck_MaxDepth; /*!< \brief Maximum recursion depth for convexity check in deformations.*/
117+
su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */
118+
su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */
120119
su2double StartTime;
121120
bool ContinuousAdjoint, /*!< \brief Flag to know if the code is solving an adjoint problem. */
122121
Viscous, /*!< \brief Flag to know if the code is solving a viscous problem. */
@@ -8179,70 +8178,25 @@ class CConfig {
81798178
su2double GetFFD_Tol(void) const { return FFD_Tol; }
81808179

81818180
/*!
8182-
* \brief Get information about whether to do a check on self-intersections within the FFD box based on value of the Jacobian determinant.
8183-
* \return <code>TRUE</code> if FFD intersection prevention is active; otherwise <code>FALSE</code>.
8181+
* \brief Get information about whether to do a check on self-intersections within
8182+
the FFD box based on value on the Jacobian determinant.
8183+
* \param[out] FFD_IntPrev: <code>TRUE</code> if FFD intersection prevention is active; otherwise <code>FALSE</code>.
8184+
* \param[out] FFD_IntPrev_MaxIter: Maximum number of iterations in the intersection prevention procedure.
8185+
* \param[out] FFD_IntPrev_MaxDepth: Maximum recursion depth in the intersection prevention procedure.
81848186
*/
8185-
bool GetFFD_IntPrev(void) const { return FFD_IntPrev; }
8186-
8187-
/*!
8188-
* \brief Get the maximum number of iterations in the recursive convexity check procedure in deformation.
8189-
* \return Maximum number of iterations.
8190-
*/
8191-
unsigned short GetFFD_IntPrev_Iter(void) const { return FFD_IntPrev_Iter; }
8192-
8193-
/*!
8194-
* \brief Get the maximum recursion depth in the recursive convexity check procedure in deformation.
8195-
* \return Maximum recursion depth.
8196-
*/
8197-
unsigned short GetFFD_IntPrev_Depth(void) const { return FFD_IntPrev_Depth; }
8187+
tuple<bool, unsigned short, unsigned short> GetFFD_IntPrev(void) {
8188+
return make_tuple(FFD_IntPrev, FFD_IntPrev_MaxIter, FFD_IntPrev_MaxDepth);
8189+
}
81988190

81998191
/*!
82008192
* \brief Get information about whether to do a check on convexity of the mesh elements.
8201-
* \return <code>TRUE</code> if convexity check is active; otherwise <code>FALSE</code>.
8202-
*/
8203-
bool GetConvexity_Check(void) const { return ConvexityCheck; }
8204-
8205-
/*!
8206-
* \brief Get the maximum number of iterations in the recursive convexity check procedure in deformation.
8207-
* \return Maximum number of iterations.
8208-
*/
8209-
unsigned short GetConvexityCheck_Iter(void) const { return ConvexityCheck_Iter; }
8210-
8211-
/*!
8212-
* \brief Get the maximum recursion depth in the recursive convexity check procedure in deformation.
8213-
* \return Maximum recursion depth.
8193+
* \param[out] ConvexityCheck: <code>TRUE</code> if convexity check is active; otherwise <code>FALSE</code>.
8194+
* \param[out] ConvexityCheck_MaxIter: Maximum number of iterations in the convexity check.
8195+
* \param[out] ConvexityCheck_MaxDepth: Maximum recursion depth in the convexity check.
82148196
*/
8215-
unsigned short GetConvexityCheck_Depth(void) const { return ConvexityCheck_Depth; }
8216-
8217-
/*!
8218-
* \brief Set the initial values for the total deformation of the design variables.
8219-
* \param[in] totalDef - total deformation of all design variables
8220-
*/
8221-
void Initialize_TotalDeformation(su2double** totalDef) { TotalDeformation = totalDef; }
8222-
8223-
/*!
8224-
* \brief Set the total deformation value of each design variable.
8225-
* \param[in] val_dv - design variable
8226-
* \param[in] val_ind - index of design variable
8227-
* \param[in] val - value of deformation magnitude
8228-
*/
8229-
void SetTotalDeformation(unsigned short val_dv, unsigned short val_ind, su2double val) {TotalDeformation[val_dv][val_ind] = val; }
8230-
8231-
/*!
8232-
* \brief Add a value to the total deformation value of each design variable.
8233-
* \param[in] val_dv - design variable
8234-
* \param[in] val_ind - index of design variable
8235-
* \param[in] val - value of deformation magnitude that is added
8236-
*/
8237-
void AddTotalDeformation(unsigned short val_dv, unsigned short val_ind, su2double val) {TotalDeformation[val_dv][val_ind] += val; }
8238-
8239-
/*!
8240-
* \brief Get information about the total deformation of the design variables.
8241-
* \param[in] val_dv - design variable number
8242-
* \param[in] val_val - design variable number
8243-
* \return Value of total deformation for one design variable.
8244-
*/
8245-
su2double GetTotalDeformation(unsigned short val_dv, unsigned short val_val = 0) const { return TotalDeformation[val_dv][val_val]; }
8197+
tuple<bool, unsigned short, unsigned short> GetConvexityCheck(void) {
8198+
return make_tuple(ConvexityCheck, ConvexityCheck_MaxIter, ConvexityCheck_MaxDepth);
8199+
}
82468200

82478201
/*!
82488202
* \brief Get the scale factor for the line search.

Common/include/grid_movement/CSurfaceMovement.hpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ class CSurfaceMovement : public CGridMovement {
211211
* \param[in] geometry - Geometrical definition of the problem.
212212
* \param[in] config - Definition of the particular problem.
213213
*/
214-
void SetSurface_Deformation(CGeometry *geometry, CConfig *config) override;
214+
void SetSurface_Deformation(CGeometry *geometry, CConfig *config, su2double** totaldeformation = nullptr);
215215

216216
/*!
217217
* \brief Compute the parametric coordinates of a grid point using a point inversion strategy
@@ -268,6 +268,15 @@ class CSurfaceMovement : public CGridMovement {
268268
*/
269269
void GetCartesianCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild);
270270

271+
/*!
272+
* \brief Apply the design variables to the control point position
273+
* \param[in] geometry - Geometrical definition of the problem.
274+
* \param[in] config - Definition of the particular problem.
275+
* \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation.
276+
* \param[in] iFFDBox - Index of FFD box.
277+
*/
278+
void ApplyDesignVariables(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, unsigned short iFFDBox);
279+
271280
/*!
272281
* \brief Recompute the cartesian coordinates using the control points position.
273282
* \param[in] geometry - Geometrical definition of the problem.
@@ -485,15 +494,6 @@ class CSurfaceMovement : public CGridMovement {
485494
*/
486495
void SetSurface_Derivative(CGeometry *geometry, CConfig *config);
487496

488-
/*!
489-
* \brief Set magnitude of the deformation of all design variables
490-
* \param[in] geometry - Geometrical definition of the problem.
491-
* \param[in] config - Definition of the particular problem.
492-
* \param[in] deformationFactor - Remaining amount of original deformation (between 0 and 1).
493-
* \param[in] totalDeformation_initial - Initial deformation magnitude of all design variables.
494-
*/
495-
void SetDeformationMagnitude(CGeometry *geometry, CConfig *config, su2double deformationFactor, su2double** totalDeformation_initial);
496-
497497
/*!
498498
* \brief Calculate the determinant of the Jacobian matrix for the FFD problem.
499499
* \param[in] geometry - Geometrical definition of the problem.

Common/src/CConfig.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,19 +2607,19 @@ void CConfig::SetConfig_Options() {
26072607
addBoolOption("FFD_INTPREV", FFD_IntPrev, NO);
26082608

26092609
/* DESCRIPTION: Number of total iterations in the convexity check procedure */
2610-
addUnsignedShortOption("FFD_INTPREV_ITER", FFD_IntPrev_Iter, 10);
2610+
addUnsignedShortOption("FFD_INTPREV_ITER", FFD_IntPrev_MaxIter, 10);
26112611

26122612
/* DESCRIPTION: Recursion depth in the FFD self-intersection prevention */
2613-
addUnsignedShortOption("FFD_INTPREV_DEPTH", FFD_IntPrev_Depth, 3);
2613+
addUnsignedShortOption("FFD_INTPREV_DEPTH", FFD_IntPrev_MaxDepth, 3);
26142614

26152615
/* DESCRIPTION: Convexity check on all mesh elements */
26162616
addBoolOption("CONVEXITY_CHECK", ConvexityCheck, NO);
26172617

26182618
/* DESCRIPTION: Number of total iterations in the convexity check procedure */
2619-
addUnsignedShortOption("CONVEXITY_CHECK_ITER", ConvexityCheck_Iter, 10);
2619+
addUnsignedShortOption("CONVEXITY_CHECK_ITER", ConvexityCheck_MaxIter, 10);
26202620

26212621
/* DESCRIPTION: Recursion depth in the FFD self-intersection prevention */
2622-
addUnsignedShortOption("CONVEXITY_CHECK_DEPTH", ConvexityCheck_Depth, 3);
2622+
addUnsignedShortOption("CONVEXITY_CHECK_DEPTH", ConvexityCheck_MaxDepth, 3);
26232623

26242624
/* DESCRIPTION: Definition of the FFD boxes */
26252625
addFFDDefOption("FFD_DEFINITION", nFFDBox, CoordFFDBox, TagFFDBox);

0 commit comments

Comments
 (0)