@@ -39,20 +39,21 @@ CSurfaceMovement::CSurfaceMovement(void) : CGridMovement() {
3939
4040CSurfaceMovement::~CSurfaceMovement (void ) {}
4141
42- void CSurfaceMovement::SetSurface_Deformation (CGeometry *geometry, CConfig *config,
43- vector<vector<su2double> >& totaldeformation) {
42+ vector<vector<su2double> > CSurfaceMovement::SetSurface_Deformation (CGeometry *geometry, CConfig *config) {
4443
4544 unsigned short iFFDBox, iDV, iLevel, iChild, iParent, jFFDBox, iMarker;
4645 unsigned short Degree_Unitary [] = {1 ,1 ,1 }, BSpline_Unitary [] = {2 ,2 ,2 };
4746 su2double MaxDiff, Current_Scale, Ratio, New_Scale;
4847 string FFDBoxTag;
4948 bool allmoving;
5049
51- bool cylindrical = (config->GetFFD_CoordSystem () == CYLINDRICAL);
52- bool spherical = (config->GetFFD_CoordSystem () == SPHERICAL);
53- bool polar = (config->GetFFD_CoordSystem () == POLAR);
54- bool cartesian = (config->GetFFD_CoordSystem () == CARTESIAN);
55- su2double BoundLimit = config->GetOpt_LineSearch_Bound ();
50+ const bool cylindrical = (config->GetFFD_CoordSystem () == CYLINDRICAL);
51+ const bool spherical = (config->GetFFD_CoordSystem () == SPHERICAL);
52+ const bool polar = (config->GetFFD_CoordSystem () == POLAR);
53+ const bool cartesian = (config->GetFFD_CoordSystem () == CARTESIAN);
54+ const su2double BoundLimit = config->GetOpt_LineSearch_Bound ();
55+
56+ vector<vector<su2double> > totaldeformation;
5657
5758 /* --- Setting the Free Form Deformation ---*/
5859
@@ -323,7 +324,9 @@ void CSurfaceMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *conf
323324 /* --- Set total deformation values in config ---*/
324325 if (config->GetKind_SU2 () == SU2_DEF) {
325326
327+ totaldeformation.resize (config->GetnDV ());
326328 for (iDV = 0 ; iDV < config->GetnDV (); iDV++) {
329+ totaldeformation[iDV].resize (config->GetnDV_Value (iDV));
327330 for (auto iDV_Value = 0u ; iDV_Value < config->GetnDV_Value (iDV); iDV_Value++) {
328331 totaldeformation[iDV][iDV_Value] = config->GetDV_Value (iDV, iDV_Value);
329332 }
@@ -675,6 +678,7 @@ void CSurfaceMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *conf
675678 cout << " Design Variable not implemented yet" << endl;
676679 }
677680
681+ return totaldeformation;
678682}
679683
680684
@@ -705,8 +709,7 @@ void CSurfaceMovement::SetSurface_Derivative(CGeometry *geometry, CConfig *confi
705709
706710 /* --- Run the surface deformation with DV_Value = 0.0 (no deformation at all) ---*/
707711
708- auto dummy = vector<vector<su2double> >();
709- SetSurface_Deformation (geometry, config, dummy);
712+ SetSurface_Deformation (geometry, config);
710713}
711714
712715void CSurfaceMovement::CopyBoundary (CGeometry *geometry, CConfig *config) {
0 commit comments