Commit 2beb1202 authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

fix write_vtk

parent ad3473ed
Pipeline #8562 passed with stages
in 2 minutes and 58 seconds
......@@ -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 :
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment