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
2beb1202
Commit
2beb1202
authored
Oct 16, 2020
by
Jonathan Lambrechts
Browse files
fix write_vtk
parent
ad3473ed
Pipeline
#8562
passed with stages
in 2 minutes and 58 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
python/scontact.py
View file @
2beb1202
...
...
@@ -165,13 +165,6 @@ class ParticleProblem :
else
:
return
np
.
zeros
((
self
.
n_particles
(),
d
))
def
set_state
(
self
,
state
)
:
"""Sets the positions, velocities and angular velocities of the particle problem"""
self
.
_get_matrix
(
"Position"
,
self
.
_dim
)[:]
=
state
.
x
self
.
_get_matrix
(
"Velocity"
,
self
.
_dim
)[:]
=
state
.
v
if
self
.
_friction_enabled
and
self
.
_rotation_enabled
:
self
.
_get_matrix
(
"Omega"
,
1
if
self
.
_dim
==
2
else
3
)[:]
=
state
.
omega
def
save_state
(
self
)
:
self
.
_saved_velocity
=
np
.
copy
(
self
.
velocity
())
self
.
_saved_position
=
np
.
copy
(
self
.
position
())
...
...
@@ -339,10 +332,9 @@ class ParticleProblem :
i -- Number of the fiel to write
t -- Time at which the simulation is
"""
state
=
self
.
state
()
v
=
state
.
v
omega
=
state
.
omega
x
=
state
.
x
v
=
self
.
velocity
()
omega
=
self
.
omega
()
x
=
self
.
position
()
material
=
self
.
_get_idx
(
"ParticleMaterial"
).
reshape
(
-
1
,
1
)
forced
=
self
.
_get_idx
(
"ForcedFlag"
).
reshape
(
-
1
,
1
)
if
self
.
_dim
==
2
:
...
...
Write
Preview
Markdown
is supported
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