Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused option SMOOTH_GEOMETRY #2427

Merged
merged 4 commits into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Common/include/CConfig.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class CConfig {
su2double Opt_RelaxFactor; /*!< \brief Scale factor for the line search. */
su2double Opt_LineSearch_Bound; /*!< \brief Bounds for the line search. */
su2double StartTime;
unsigned short SmoothNumGrid; /*!< \brief Smooth the numerical grid. */
bool ContinuousAdjoint, /*!< \brief Flag to know if the code is solving an adjoint problem. */
Viscous, /*!< \brief Flag to know if the code is solving a viscous problem. */
EquivArea, /*!< \brief Flag to know if the code is going to compute and plot the equivalent area. */
Expand Down Expand Up @@ -6338,12 +6337,6 @@ class CConfig {
*/
bool GetAxisymmetric(void) const { return Axisymmetric; }

/*!
* \brief Get information about there is a smoothing of the grid coordinates.
* \return <code>TRUE</code> if there is smoothing of the grid coordinates; otherwise <code>FALSE</code>.
*/
unsigned short GetSmoothNumGrid(void) const { return SmoothNumGrid; }

/*!
* \brief Subtract one to the index of the finest grid (full multigrid strategy).
* \return Change the index of the finest grid.
Expand Down
8 changes: 0 additions & 8 deletions Common/include/geometry/CGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,14 +913,6 @@ class CGeometry {
*/
inline virtual void SetMultiGridWallTemperature(const CGeometry* fine_grid, unsigned short val_marker) {}

/*!
* \brief A virtual member.
* \param[in] val_nSmooth - Number of smoothing iterations.
* \param[in] val_smooth_coeff - Relaxation factor.
* \param[in] config - Definition of the particular problem.
*/
inline virtual void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) {}

/*!
* \brief A virtual member.
* \param[in] fine_grid - Geometrical definition of the child grid (for multigrid).
Expand Down
8 changes: 0 additions & 8 deletions Common/include/geometry/CPhysicalGeometry.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,14 +545,6 @@ class CPhysicalGeometry final : public CGeometry {
void DetermineTimeLevelElements(CConfig* config, const vector<CFaceOfElement>& localFaces,
map<unsigned long, CUnsignedShort2T>& mapExternalElemIDToTimeLevel);

/*!
* \brief Do an implicit smoothing of the grid coordinates.
* \param[in] val_nSmooth - Number of smoothing iterations.
* \param[in] val_smooth_coeff - Relaxation factor.
* \param[in] config - Definition of the particular problem.
*/
void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) override;

/*!
* \brief Compute 3 grid quality metrics: orthogonality angle, dual cell aspect ratio, and dual cell volume ratio.
* \param[in] config - Definition of the particular problem.
Expand Down
25 changes: 2 additions & 23 deletions Common/include/geometry/dual_grid/CPoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,14 +771,14 @@ class CPoint {
}

/*!
* \brief Get the value of the old coordinates for implicit smoothing.
* \brief Get the value of the old coordinates for implicit smoothing. <- Nijso: really?
* \param[in] iPoint - Index of the point.
* \return Old coordinates at a point.
*/
inline su2double* GetCoord_Old(unsigned long iPoint) { return Coord_Old[iPoint]; }
bigfooted marked this conversation as resolved.
Show resolved Hide resolved

/*!
* \brief Set the value of the vector <i>Coord_Old</i> for implicit smoothing.
* \brief Set the value of the vector <i>Coord_Old</i> for implicit smoothing. <- Nijso: really?
* \param[in] iPoint - Index of the point.
* \param[in] coord_old - Value of the coordinates.
*/
Expand All @@ -791,27 +791,6 @@ class CPoint {
*/
void SetCoord_Old();

/*!
* \brief Get the value of the summed coordinates for implicit smoothing.
* \param[in] iPoint - Index of the point.
* \return Sum of coordinates at a point.
*/
inline su2double* GetCoord_Sum(unsigned long iPoint) { return Coord_Sum[iPoint]; }

/*!
* \brief Add the value of the coordinates to the <i>Coord_Sum</i> vector for implicit smoothing.
* \param[in] iPoint - Index of the point.
* \param[in] coord_sum - Value of the coordinates to add.
*/
inline void AddCoord_Sum(unsigned long iPoint, const su2double* coord_sum) {
for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_Sum(iPoint, iDim) += coord_sum[iDim];
}

/*!
* \brief Initialize the vector <i>Coord_Sum</i>.
*/
void SetCoord_SumZero();

/*!
* \brief Get the value of the grid velocity at the point.
* \param[in] iPoint - Index of the point.
Expand Down
5 changes: 0 additions & 5 deletions Common/src/CConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2264,9 +2264,6 @@ void CConfig::SetConfig_Options() {
/* DESCRIPTION: Value to move motion origins (1 or 0) */
addUShortListOption("MOVE_MOTION_ORIGIN", nMoveMotion_Origin, MoveMotion_Origin);

/* DESCRIPTION: Before each computation, implicitly smooth the nodal coordinates */
addUnsignedShortOption("SMOOTH_GEOMETRY", SmoothNumGrid, 0);

/*!\par CONFIG_CATEGORY: Aeroelastic Simulation (Typical Section Model) \ingroup Config*/
/*--- Options related to aeroelastic simulations using the Typical Section Model) ---*/
/* DESCRIPTION: The flutter speed index (modifies the freestream condition) */
Expand Down Expand Up @@ -6877,8 +6874,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) {

cout << endl <<"--------------- Space Numerical Integration ( Zone " << iZone << " ) ------------------" << endl;

if (SmoothNumGrid) cout << "There are some smoothing iterations on the grid coordinates." << endl;

if ((Kind_Solver == MAIN_SOLVER::EULER) || (Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::RANS) ||
(Kind_Solver == MAIN_SOLVER::INC_EULER) || (Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::INC_RANS) ||
(Kind_Solver == MAIN_SOLVER::NEMO_EULER) || (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) ||
Expand Down
64 changes: 0 additions & 64 deletions Common/src/geometry/CPhysicalGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7417,70 +7417,6 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig* config) const {
}
}

