correctoins for running on cuda
This commit is contained in:
parent
6e6cabbefa
commit
2168456584
|
@ -24,6 +24,7 @@ Licence:
|
|||
#include "cGAbsoluteLinearCF.hpp"
|
||||
#include "cGRelativeLinearCF.hpp"
|
||||
#include "cGNonLinearCF.hpp"
|
||||
#include "cGNonLinearCF2.hpp"
|
||||
|
||||
#include "grainRolling.hpp"
|
||||
|
||||
|
@ -42,6 +43,9 @@ using nonLimitedCGRelativeLinearGrainRolling = grainRolling<cGRelativeLinear<fal
|
|||
using limitedCGNonLinearGrainRolling = grainRolling<cGNonLinear<true>>;
|
||||
using nonLimitedCGNonLinearGrainRolling = grainRolling<cGNonLinear<false>>;
|
||||
|
||||
using limitedCGNonLinear2GrainRolling = grainRolling<cGNonLinear2<true>>;
|
||||
using nonLimitedCGNonLinear2GrainRolling = grainRolling<cGNonLinear2<false>>;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -96,10 +96,10 @@ public:
|
|||
realx3 w_hat = wi-wj;
|
||||
real w_hat_mag = length(w_hat);
|
||||
|
||||
if( !equal(w_hat_mag,zero) )
|
||||
if( !equal(w_hat_mag,static_cast<real>(0.0)) )
|
||||
w_hat /= w_hat_mag;
|
||||
else
|
||||
w_hat = zero;
|
||||
w_hat = static_cast<real>(0.0);
|
||||
|
||||
auto Reff = (Ri*Rj)/(Ri+Rj);
|
||||
|
||||
|
|
|
@ -94,10 +94,10 @@ public:
|
|||
realx3 w_hat = wi-wj;
|
||||
real w_hat_mag = length(w_hat);
|
||||
|
||||
if( !equal(w_hat_mag,zero) )
|
||||
if( !equal(w_hat_mag,static_cast<real>(0.0)) )
|
||||
w_hat /= w_hat_mag;
|
||||
else
|
||||
w_hat = zero;
|
||||
w_hat = static_cast<real>(0.0);
|
||||
|
||||
auto Reff = (Ri*Rj)/(Ri+Rj);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ pFlow::rotatingAxis::rotatingAxis
|
|||
timeInterval(),
|
||||
line(p1, p2),
|
||||
omega_(omega),
|
||||
rotating_(!equal(omega,zero))
|
||||
rotating_(!equal(omega,static_cast<real>(0.0)))
|
||||
{
|
||||
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ pFlow::real pFlow::rotatingAxis::setOmega(real omega)
|
|||
{
|
||||
auto tmp = omega_;
|
||||
omega_ = omega;
|
||||
rotating_ = !equal(omega, zero);
|
||||
rotating_ = !equal(omega, static_cast<real>(0.0));
|
||||
return tmp;
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ bool pFlow::rotatingAxis::read
|
|||
if(!timeInterval::read(dict))return false;
|
||||
if(!line::read(dict)) return false;
|
||||
|
||||
real omega = dict.getValOrSet("omega", zero);
|
||||
real omega = dict.getValOrSet("omega", static_cast<real>(0.0));
|
||||
|
||||
setOmega(omega);
|
||||
return true;
|
||||
|
|
|
@ -112,20 +112,20 @@ public:
|
|||
bool inPositiveDistance(const realx3& p, real dist)const
|
||||
{
|
||||
real d = pointFromPlane(p);
|
||||
return d >= zero && d <= dist;
|
||||
return d >= static_cast<real>(0.0) && d <= dist;
|
||||
}
|
||||
|
||||
INLINE_FUNCTION_HD
|
||||
bool inNegativeDistance(const realx3& p, real dist)const
|
||||
{
|
||||
real d = pointFromPlane(p);
|
||||
return d < zero && d >= -dist;
|
||||
return d < static_cast<real>(0.0) && d >= -dist;
|
||||
}
|
||||
|
||||
INLINE_FUNCTION_HD
|
||||
bool pointOnPlane(const realx3& p)const
|
||||
{
|
||||
return equal(pointFromPlane(p),zero);
|
||||
return equal(pointFromPlane(p),static_cast<real>(0.0));
|
||||
}
|
||||
|
||||
INLINE_FUNCTION_HD
|
||||
|
|
|
@ -38,8 +38,8 @@ INLINE_FUNCTION_HD
|
|||
realx3 normal(const realx3& p1, const realx3& p2, const realx3& p3)
|
||||
{
|
||||
auto n = cross(p2-p1, p3-p1);
|
||||
if( equal(n.length(), zero) )
|
||||
return zero3;
|
||||
if( equal(n.length(), static_cast<real>(0.0)) )
|
||||
return realx3(0);
|
||||
else
|
||||
return normalize(n);
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ bool valid
|
|||
const realx3& p3
|
||||
)
|
||||
{
|
||||
return !equal(cross(p2-p1, p3-p1).length(), zero);
|
||||
return !equal(cross(p2-p1, p3-p1).length(), static_cast<real>(0.0));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue