Skip to content

Commit d138d8c

Browse files
committed
Apply changes from code review.
1 parent 654b531 commit d138d8c

17 files changed

Lines changed: 147 additions & 121 deletions

File tree

Common/src/geometry/elements/CLINE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
12-
* Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md)
12+
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
1313
*
1414
* SU2 is free software; you can redistribute it and/or
1515
* modify it under the terms of the GNU Lesser General Public

Common/src/geometry/elements/CPYRAM6.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
12-
* Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md)
12+
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
1313
*
1414
* SU2 is free software; you can redistribute it and/or
1515
* modify it under the terms of the GNU Lesser General Public

Common/src/geometry/elements/CTETRA4.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
12-
* Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md)
12+
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
1313
*
1414
* SU2 is free software; you can redistribute it and/or
1515
* modify it under the terms of the GNU Lesser General Public

Common/src/geometry/elements/CTRIA3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
12-
* Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md)
12+
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
1313
*
1414
* SU2 is free software; you can redistribute it and/or
1515
* modify it under the terms of the GNU Lesser General Public

Common/src/grid_movement/CVolumetricMovement.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,7 +1761,7 @@ void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConf
17611761
}
17621762
} else if ((Kind_SU2 == SU2_COMPONENT::SU2_DOT) && !ForwardProjectionDerivative) {
17631763
// need to reset here, since we read out the whole vector, but are only interested in boundary derivatives.
1764-
if (config->GetSmoothGradient() && !ForwardProjectionDerivative) {
1764+
if (config->GetSmoothGradient()) {
17651765
for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) {
17661766
for (iDim = 0; iDim < nDim; iDim++) {
17671767
total_index = iPoint*nDim + iDim;

SU2_CFD/include/integration/CIntegrationFactory.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
12-
* Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md)
12+
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
1313
*
1414
* SU2 is free software; you can redistribute it and/or
1515
* modify it under the terms of the GNU Lesser General Public

SU2_CFD/include/numerics/CGradSmoothing.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
12-
* Copyright 2012-2019, SU2 Contributors (cf. AUTHORS.md)
12+
* Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md)
1313
*
1414
* SU2 is free software; you can redistribute it and/or
1515
* modify it under the terms of the GNU Lesser General Public
@@ -36,7 +36,7 @@
3636
* \ingroup Grad_Smooth
3737
* \author T. Dick
3838
*/
39-
class CGradSmoothing : public CNumerics {
39+
class CGradSmoothing final : public CNumerics {
4040
su2activematrix val_DHiDHj;
4141
su2activevector Ni_Vec;
4242

@@ -55,10 +55,10 @@ class CGradSmoothing : public CNumerics {
5555
CGradSmoothing(unsigned short val_nDim, const CConfig* config);
5656

5757
/*!
58-
* \brief Destructor of the class.
58+
* \brief Build the tangent stiffness matrix of an element.
59+
* \param[in,out] element_container - Element whose tangent matrix is being built.
60+
* \param[in] config - Definition of the problem.
5961
*/
60-
~CGradSmoothing();
61-
62-
void Compute_Tangent_Matrix(CElement *element_container, const CConfig *config);
62+
void Compute_Tangent_Matrix(CElement *element_container, const CConfig *config) override;
6363

6464
};

SU2_CFD/include/solvers/CFEASolverBase.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#pragma once
2929

30+
#include <unordered_set>
31+
3032
#include "CSolver.hpp"
3133
#include "../../../Common/include/geometry/elements/CElement.hpp"
3234
#include "../../../Common/include/parallelization/omp_structure.hpp"

SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,23 +35,21 @@
3535
/*! \class CGradientSmoothingSolver
3636
* \brief Main class for defining a gradient smoothing.
3737
* \author T. Dick.
38-
* \date March 25, 2019.
3938
*/
4039
class CGradientSmoothingSolver final : public CFEASolverBase {
4140
public:
4241

4342
/** Introduction of a new alias for the data type to allow compilation with forward mode.
4443
*
4544
* This is done for compatibility to the treatment of Jacobian and System in CSolver.hpp.
46-
* Note that the computations done here are always 'passive', i.e. not intended to be differentiated. We only need to
47-
* define functions depending on this once.
45+
* Note that the computations done here are always 'passive', i.e. not intended to be differentiated.
46+
* We only need to define functions depending on this once.
4847
*/
4948
#ifndef CODI_FORWARD_TYPE
5049
typedef su2mixedfloat su2matvecscalar;
5150
#else
5251
typedef su2double su2matvecscalar;
5352
#endif
54-
using MatrixType = C2DContainer<unsigned long, su2double, StorageType::RowMajor, 64, DynamicSize, DynamicSize>;
5553

5654
private:
5755
unsigned int curDim; /*!< \brief If we separate dimensions this tells us in what dimension we currently are. */
@@ -112,6 +110,7 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
112110
CConfig *config,
113111
su2double** Gradient) override;
114112

113+
private:
115114

116115
/*!
117116
* \brief Assemble the stiffness matrix
@@ -179,11 +178,6 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
179178
CConfig *config,
180179
su2double** Gradient) override;
181180

182-
/*!
183-
* \brief Return current parameter gradient.
184-
*/
185-
inline const vector<su2double>& GetDeltaP() const { return deltaP; }
186-
187181
/*!
188182
* \brief write the DV gradient into a file
189183
*/
@@ -231,22 +225,11 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
231225
*/
232226
void ReadSensFromGeometry(const CGeometry *geometry) override;
233227

234-
private:
235228
/*!
236229
* \brief Write the solution of the linear solver into the sensitivities of the nodes
237230
*/
238231
void WriteSensitivity(CGeometry* geometry, const CConfig* config);
239232

240-
/*!
241-
* \brief Copy sensitivities from a vector into the geometry
242-
*/
243-
void WriteVectorToGeometry(CGeometry* geometry, const CSysVector<su2matvecscalar>& vector) const;
244-
245-
/*!
246-
* \brief Copy sensitivities from the geometry into a vector
247-
*/
248-
void ReadVectorToGeometry(const CGeometry* geometry, CSysVector<su2matvecscalar>& vector);
249-
250233
/*!
251234
* \brief Get the value of the reference coordinate to set on the element structure.
252235
* \param[in] geometry - Geometrical definition of the problem.
@@ -301,7 +284,7 @@ class CGradientSmoothingSolver final : public CFEASolverBase {
301284
/*!
302285
* \brief Return the current working dimension.
303286
*/
304-
inline const unsigned int& GetCurrentDim() const {
287+
inline unsigned int GetCurrentDim() const {
305288
return curDim;
306289
}
307290

SU2_CFD/include/solvers/CSolver.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838
#include <set>
3939
#include <stdlib.h>
4040
#include <stdio.h>
41-
#include <unordered_set>
42-
#include <unordered_map>
4341

4442
#include "../fluid/CFluidModel.hpp"
4543
#include "../task_definition.hpp"

0 commit comments

Comments
 (0)