void CPhysicalGeometry::SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) {
unsigned short iSmooth, nneigh, iMarker;
su2double *Coord_Old, *Coord_Sum, *Coord, *Coord_i, *Coord_j, Position_Plane = 0.0;
unsigned long iEdge, iPoint, jPoint, iVertex;
su2double eps = 1E-6;
bool NearField = false;

Coord = new su2double[nDim];

nodes->SetCoord_Old();

/*--- Jacobi iterations ---*/
for (iSmooth = 0; iSmooth < val_nSmooth; iSmooth++) {
nodes->SetCoord_SumZero();

/*--- Loop over Interior edges ---*/
for (iEdge = 0; iEdge < nEdge; iEdge++) {
iPoint = edges->GetNode(iEdge, 0);
Coord_i = nodes->GetCoord(iPoint);

jPoint = edges->GetNode(iEdge, 1);
Coord_j = nodes->GetCoord(jPoint);

/*--- Accumulate nearest neighbor Coord to Res_sum for each variable ---*/
nodes->AddCoord_Sum(iPoint, Coord_j);
nodes->AddCoord_Sum(jPoint, Coord_i);
}

/*--- Loop over all mesh points (Update Coords with averaged sum) ---*/
for (iPoint = 0; iPoint < nPoint; iPoint++) {
nneigh = nodes->GetnPoint(iPoint);
Coord_Sum = nodes->GetCoord_Sum(iPoint);
Coord_Old = nodes->GetCoord_Old(iPoint);

if (nDim == 2) {
Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh));
Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh));
if ((NearField) && ((Coord_Old[1] > Position_Plane - eps) && (Coord_Old[1] < Position_Plane + eps)))
Coord[1] = Coord_Old[1];
}

if (nDim == 3) {
Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh));
Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh));
Coord[2] = (Coord_Old[2] + val_smooth_coeff * Coord_Sum[2]) / (1.0 + val_smooth_coeff * su2double(nneigh));
if ((NearField) && ((Coord_Old[2] > Position_Plane - eps) && (Coord_Old[2] < Position_Plane + eps)))
Coord[2] = Coord_Old[2];
}

nodes->SetCoord(iPoint, Coord);
}

/*--- Copy boundary values ---*/
for (iMarker = 0; iMarker < nMarker; iMarker++)
for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) {
iPoint = vertex[iMarker][iVertex]->GetNode();
Coord_Old = nodes->GetCoord_Old(iPoint);
nodes->SetCoord(iPoint, Coord_Old);
}
}

delete[] Coord;
}

bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short& face_first_elem,
unsigned short& face_second_elem) {
if (first_elem == second_elem) return false;
Expand Down
8 changes: 0 additions & 8 deletions Common/src/geometry/dual_grid/CPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig* config) {

Vertex.resize(npoint);

/*--- For smoothing the numerical grid coordinates ---*/
if (config->GetSmoothNumGrid()) {
Coord_Old.resize(npoint, nDim) = su2double(0.0);
Coord_Sum.resize(npoint, nDim) = su2double(0.0);
bigfooted marked this conversation as resolved.
Show resolved Hide resolved
}

/*--- Storage of grid velocities for dynamic meshes. ---*/

if (config->GetDynamic_Grid()) {
Expand Down Expand Up @@ -190,5 +184,3 @@ void CPoint::SetCoord_Old() {
assert(Coord_Old.size() == Coord.size());
parallelCopy(Coord.size(), Coord.data(), Coord_Old.data());
}

void CPoint::SetCoord_SumZero() { parallelSet(Coord_Sum.size(), 0.0, Coord_Sum.data()); }
2 changes: 1 addition & 1 deletion SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr
for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) {
if (dual_time_2nd) {
geometries[iMesh]->nodes->SetCoord_n(iPoint, geometries[iMesh]->nodes->GetCoord_n1(iPoint));
geometries[iMesh]->nodes->SetCoord_n1(iPoint, geometries[iMesh]->nodes->GetCoord_Old(iPoint));
geometries[iMesh]->nodes->SetCoord_n1(iPoint, geometries[iMesh]->nodes->GetCoord_Old(iPoint)); // <- this is not implicit smoothing
} else {
geometries[iMesh]->nodes->SetCoord_n(iPoint, geometries[iMesh]->nodes->GetCoord_Old(iPoint));
}
Expand Down
Loading