I have a tree structure like this:
struct TetrahedronStruct {
int index;
int region;
TriangleFaces Faces[4];
Vertex Vertices[4];
struct TetrahedronStruct *adjTetrahedrons[4];
};
typedef struct {
long double Nx, Ny, Nz;
long double d;
Vertex V[3];
} TriangleFaces;
typedef struct {
long double x, y, z;
} Vertex;
How can I flatten the tree to a linear memory array to copy to CUDA device memory?