createVoxelization() and getPosition(), getVelocity() and other functions

Post here anything related to RealFlow that doesn't specifically belong in any of the forums below
Post Reply
duke3d
Posts: 18
Joined: Wed Aug 24, 2016 12:15 am

createVoxelization() and getPosition(), getVelocity() and other functions

Post by duke3d » Tue Jan 30, 2018 5:13 am

Hi everyone :)

Recently I tried createVoxelization(). It makes searching neighbors work really fast. However, there is a problem which makes utilization of this function useless :(
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

Thomas Schlick
Posts: 178
Joined: Tue Aug 29, 2017 12:35 pm

Re: createVoxelization() and getPosition(), getVelocity() and other functions

Post by Thomas Schlick » Tue Jan 30, 2018 12:13 pm

This is starting to kill me, really. I've been able to reproduce this issue and it's definitely something serious. I've also tried to loop through neighbours with an alternative method, but it's also crashing with as long createVoxelization() is being used.

As I've said in my previous post, createVoxelization() may cause errors and if you observe problems please don't use it. That's the only workaround right now - even if it's slower.

duke3d
Posts: 18
Joined: Wed Aug 24, 2016 12:15 am

Re: createVoxelization() and getPosition(), getVelocity() and other functions

Post by duke3d » Wed Jan 31, 2018 5:07 am

Just some observation:
When createVoxelization() is used with standard particles it cause no crashes, but (I have this kind of BUT too often in last few weeks :))) ) it slows down searching process dramatically O.o
Without createVoxelization(), searching Standard particles works much faster then searching Dyverso particles with usage of createVoxelization().

Post Reply