Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
3ec85791
Commit
3ec85791
authored
Nov 11, 2009
by
graham
Browse files
Stabilising division by p.
parent
13bddac8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/molecularDynamics/potential/tetherPotential/derived/pitchForkRing/pitchForkRing.C
View file @
3ec85791
...
...
@@ -71,9 +71,10 @@ scalar pitchForkRing::energy(const vector r) const
{
scalar
p
=
sqrt
(
r
.
x
()
*
r
.
x
()
+
r
.
y
()
*
r
.
y
());
scalar
pMinusRSqr
=
(
p
-
rOrbit_
)
*
(
p
-
rOrbit_
);
scalar
pMinusRSqr
=
sqr
(
p
-
rOrbit_
);
return
-
0
.
5
*
mu_
*
pMinusRSqr
return
-
0
.
5
*
mu_
*
pMinusRSqr
+
0
.
25
*
pMinusRSqr
*
pMinusRSqr
+
0
.
5
*
alpha_
*
r
.
z
()
*
r
.
z
();
}
...
...
@@ -87,9 +88,9 @@ vector pitchForkRing::force(const vector r) const
return
vector
(
(
mu_
-
pMinusR
*
pMinusR
)
*
pMinusR
*
r
.
x
()
/
p
,
(
mu_
-
pMinusR
*
pMinusR
)
*
pMinusR
*
r
.
y
()
/
p
,
-
alpha_
*
r
.
z
()
(
mu_
-
sqr
(
pMinusR
)
)
*
pMinusR
*
r
.
x
()
/
(
p
+
VSMALL
)
,
(
mu_
-
sqr
(
pMinusR
)
)
*
pMinusR
*
r
.
y
()
/
(
p
+
VSMALL
)
,
-
alpha_
*
r
.
z
()
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment