Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fluidparticles
MigFlow
Commits
8c3f1602
Commit
8c3f1602
authored
May 06, 2021
by
Jonathan Lambrechts
Browse files
no hypot
parent
56eca17f
Changes
2
Hide whitespace changes
Inline
Side-by-side
scontact/scontact.c
View file @
8c3f1602
...
...
@@ -971,8 +971,8 @@ static int contact_solve(ParticleProblem *p, Contact *c, double dt, double tol)
body1
->
velocity
[
0
]
-
body1
->
omega
*
c
->
r1
[
1
]
-
body0
->
velocity
[
0
]
+
body0
->
omega
*
c
->
r0
[
1
],
body1
->
velocity
[
1
]
+
body1
->
omega
*
c
->
r1
[
0
]
-
body0
->
velocity
[
1
]
-
body0
->
omega
*
c
->
r0
[
0
]
};
double
dv
=
hypot
(
new_dv
[
0
]
-
old_dv
[
0
],
new_dv
[
1
]
-
old_dv
[
1
]
)
;
return
dv
*
dt
<
tol
;
double
dv
[
2
]
=
{
new_dv
[
0
]
-
old_dv
[
0
],
new_dv
[
1
]
-
old_dv
[
1
]
}
;
return
(
dv
[
0
]
*
dv
[
0
]
+
dv
[
1
]
*
dv
[
1
])
*
dt
*
dt
<
tol
*
tol
;
}
void
swap
(
int
*
a
,
int
*
b
)
{
...
...
testcases/bodies/tetris.py
View file @
8c3f1602
...
...
@@ -4,7 +4,7 @@ import os
import
numpy
as
np
odir
=
"output"
friction
=
Fals
e
friction
=
Tru
e
os
.
makedirs
(
odir
,
exist_ok
=
True
)
pieces
=
np
.
genfromtxt
(
"pieces.txt"
)
pieces_omega
=
pieces
[:,
0
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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