Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

addFluidModel python function error #329

Open
GUT2060 opened this issue Aug 2, 2024 · 0 comments
Open

addFluidModel python function error #329

GUT2060 opened this issue Aug 2, 2024 · 0 comments

Comments

@GUT2060
Copy link

GUT2060 commented Aug 2, 2024

Hi ,
I'm trying to add a fluid model to the simulation directly using vectors of positions and velocities here is a snap of a code example :

`import pysplishsplash as sph
 import pysplishsplash.Utilities as sph_utils
----------------------------------------------
base = sph.Exec.SimulatorBase()
base.init(sceneFile=sph.Extras.Scenes.Empty)

# Create an imgui simulator
gui = sph.GUI.Simulator_GUI_imgui(base)
base.setGui(gui)

p,v = sph_utils.VecVector3r(),sph_utils.VecVector3r()
p.append([0.0,0.0,0.0])
p.append([1.0,1.0,1.0])
v.append([0.0,0.0,0.0])
v.append([0.0,0.0,0.0])
p_id = [1,1]

sim = sph.Simulation.getCurrent()
sim.setParticleRadius(powder.sample_radius)
sim.addFluidModel('Fluid', p, v, p_id, int(0))`

# init the simulation
base.initSimulation()
base.runSimulation()
base.cleanup()

the script however crashes without error; after some debugging it turned out that the line of the c++ code:
m_pointSetIndex = neighborhoodSearch->add_point_set(&getPosition(0)[0], nFluidParticles, true, true, true, this);
in the initModel(...) function part of addFluidModel(...) is causing the crash.

any idea on why is this happening and how to fix it ?
Thanks !

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant