Laplacian 2D for Reaction Diffusion on Triangular Mesh ?

   1108   0   0
User Avatar
Member
1 posts
Joined: May 2016
Offline
Hi,

I have been struggling to find a way to apply Laplacian 2D in VEX for Gray Scott Reaction Diffusion
on a triangular re meshed three-dimensional open surface.
I've combed the internet up and down finding loads of information on RD, but still failing to set it up properly.

I am sure I am missing something very simple, but very key.
I am only a casual VEX user, and I am not used to writing longer portion, therefore I might be making some rookie mistakes.

I am pasting part of the VEX code below.
I get lost in the part where I find all the adjacent points (neighbors), and have to make a vector (which later gets multiplied in the ‘smoothing’ function).

If anyone spots some crucial mistakes in application or has suggestion for less complicated way to go around it, please let me know.

Many thanks,
Nina

float condition = neighbourcount(0, @ptnum);
float adj = (1.0 / condition);

int getneis (int @ptnum){
int neis = neighbours(0, @ptnum);
}

vector2 Laplacian2D(int ptnum; float condition; float cen; float adj){
vector2 myLap = set(0.0, 0.0);

if(condition > 3){
for(int i=-1; i<=1; i++){
for(int n=-1; n<=1; n++){
int neis = getneis (ptnum);
vector2 AB = set(point(0, “A”, neis), point(0, “B”, neis));

if( i== 0 && n == 0){
myLap += AB * cen;
}else if( (abs(i) + abs(n)) % 2 == 1){
myLap += AB * adj;
}
}
}
}


return myLap;

}
  • Quick Links