Skip to content

Commit 1258cb1

Browse files
authored
Merge pull request #248 from wanqing0421/multiRotatingAxis
fix the bug about line initial
2 parents fc1f97a + c37158f commit 1258cb1

3 files changed

Lines changed: 10 additions & 5 deletions

File tree

src/Interaction/sphereInteraction/sphereInteractionsLinearModels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ createInteraction(pFlow::cfModels::limitedLinearNormalRolling, pFlow::conveyorBe
5858
createInteraction(pFlow::cfModels::nonLimitedLinearNormalRolling,pFlow::conveyorBeltMotionGeometry);
5959

6060
// multiRotationAxisMotionGeometry
61-
//createInteraction(pFlow::cfModels::limitedLinearNormalRolling, pFlow::multiRotationAxisMotionGeometry);
62-
//createInteraction(pFlow::cfModels::nonLimitedLinearNormalRolling,pFlow::multiRotationAxisMotionGeometry);
61+
createInteraction(pFlow::cfModels::limitedLinearNormalRolling, pFlow::multiRotationAxisMotionGeometry);
62+
createInteraction(pFlow::cfModels::nonLimitedLinearNormalRolling,pFlow::multiRotationAxisMotionGeometry);
6363

src/Interaction/sphereInteraction/sphereInteractionsNonLinearModels.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,5 @@ createInteraction(pFlow::cfModels::limitedNonLinearNormalRolling, pFlow::conveyo
5858
createInteraction(pFlow::cfModels::nonLimitedNonLinearNormalRolling,pFlow::conveyorBeltMotionGeometry);
5959

6060
// multiRotationAxisMotionGeometry
61-
//createInteraction(pFlow::cfModels::limitedNonLinearNormalRolling, pFlow::multiRotationAxisMotionGeometry);
62-
//createInteraction(pFlow::cfModels::nonLimitedNonLinearNormalRolling,pFlow::multiRotationAxisMotionGeometry);
61+
createInteraction(pFlow::cfModels::limitedNonLinearNormalRolling, pFlow::multiRotationAxisMotionGeometry);
62+
createInteraction(pFlow::cfModels::nonLimitedNonLinearNormalRolling,pFlow::multiRotationAxisMotionGeometry);

src/phasicFlow/structuredData/line/line.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class line
5050
//// - Constructors
5151
FUNCTION_HD
5252
line()
53+
: v21_(1, 0, 0), p1_(0, 0, 0)
5354
{}
5455

5556
FUNCTION_HD
@@ -86,6 +87,10 @@ class line
8687
void set(const realx3 &lp1, const realx3 &lp2)
8788
{
8889
v21_ = lp2 - lp1;
90+
if(v21_.length() < verySmallValue)
91+
{
92+
v21_ = realx3(1, 0, 0);
93+
}
8994
p1_ = lp1;
9095
}
9196

@@ -121,7 +126,7 @@ class line
121126
real projectNormalizedLength(realx3 p) const
122127
{
123128
realx3 w = p - p1_;
124-
return dot(w,v21_) / dot(v21_,v21_);
129+
return dot(w, v21_) / dot(v21_, v21_);
125130
}
126131

127132
//// - IO operation

0 commit comments

Comments
 (0)