![Smile :)](./images/smilies/icon_e_smile.gif)
Recently I tried createVoxelization(). It makes searching neighbors work really fast. However, there is a problem which makes utilization of this function useless
![Sad :(](./images/smilies/icon_e_sad.gif)
Here is part of my code:
FramesPre:
defDist = scene.getGlobalVariableValue("defDist")
search_dist = defDist * 3.0
pList = dom.getParticles()
DY_Domain01.createVoxelization()
print ("Voxelization() is ON!")
for particle in pList:
pPos = particle.getPosition()
pId = particle.getId()
#scene.message(str(pPos))
nList = dom.getNeighbors(pPos, search_dist)
#print(str(len(nList)))
if (len(nList) > 0 ):
#print("IF condition started")
#print(str(len(nList)))
Frc = 0.0
n = Vector.new(0.0, 0.0, 0.0)
#print("!!!2nd cycle FOR started!!!")
for nparticle in nList:
npPos = nparticle.getPosition()
#dist = (npPos-pPos)
#dist_m = dist.module()
k = 0.0
#print("!!!2nd cycle FOR ended!!!")
DY_Domain01.destroyVoxelization()
print ("!Voxelization() is OFF!")
The problem is for nparticle in nList: part. Every time I call any function like getId() or getPosition() (and other get-functions) Realflow crushes. Other things like print(), scene.message() or different calculations work.The problem occurs only with particles in a list of neighboring particles. Calling any get-functions for other particles in mentioned section of the code cause no crushes.
Any ideas what is going on or how to fix it?
Thanks guys,
Andrey