Skip to content

Commit 3afaeef

Browse files
committed
fix AD builds
1 parent 9fcdfc1 commit 3afaeef

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

Common/include/toolboxes/geometry_toolbox.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@
3131
namespace GeometryToolbox {
3232

3333
/*! \return ||a-b||^2 */
34-
template<class T, typename Int>
35-
inline T SquaredDistance(Int nDim, const T* a, const T* b) {
34+
template<class T, class U, typename Int>
35+
inline T SquaredDistance(Int nDim, const T* a, const U* b) {
3636
T d(0);
3737
for(Int i = 0; i < nDim; i++) d += pow(a[i]-b[i], 2);
3838
return d;
3939
}
4040

4141
/*! \return ||a-b|| */
42-
template<class T, typename Int>
43-
inline T Distance(Int nDim, const T* a, const T* b) {
42+
template<class T, class U, typename Int>
43+
inline T Distance(Int nDim, const T* a, const U* b) {
4444
return sqrt(SquaredDistance(nDim, a, b));
4545
}
4646

SU2_CFD/src/solvers/CSolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3360,7 +3360,7 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
33603360

33613361
/*--- Get data for this profile. ---*/
33623362

3363-
vector<passivedouble> Inlet_Data = profileReader.GetDataForProfile(jMarker);
3363+
const vector<passivedouble>& Inlet_Data = profileReader.GetDataForProfile(jMarker);
33643364
const auto nColumns = profileReader.GetNumberOfColumnsInProfile(jMarker);
33653365
vector<su2double> Inlet_Data_Interpolated ((nCol_InletFile+nDim)*geometry[MESH_0]->nVertex[iMarker]);
33663366

@@ -3449,7 +3449,7 @@ void CSolver::LoadInletProfile(CGeometry **geometry,
34493449

34503450
const auto index = iRow*nColumns;
34513451

3452-
const auto dist = GeometryToolbox::Distance(nDim, &Inlet_Data[index], Coord);
3452+
const auto dist = GeometryToolbox::Distance(nDim, Coord, &Inlet_Data[index]);
34533453

34543454
/*--- Check is this is the closest point and store data if so. ---*/
34553455

0 commit comments

Comments
 (0)