Skip to content

Commit d2791b0

Browse files
author
rois1995
committed
- fixed formatting errors
1 parent bb3b066 commit d2791b0

File tree

3 files changed

+41
-53
lines changed

3 files changed

+41
-53
lines changed

Common/include/geometry/dual_grid/CPoint.hpp

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ class CPoint {
108108
su2vector<unsigned long>
109109
ClosestWall_Elem; /*!< \brief Element index of closest wall element, for givenrank, zone and marker index. */
110110

111-
su2activevector SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */
112-
su2activevector Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */
113-
su2activevector MaxLength; /*!< \brief The maximum cell-center to cell-center length. */
114-
su2activevector RoughnessHeight; /*!< \brief Roughness of the nearest wall. */
115-
su2activematrix Normals; /*!< \brief Normal of the nearest wall element. */
111+
su2activevector SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */
112+
su2activevector Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */
113+
su2activevector MaxLength; /*!< \brief The maximum cell-center to cell-center length. */
114+
su2activevector RoughnessHeight; /*!< \brief Roughness of the nearest wall. */
115+
su2activematrix Normals; /*!< \brief Normal of the nearest wall element. */
116116

117117
su2matrix<int> AD_InputIndex; /*!< \brief Indices of Coord variables in the adjoint vector. */
118118
su2matrix<int>
@@ -489,22 +489,22 @@ class CPoint {
489489
* \brief Get the index of the closest wall element.
490490
* \param[in] iPoint - Index of the point.
491491
* \param[out] ClosestWall_Elem - ID of the closest element on a wall boundary.
492-
*/
493-
inline unsigned long GetClosestWall_Elem(unsigned long iPoint) {return ClosestWall_Elem(iPoint);}
492+
*/
493+
inline unsigned long GetClosestWall_Elem(unsigned long iPoint) { return ClosestWall_Elem(iPoint); }
494494

495495
/*!
496496
* \brief Get the marker of the closest wall marker.
497497
* \param[in] iPoint - Index of the point.
498498
* \param[out] ClosestWall_Marker - MarkerID of the closest wall boundary.
499499
*/
500-
inline unsigned long GetClosestWall_Marker(unsigned long iPoint) {return ClosestWall_Marker(iPoint);}
500+
inline unsigned long GetClosestWall_Marker(unsigned long iPoint) { return ClosestWall_Marker(iPoint); }
501501

502502
/*!
503503
* \brief Get the rank of the closest wall marker.
504504
* \param[in] iPoint - Index of the point.
505505
* \param[out] ClosestWall_Rank - RankID of the closest wall boundary.
506506
*/
507-
inline unsigned long GetClosestWall_Rank(unsigned long iPoint) {return ClosestWall_Rank(iPoint);}
507+
inline unsigned long GetClosestWall_Rank(unsigned long iPoint) { return ClosestWall_Rank(iPoint); }
508508

509509
/*!
510510
* \brief Get the value of the distance to the nearest wall.
@@ -533,18 +533,17 @@ class CPoint {
533533
* \param[in] iPoint - Index of the point.
534534
* \param[in] normal - Value of the normal.
535535
*/
536-
template<typename Normals_type>
537-
inline void SetNormal(unsigned long iPoint, Normals_type const&normal) {
538-
for (unsigned long iDim = 0; iDim < nDim; iDim++)
539-
Normals(iPoint,iDim) = normal[iDim];
536+
template <typename Normals_type>
537+
inline void SetNormal(unsigned long iPoint, Normals_type const& normal) {
538+
for (unsigned long iDim = 0; iDim < nDim; iDim++) Normals(iPoint, iDim) = normal[iDim];
540539
}
541540

542541
/*!
543542
* \brief Set the value of the normal of the nearest wall element.
544543
* \param[in] iPoint - Index of the point.
545544
* \return normal to the normal of the nearest wall element.
546545
*/
547-
inline su2double *GetNormal(unsigned long iPoint) { return Normals[iPoint]; }
546+
inline su2double* GetNormal(unsigned long iPoint) { return Normals[iPoint]; }
548547

549548
/*!
550549
* \brief Set the value of the distance to a sharp edge.
@@ -926,21 +925,18 @@ class CPoint {
926925
}
927926
}
928927

929-
930928
/*!
931929
* \brief Set wall normal according to stored closest wall information.
932930
* \param[in] normals - Mapping [rank][zone][marker][element] -> normal
933931
*/
934-
template<typename Normals_type>
935-
void SetWallNormals(Normals_type const&normals){
936-
for (unsigned long iPoint=0; iPoint<GlobalIndex.size(); ++iPoint) {
932+
template <typename Normals_type>
933+
void SetWallNormals(Normals_type const& normals) {
934+
for (unsigned long iPoint = 0; iPoint < GlobalIndex.size(); ++iPoint) {
937935
auto rankID = ClosestWall_Rank[iPoint];
938936
auto zoneID = ClosestWall_Zone[iPoint];
939937
auto markerID = ClosestWall_Marker[iPoint];
940938
auto elementID = ClosestWall_Elem[iPoint];
941-
if(rankID >= 0)
942-
SetNormal(iPoint, normals[rankID][zoneID][markerID][elementID]);
939+
if (rankID >= 0) SetNormal(iPoint, normals[rankID][zoneID][markerID][elementID]);
943940
}
944941
}
945-
946942
};

Common/src/geometry/CGeometry.cpp

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4030,14 +4030,13 @@ void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeo
40304030
if (!wallDistanceNeeded[ZONE_0] || kindSolver == MAIN_SOLVER::FEM_LES || kindSolver == MAIN_SOLVER::FEM_RANS) {
40314031
continue;
40324032
} else {
4033-
40344033
su2vector<su2vector<su2matrix<su2double>>> WallNormal_container;
40354034
WallNormal_container.resize(nZone) = su2vector<su2matrix<su2double>>();
4036-
for (int iZone = 0; iZone < nZone; iZone++){
4035+
for (int iZone = 0; iZone < nZone; iZone++) {
40374036
const CConfig* config = config_container[iZone];
40384037
const CGeometry* geometry = geometry_container[iZone][iInst][MESH_0];
40394038
WallNormal_container[iZone].resize(geometry->GetnMarker());
4040-
for (auto iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++){
4039+
for (auto iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) {
40414040
if (config->GetViscous_Wall(iMarker)) {
40424041
WallNormal_container[iZone][iMarker].resize(geometry->GetnElem_Bound(iMarker), 3);
40434042

@@ -4053,20 +4052,16 @@ void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeo
40534052
NormalHere[iDim] += geometry->vertex[iMarker][iVertexHere]->GetNormal(iDim);
40544053
}
40554054

4056-
for (auto iDim = 0u; iDim < 3; iDim++)
4057-
NormalHere[iDim] /= geometry->bound[iMarker][iElem]->GetnNodes();
4055+
for (auto iDim = 0u; iDim < 3; iDim++) NormalHere[iDim] /= geometry->bound[iMarker][iElem]->GetnNodes();
40584056

40594057
su2double NormalMag = 0.0;
4060-
for (auto iDim = 0u; iDim < 3; iDim++)
4061-
NormalMag += NormalHere[iDim]*NormalHere[iDim];
4058+
for (auto iDim = 0u; iDim < 3; iDim++) NormalMag += NormalHere[iDim] * NormalHere[iDim];
40624059
NormalMag = sqrt(NormalMag);
40634060

4064-
for (auto iDim = 0u; iDim < 3; iDim++)
4065-
NormalHere[iDim] /= NormalMag;
4061+
for (auto iDim = 0u; iDim < 3; iDim++) NormalHere[iDim] /= NormalMag;
40664062

40674063
for (auto iDim = 0u; iDim < 3; iDim++)
40684064
WallNormal_container[iZone][iMarker](iElem, iDim) = NormalHere[iDim];
4069-
40704065
}
40714066
} else {
40724067
WallNormal_container[iZone][iMarker].resize(1, 3) = su2double(0.0);
@@ -4075,33 +4070,31 @@ void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeo
40754070
}
40764071

40774072
auto normal_i =
4078-
make_pair(nZone, [config_container,geometry_container,iInst,WallNormal_container](unsigned long iZone){
4079-
const CConfig* config = config_container[iZone];
4080-
const CGeometry* geometry = geometry_container[iZone][iInst][MESH_0];
4081-
const auto nMarker = geometry->GetnMarker();
4082-
const auto WallNormal = WallNormal_container[iZone];
4083-
4084-
return make_pair( nMarker, [config,geometry,WallNormal](unsigned long iMarker){
4085-
auto nElem_Bou = geometry->GetnElem_Bound(iMarker);
4086-
if (!config->GetViscous_Wall(iMarker)) nElem_Bou = 1;
4087-
4088-
return make_pair(nElem_Bou, [WallNormal,iMarker](unsigned long iElem){
4089-
const auto dimensions = 3;
4090-
4091-
return make_pair(dimensions, [WallNormal,iMarker,iElem](unsigned short iDim){
4092-
4093-
return WallNormal[iMarker](iElem, iDim);
4073+
make_pair(nZone, [config_container, geometry_container, iInst, WallNormal_container](unsigned long iZone) {
4074+
const CConfig* config = config_container[iZone];
4075+
const CGeometry* geometry = geometry_container[iZone][iInst][MESH_0];
4076+
const auto nMarker = geometry->GetnMarker();
4077+
const auto WallNormal = WallNormal_container[iZone];
4078+
4079+
return make_pair(nMarker, [config, geometry, WallNormal](unsigned long iMarker) {
4080+
auto nElem_Bou = geometry->GetnElem_Bound(iMarker);
4081+
if (!config->GetViscous_Wall(iMarker)) nElem_Bou = 1;
4082+
4083+
return make_pair(nElem_Bou, [WallNormal, iMarker](unsigned long iElem) {
4084+
const auto dimensions = 3;
4085+
4086+
return make_pair(dimensions, [WallNormal, iMarker, iElem](unsigned short iDim) {
4087+
return WallNormal[iMarker](iElem, iDim);
4088+
});
4089+
});
40944090
});
40954091
});
4096-
});
4097-
});
40984092

4099-
NdFlattener<4>Normals_Local(normal_i);
4093+
NdFlattener<4> Normals_Local(normal_i);
41004094
NdFlattener<5> Normals_global(Nd_MPI_Environment(), Normals_Local);
41014095

4102-
41034096
// use it to update roughnesses
4104-
for(int jZone=0; jZone<nZone; jZone++){
4097+
for (int jZone = 0; jZone < nZone; jZone++) {
41054098
geometry_container[jZone][iInst][MESH_0]->nodes->SetWallNormals(Normals_global);
41064099
}
41074100
}

Common/src/geometry/dual_grid/CPoint.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig* config) {
128128
SharpEdge_Distance.resize(npoint) = su2double(0.0);
129129

130130
Normals.resize(npoint, 3) = su2double(0.0);
131-
132131
}
133132

134133
void CPoint::SetElems(const vector<vector<long> >& elemsMatrix) { Elem = CCompressedSparsePatternL(elemsMatrix); }

0 commit comments

Comments
 (0)