diff --git a/Common/include/basic_types/ad_structure.hpp b/Common/include/basic_types/ad_structure.hpp index a155465ba68f..36eafccc37a8 100644 --- a/Common/include/basic_types/ad_structure.hpp +++ b/Common/include/basic_types/ad_structure.hpp @@ -937,9 +937,10 @@ void Finalize(); /*--- If we compile under OSX we have to overload some of the operators for * complex numbers to avoid the use of the standard operators - * (they use a lot of functions that are only defined for doubles) ---*/ + * (they use a lot of functions that are only defined for doubles). + * The MSVC STL needs the same overloads when su2double is an AD type. ---*/ -#ifdef __APPLE__ +#if defined(__APPLE__) || (defined(_MSC_VER) && (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE))) namespace std { diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index df5e5ab8c590..fe4f799245ff 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -792,13 +792,13 @@ void CFlowCompOutput::WriteTurboSpanwisePerformance(su2vectorGetInletState().GetVelocityValue()*config[ZONE_0]->GetVelocity_Ref(); // This captures NaNs - if(std::isnan(BladePerf->GetInletState().GetAbsFlowAngle())){ + if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetInletState().GetAbsFlowAngle()))){ file.width(30); file << "0.0000"; } else { file.width(30); file << BladePerf->GetInletState().GetAbsFlowAngle()*180.0/PI_NUMBER; } - if(std::isnan(BladePerf->GetInletState().GetFlowAngle())){ + if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetInletState().GetFlowAngle()))){ file.width(30); file << "0.0000"; } else{ @@ -855,13 +855,13 @@ void CFlowCompOutput::WriteTurboSpanwisePerformance(su2vectorGetOutletState().GetVelocity()[iDim]*config[ZONE_0]->GetVelocity_Ref(); } file.width(30); file << BladePerf->GetInletState().GetVelocityValue()*config[ZONE_0]->GetVelocity_Ref(); - if(std::isnan(BladePerf->GetInletState().GetAbsFlowAngle())){ + if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetOutletState().GetAbsFlowAngle()))){ file.width(30); file << "0.0000"; } else { file.width(30); file << BladePerf->GetOutletState().GetAbsFlowAngle()*180.0/PI_NUMBER; } - if(std::isnan(BladePerf->GetInletState().GetAbsFlowAngle())){ + if(std::isnan(SU2_TYPE::GetValue(BladePerf->GetOutletState().GetFlowAngle()))){ file.width(30); file << "0.0000"; } else{ diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index ff590a87a7a9..d40f57eecb9d 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -9724,7 +9724,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC for (auto iDim = 2; iDim < nDim +1;iDim++) avgVelocity[iDim-1] = AverageFlux[iMarker][iSpan][iDim] / AverageFlux[iMarker][iSpan][0]; - if (std::isnan(avgDensity) || std::isnan(avgPressure) || avgPressure < 0.0 || avgDensity < 0.0 ){ + if (std::isnan(SU2_TYPE::GetValue(avgDensity)) || std::isnan(SU2_TYPE::GetValue(avgPressure)) || avgPressure < 0.0 || avgDensity < 0.0 ){ val_init_pressure = TotalAreaPressure / TotalArea; MixedOut_Average (config, val_init_pressure, AverageFlux[iMarker][iSpan], AverageTurboNormal, avgPressure, avgDensity); avgVelocity[0] = ( AverageFlux[iMarker][iSpan][1] - avgPressure) / AverageFlux[iMarker][iSpan][0]; @@ -9764,7 +9764,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC AverageRelTangVelocity[iMarker][iSpan] = avgRelTangVel; /* --- check if averaged quantities are correct otherwise reset the old quantities ---*/ - const bool nanSolution = (std::isnan(AverageDensity[iMarker][iSpan]) || std::isnan(AveragePressure[iMarker][iSpan])); + const bool nanSolution = (std::isnan(SU2_TYPE::GetValue(AverageDensity[iMarker][iSpan])) || std::isnan(SU2_TYPE::GetValue(AveragePressure[iMarker][iSpan]))); const bool negSolution = (AverageDensity[iMarker][iSpan] < 0.0 || AveragePressure[iMarker][iSpan] < 0.0); if (nanSolution || negSolution){ if (nanSolution)