Skip to content

Commit

Permalink
Merge branch 'develop' into fix_lookup_table_scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
EvertBunschoten authored Feb 23, 2024
2 parents 7ae56d2 + e261bb6 commit 8e89840
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SU2_CFD/include/variables/CMeshBoundVariable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,22 @@ class CMeshBoundVariable final : public CMeshVariable {
}

/*!
* \brief Get whether a node is on the boundary
* \brief Get whether a node is on the boundary.
*/
inline bool Get_isVertex(unsigned long iPoint) const override {
return VertexMap.GetIsVertex(iPoint);
}

/*!
* \brief Set whether a node is on the boundary
* \brief Set whether a node is on the boundary.
*/
inline void Set_isVertex(unsigned long iPoint, bool isVertex) override {
VertexMap.SetIsVertex(iPoint,isVertex);
}

/*!
* \brief Get the vertex map used by this class.
*/
inline const CVertexMap<unsigned>& GetVertexMap() const { return VertexMap; }

};
50 changes: 50 additions & 0 deletions SU2_CFD/src/solvers/CMeshSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,12 @@ void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigne
unsigned long iPoint, iVertex;
string Marker_Tag, Moving_Tag;

/*--- Keep track of points that have been moved to avoid double
* deformation on points that appear on multiple markers. ---*/

const auto& VertexMap = static_cast<const CMeshBoundVariable*>(nodes)->GetVertexMap();
std::vector<uint8_t> iPointMoved(VertexMap.GetnVertex(), false);

/*--- Retrieve values from the config file ---*/

deltaT = config->GetDelta_UnstTimeND();
Expand Down Expand Up @@ -1054,6 +1060,13 @@ void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigne
* motions that may be applied, e.g. plunging. ---*/

iPoint = geometry->vertex[iMarker][iVertex]->GetNode();

/*--- Avoid moving points twice. ---*/
auto vertexIndex = iPoint;
VertexMap.GetVertexIndex(vertexIndex);
if (iPointMoved[vertexIndex]) continue;
iPointMoved[vertexIndex] = true;

su2double Coord[3] = {0.0};
for (iDim = 0; iDim < nDim; ++iDim) {
Coord[iDim] = nodes->GetMesh_Coord(iPoint, iDim) + nodes->GetBound_Disp(iPoint, iDim);
Expand Down Expand Up @@ -1097,6 +1110,12 @@ void CMeshSolver::Surface_Rotating(CGeometry *geometry, CConfig *config, unsigne
unsigned long iPoint, iVertex;
string Marker_Tag, Moving_Tag;

/*--- Keep track of points that have been moved to avoid double
* deformation on points that appear on multiple markers. ---*/

const auto& VertexMap = static_cast<const CMeshBoundVariable*>(nodes)->GetVertexMap();
std::vector<uint8_t> iPointMoved(VertexMap.GetnVertex(), false);

/*--- Retrieve values from the config file ---*/

deltaT = config->GetDelta_UnstTimeND();
Expand Down Expand Up @@ -1163,6 +1182,13 @@ void CMeshSolver::Surface_Rotating(CGeometry *geometry, CConfig *config, unsigne
* motions that may be applied, e.g. plunging. ---*/

iPoint = geometry->vertex[iMarker][iVertex]->GetNode();

/*--- Avoid moving points twice. ---*/
auto vertexIndex = iPoint;
VertexMap.GetVertexIndex(vertexIndex);
if (iPointMoved[vertexIndex]) continue;
iPointMoved[vertexIndex] = true;

su2double Coord[3] = {0.0};
for (iDim = 0; iDim < nDim; ++iDim) {
Coord[iDim] = nodes->GetMesh_Coord(iPoint, iDim) + nodes->GetBound_Disp(iPoint, iDim);
Expand Down Expand Up @@ -1264,6 +1290,12 @@ void CMeshSolver::Surface_Plunging(CGeometry *geometry, CConfig *config, unsigne
string Marker_Tag, Moving_Tag;
unsigned short iDim;

/*--- Keep track of points that have been moved to avoid double
* deformation on points that appear on multiple markers. ---*/

const auto& VertexMap = static_cast<const CMeshBoundVariable*>(nodes)->GetVertexMap();
std::vector<uint8_t> iPointMoved(VertexMap.GetnVertex(), false);

/*--- Retrieve values from the config file ---*/

deltaT = config->GetDelta_UnstTimeND();
Expand Down Expand Up @@ -1327,6 +1359,12 @@ void CMeshSolver::Surface_Plunging(CGeometry *geometry, CConfig *config, unsigne

iPoint = geometry->vertex[iMarker][iVertex]->GetNode();

/*--- Avoid moving points twice. ---*/
auto vertexIndex = iPoint;
VertexMap.GetVertexIndex(vertexIndex);
if (iPointMoved[vertexIndex]) continue;
iPointMoved[vertexIndex] = true;

for (iDim = 0; iDim < nDim; iDim++)
VarCoordAbs[iDim] = nodes->GetBound_Disp(iPoint, iDim) + VarCoord[iDim];

Expand Down Expand Up @@ -1379,6 +1417,12 @@ void CMeshSolver::Surface_Translating(CGeometry *geometry, CConfig *config, unsi
string Marker_Tag, Moving_Tag;
unsigned short iDim;

/*--- Keep track of points that have been moved to avoid double
* deformation on points that appear on multiple markers. ---*/

const auto& VertexMap = static_cast<const CMeshBoundVariable*>(nodes)->GetVertexMap();
std::vector<uint8_t> iPointMoved(VertexMap.GetnVertex(), false);

/*--- Retrieve values from the config file ---*/

deltaT = config->GetDelta_UnstTimeND();
Expand Down Expand Up @@ -1437,6 +1481,12 @@ void CMeshSolver::Surface_Translating(CGeometry *geometry, CConfig *config, unsi

iPoint = geometry->vertex[iMarker][iVertex]->GetNode();

/*--- Avoid moving points twice. ---*/
auto vertexIndex = iPoint;
VertexMap.GetVertexIndex(vertexIndex);
if (iPointMoved[vertexIndex]) continue;
iPointMoved[vertexIndex] = true;

for (iDim = 0; iDim < nDim; iDim++)
VarCoordAbs[iDim] = nodes->GetBound_Disp(iPoint, iDim) + VarCoord[iDim];

Expand Down

0 comments on commit 8e89840

Please sign in to comment.