Merge pull request #154 from PhasicFlow/main

merge from main
This commit is contained in:
PhasicFlow 2025-01-31 13:45:24 +03:30 committed by GitHub
commit 0410eb6864
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 18 additions and 14 deletions

View File

@ -24,6 +24,7 @@ Licence:
#include "cGAbsoluteLinearCF.hpp" #include "cGAbsoluteLinearCF.hpp"
#include "cGRelativeLinearCF.hpp" #include "cGRelativeLinearCF.hpp"
#include "cGNonLinearCF.hpp" #include "cGNonLinearCF.hpp"
#include "cGNonLinearCF2.hpp"
#include "grainRolling.hpp" #include "grainRolling.hpp"
@ -42,6 +43,9 @@ using nonLimitedCGRelativeLinearGrainRolling = grainRolling<cGRelativeLinear<fal
using limitedCGNonLinearGrainRolling = grainRolling<cGNonLinear<true>>; using limitedCGNonLinearGrainRolling = grainRolling<cGNonLinear<true>>;
using nonLimitedCGNonLinearGrainRolling = grainRolling<cGNonLinear<false>>; using nonLimitedCGNonLinearGrainRolling = grainRolling<cGNonLinear<false>>;
using limitedCGNonLinear2GrainRolling = grainRolling<cGNonLinear2<true>>;
using nonLimitedCGNonLinear2GrainRolling = grainRolling<cGNonLinear2<false>>;
} }

View File

@ -96,10 +96,10 @@ public:
realx3 w_hat = wi-wj; realx3 w_hat = wi-wj;
real w_hat_mag = length(w_hat); 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; w_hat /= w_hat_mag;
else else
w_hat = zero; w_hat = static_cast<real>(0.0);
auto Reff = (Ri*Rj)/(Ri+Rj); auto Reff = (Ri*Rj)/(Ri+Rj);

View File

@ -94,10 +94,10 @@ public:
realx3 w_hat = wi-wj; realx3 w_hat = wi-wj;
real w_hat_mag = length(w_hat); 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; w_hat /= w_hat_mag;
else else
w_hat = zero; w_hat = static_cast<real>(0.0);
auto Reff = (Ri*Rj)/(Ri+Rj); auto Reff = (Ri*Rj)/(Ri+Rj);

View File

@ -46,4 +46,4 @@ createInteraction(pFlow::cfModels::limitedCGNonLinearGrainRolling, pFlow::rotati
createInteraction(pFlow::cfModels::nonLimitedCGNonLinearGrainRolling, pFlow::rotationAxisMotionGeometry); createInteraction(pFlow::cfModels::nonLimitedCGNonLinearGrainRolling, pFlow::rotationAxisMotionGeometry);
createInteraction(pFlow::cfModels::limitedCGNonLinearGrainRolling, pFlow::stationaryGeometry); createInteraction(pFlow::cfModels::limitedCGNonLinearGrainRolling, pFlow::stationaryGeometry);
createInteraction(pFlow::cfModels::nonLimitedCGNonLinearGrainRolling, pFlow::stationaryGeometry); createInteraction(pFlow::cfModels::nonLimitedCGNonLinearGrainRolling, pFlow::stationaryGeometry);

View File

@ -47,7 +47,7 @@ pFlow::rotatingAxis::rotatingAxis
timeInterval(), timeInterval(),
line(p1, p2), line(p1, p2),
omega_(omega), 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_; auto tmp = omega_;
omega_ = omega; omega_ = omega;
rotating_ = !equal(omega, zero); rotating_ = !equal(omega, static_cast<real>(0.0));
return tmp; return tmp;
} }
@ -72,7 +72,7 @@ bool pFlow::rotatingAxis::read
if(!timeInterval::read(dict))return false; if(!timeInterval::read(dict))return false;
if(!line::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); setOmega(omega);
return true; return true;

View File

@ -112,20 +112,20 @@ public:
bool inPositiveDistance(const realx3& p, real dist)const bool inPositiveDistance(const realx3& p, real dist)const
{ {
real d = pointFromPlane(p); real d = pointFromPlane(p);
return d >= zero && d <= dist; return d >= static_cast<real>(0.0) && d <= dist;
} }
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool inNegativeDistance(const realx3& p, real dist)const bool inNegativeDistance(const realx3& p, real dist)const
{ {
real d = pointFromPlane(p); real d = pointFromPlane(p);
return d < zero && d >= -dist; return d < static_cast<real>(0.0) && d >= -dist;
} }
INLINE_FUNCTION_HD INLINE_FUNCTION_HD
bool pointOnPlane(const realx3& p)const bool pointOnPlane(const realx3& p)const
{ {
return equal(pointFromPlane(p),zero); return equal(pointFromPlane(p),static_cast<real>(0.0));
} }
INLINE_FUNCTION_HD INLINE_FUNCTION_HD

View File

@ -38,8 +38,8 @@ INLINE_FUNCTION_HD
realx3 normal(const realx3& p1, const realx3& p2, const realx3& p3) realx3 normal(const realx3& p1, const realx3& p2, const realx3& p3)
{ {
auto n = cross(p2-p1, p3-p1); auto n = cross(p2-p1, p3-p1);
if( equal(n.length(), zero) ) if( equal(n.length(), static_cast<real>(0.0)) )
return zero3; return realx3(0);
else else
return normalize(n); return normalize(n);
} }
@ -52,7 +52,7 @@ bool valid
const realx3& p3 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));
} }
} }