I am graduate student and recently tried to implement quad-tree based AMR. Well I have implemented simple Poisson Solver on node-based quadtree, but I am not sure that my data structure is right. To be honest, I am not sure about my coding skills. So I'll just post some of my structures.
class node
{
double x,y;
cell *NW,*NE,*SW,*SE;
}
class cell
{
double x,y;
cell *NW,*NE,*SW,*SE;
node *nw,*ne,*sw,*se;
}
So I stored information of four cells(the smallest) that shares the node. Therefore I can easily access to neighboring nodes. However, I think this is inefficient in memory, since it stores too many things. So what I am curious about is that, is their more efficient way of making quadtree structure that stores both node and cell? Thanks in advance.