Jump to content

How can I prevent the Grains from shrinking?


Masoud

Recommended Posts

int n[] = pcfind(0, 'P', @P, @pscale*2, 100);

vector change = 0;
float weight = 0;
foreach (int npt; n)
{
    if (npt == @ptnum)
        continue;
    vector op = point(0, 'P', npt);
    float d = length(op - @P);
    if (d < @pscale*2)
    {
        change += normalize(@P-op) * (@pscale*2-d)/2;
        weight += 1;
    }
}
@P += change / weight;
int n[] = pcfind(0, 'P', @P, @pscale*2, 100);

vector change = 0;
float weight = 0;
foreach (int npt; n)
{
    if (npt == @ptnum)
        continue;
    vector op = point(0, 'P', npt);
    float d = length(op - @P);
    if (d < @pscale*2)
    {
        float omass = point(0, 'mass', npt);
        float ratio = omass / (@mass + omass);
        change += normalize(@P-op) * (@pscale*2-d) * ratio;
        weight += 1;
    }
}
@P += change / weight;
if (i@has_pprevious)
    @v = (@P - v@pprevious) / @TimeInc;
float ratio = omass / (@mass + omass);
change += normalize(@P-op) * (@pscale*2-d) * ratio;

JEFF LAIT- MASTERCLASS ...I think

  • Like 1
Link to comment
Share on other sites

On 6/26/2021 at 3:28 PM, Masoud said:

Hi Ultraman,

Your "Point Separation " is very low resolution. If you change it from 0.1 to 0.01, then the grain shape will collapse.

maybe need to increase stiffness or iteration when u add more point .

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...