Commit 44fa73d6 authored by Matthieu Constant's avatar Matthieu Constant
Browse files

previous contact forces for reload

parent 85167a7b
Pipeline #5196 passed with stage
in 27 seconds
......@@ -243,7 +243,7 @@ class ParticleProblem :
if self._dim == 2 :
v = np.insert(v,self._dim,0,axis=1)
x = np.insert(x,self._dim,0,axis=1)
data = [("Mass",self.mass()), ("Radius",self.r()),("Velocity",v),("Omega",omega),("Material",material)]
data = [("Mass",self.mass()), ("Radius",self.r()),("Velocity",v),("Omega",omega),("Material",material),("PreviousContactForces",self.previousContactForces())]
nmat = self._lib.particleProblemNMaterial(self._p)
self._lib.particleProblemGetMaterialTagName.restype = c_char_p
tags = list([self._lib.particleProblemGetMaterialTagName(self._p,i) for i in range(nmat)])
......@@ -295,6 +295,7 @@ class ParticleProblem :
self._lib.particleProblemAddParticles(self._p,c_int(x.shape[0]),
_np2c(x[:,:self._dim]), _np2c(d["Mass"]), _np2c(d["Radius"]), _np2c(d["Velocity"][:,:self._dim]),_np2c(d["Omega"]),_np2c(partmat,dtype=np.int32))
self._fc = d["PreviousContactForces"][:,:self._dim]
x,cells,d,cdata,fdata = VTK.read(dirname+"/boundaries_%05d.vtu"%i)
tagnames = VTK.string_array_decode(fdata["TagNames"])
......@@ -325,7 +326,6 @@ class ParticleProblem :
v = np.hstack([v,vt])
o = np.vstack([fdata[k+"_idx"] for k in ks])
t = np.repeat([0,1,2,3],[fdata[k].shape[0] for k in ks])
self._fc = np.zeros_like(self.velocity())
self._lib.particleProblemSetContacts(self._p,c_int(t.shape[0]),_np2c(o,np.uint64),_np2c(v),_np2c(t,np.int32))
def add_boundary_disk(self, x0, r, tag, material="default") :
......
Supports Markdown
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