Commit 3b2f2f71 authored by Matthieu Constant's avatar Matthieu Constant
Browse files

init variable in set_particles to avoid calling it two times at the beginning...

init variable in set_particles to avoid calling it two times at the beginning of the simulation (wip) -> to move in c file
parent 44b267f7
......@@ -314,7 +314,7 @@ class FluidProblem :
self._lib.fluid_problem_advance_concentration(self._fp,c_double(dt/nsub))
return nit
def set_particles(self, mass, volume, position, velocity, contact, reload = False):
def set_particles(self, mass, volume, position, velocity, contact, init=False, reload = False):
"""Set location of the grains in the mesh and compute the porosity in each cell.
Keyword arguments:
......@@ -331,6 +331,9 @@ class FluidProblem :
return r
self.n_particles = mass.shape[0]
self._lib.fluid_problem_set_particles(self._fp,c_int(mass.shape[0]),np2c(mass),np2c(volume),np2c(position),np2c(velocity),np2c(contact),None,c_int(reload))
if init:
self._lib.fluid_problem_set_particles(self._fp,c_int(mass.shape[0]),np2c(mass),np2c(volume),np2c(position),np2c(velocity),np2c(contact),None,c_int(reload))
def _get_matrix(self, f_name, nrow, ncol,typec=c_double) :
f = getattr(self._lib,"fluid_problem_"+f_name)
......
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