I’m currently developing a FDM/FVM (using contravariant coordinates) code using Fortran and Co-Arrays, and so far I have all sparse matrix (BiCGStab, working on AMG) solvers and data-structure (CCS) libaries developed and working (I think), but so far I haven’t come up with the correct abstraction for the mesh class and, by corollary, the fields and operators.
Said abstraction, I hope, could be a natural extension of a single-block structured mesh which may be treated using simple 2D or 3D (or ND) arrays. Indexing therefore would be natural (i,j,k) both for the fields and mesh nodes/centroids. Parallelization is “trivial” in this context. (Halo/ghost cells).
Clearly, on a multi-block structured mesh context, the natural (i,j,k) indexing cannot be used anymore unless you come up with a clever strategy on how to split the overall multiblock mesh onto smaller “rectangles” distributed across images. I guess one may come up with a “super-mesh” which just extends the computational gridlines up to the outermost boundaries, in order to be able to exploit (i,j,k) indexing. See below:
This idea, although KISS-like, seems to me quite “wasteful” since you may end up with super-grids orders of magnitude bigger than the original one, besides it requires you keep track of your “live/fake cells” making your DO loops inefficient, so I’m not so convinced on this route.
I guess the question is whether it is possible to manufacture a class for block-structured meshes that allows me to use (i,j,k) indexing. My reason for preferring (i,j,k) indexing, instead of more general face-ordering of data (unstructured codes) is that the former is more amenable for Pade-type schemes and translates directly to FDM. My other excuse is that I’m not familiar with graph-splitting (metis, etc) and data-structures for general unstructured (or block structured) codes, but I’m willing to learn if that’s the way to go. I might be wrong and perhaps there’s a more general data structure and graph partitioning that allows me to achieve good parallelization.
Anyway, if you guys may point me towards the correct direction/literature I’d be very grateful .
Santiago