Skip to content

Commit

Permalink
fix single precision warnings with hipcc
Browse files Browse the repository at this point in the history
  • Loading branch information
glesur committed Mar 23, 2024
1 parent 54d305d commit 6286986
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/dataBlock/planetarySystem/planetarySystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ void PlanetarySystem::IntegrateAnalytically(DataBlock& data, const real& dt) {
real yp = planet[ip].m_yp;

// from cartesian to polar
real Rp{sqrt(xp*xp+yp*yp)};
real phip{atan2(yp,xp)};
real Rp{std::sqrt(xp*xp+yp*yp)};
real phip{std::atan2(yp,xp)};

real omegap{sqrt((ONE_F+qp)/Rp/Rp/Rp)};
real omegap{std::sqrt((ONE_F+qp)/Rp/Rp/Rp)};

real RpNew{Rp};
// real phipNew{phip + dt*omegap};
Expand All @@ -242,7 +242,7 @@ void PlanetarySystem::IntegrateAnalytically(DataBlock& data, const real& dt) {
}

real vxp_tmp{ZERO_F};
real vyp_tmp{RpNew*sqrt((ONE_F+qp)/RpNew/RpNew/RpNew)};
real vyp_tmp{RpNew*std::sqrt((ONE_F+qp)/RpNew/RpNew/RpNew)};

planet[ip].m_xp = RpNew*cos(phipNew);
planet[ip].m_yp = RpNew*sin(phipNew);
Expand Down

0 comments on commit 6286986

Please sign in to comment.