Skip to content

Bug in Y and Z directions in 3D diffusion #7

Description

@BekkerRA

I was playing around with diffusion in 3D and noticed that the particles weren't behaving as expected. On investigation, the wrapping in functions DiffusionY3D and DiffusionZ3D in Tools/Internal/PopulationGridPDEequations.java handle wrapping incorrectly. Using DiffusionY3D as an example, the wrapping currently occurs on the x-direction

else if(WrapY){
x=Wrap(y,yDim);
int ct=mn.Sample(prob);
grid.Add(centerI,-ct);
grid.Add(xyDimzDim+y*zDim+z,ct);
}

but based on the DiffusionY2D function it should be:

else if(WrapY){
y=Wrap(y,yDim);
int ct=mn.Sample(prob);
grid.Add(centerI,-ct);
grid.Add(xyDimzDim+y*zDim+z,ct);
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions