Description
Mapping of grids to reference domains are used in several places in the code (e.g. in discretization methods). To systematize this, Grids should be assigned a mapping to the reference domain at initialization, and this should be used instead of the current ad hoc approach.
Doing this for 2d and 3d grids will be relatively straightforward. For 1d, there are some places where grids are made by first algning them with the x-axis, and then modifying the coordinates later. This must be replaced by a call to a function like
porepy/src/porepy/fracs/msh_2_grid.py
Line 398 in 64435fd
although a reimplementation / move of this function may be better.
As an added bonus, it should be possible to set the directions of the mapping, so that, if used in the projection to local coordinate systems (e.g. for discretizing contact conditions), the coordinate axis are fully known.
It is not clear whether there should be one mapping per grid, or per grid cell. The latter is needed to deal with manifold grids, but a stepwise approach is perhaps advisable.