Jump to content

Gas Particle Neighbour Update?


Recommended Posts

My guess is some microsolvers (ie the Gas Compute Particle Attributes DOP) have the option to make computations with neighboring particles and this DOP allows you to specify when the neighbor update takes place. 

Link to comment
Share on other sites

That microsolver is used in the old SPH fluids to maintain a list of neighbor particles within a search radius.  These days you're better off just using pcfind and storing the results in array attributes.  

 

So using a POP or Geometry Wrangle:

// next two variables could be parameters
int maxn = 100;
float scale = 2.5;

float searchrad = f@pscale * scale;

// find nearby particles
int n[] = pcfind(0, "P", @P, searchrad, maxn + 1);
// remove this particle from list
removevalue(neighbors, @ptnum);

i[]@neighbors = n;

On the Inputs tab set Input 1 to Myself or Myself (no reads of Outputs), the latter being faster.

 

You can then loop through that array to do various neighbor-lookup type things. The POP Grains solver does lots of this if you want to look inside.

Edited by johner
  • Like 4
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...