My coworkers and I have developed a c++ library implementing a "3D Geological Model" class. Goal of this library is to provide a data structure that is used in computational codes (such as Finite Element codes etc...)
This model class contains "Entities" (i.e. Corner, Line, Surface, Volume). Each Entities own a Mesh, which contains vertices in a 3D space and the connectivity informations.
We would like to handle also "2D Geological Model", which has the same structure (i.e. it contains set of Corner, Line, Surface). But this time, these Entities own a Mesh which contains vertices in a 2D space.
One objective is to give the user the ability to run their computational codes with the same API, even if it is on 3D or 2D "Geological Model".
Does someone here have faced the same problem ? One solution is to template all the classes by the space dimension, but it seems a bit heavy.