Coordinate systems

  type, abstract :: coordinate_system_t
    logical :: local_basis  !< Do the basis vectors depend on the position, i.e., is the basis local?
    !!                         (false for Cartesian and affine, true for curvilinear coordinates in general)
    logical :: orthogonal   !< Are the basis vectors orthogonal?
    integer :: dim          !< Dimension of the space
    FLOAT :: min_mesh_scaling_product !< product of the smallest scaling :: min(distance between the grid points / spacing)
  contains
    generic   :: vector_from_cartesian => dvector_from_cartesian, zvector_from_cartesian
    !< @copydoc coordinate_system_oct_m::dvector_from_cartesian
    procedure :: dvector_from_cartesian => dcoordinate_system_vector_from_cartesian
    !< @copydoc coordinate_system_oct_m::dcoordinate_system_vector_from_cartesian
    procedure :: zvector_from_cartesian => zcoordinate_system_vector_from_cartesian
    !< @copydoc coordinate_system_oct_m::zcoordinate_system_vector_from_cartesian
    generic   :: covector_to_cartesian => dcovector_to_cartesian, zcovector_to_cartesian
    !< @copydoc coordinate_system_oct_m::dcovector_to_cartesian
    procedure :: dcovector_to_cartesian => dcoordinate_system_covector_to_cartesian
    !< @copydoc coordinate_system_oct_m::dcoordinate_system_covector_to_cartesian
    procedure :: zcovector_to_cartesian => zcoordinate_system_covector_to_cartesian
    !< @copydoc coordinate_system_oct_m::zcoordinate_system_covector_to_cartesian
    procedure(coordinate_system_to_cartesian),           deferred :: to_cartesian
    !< @copydoc coordinate_system_oct_m::coordinate_system_to_cartesian
    procedure(coordinate_system_from_cartesian),         deferred :: from_cartesian
    !< @copydoc coordinate_system_oct_m::coordinate_system_from_cartesian
    procedure(coordinate_system_det_jac),                deferred :: det_jac
    !< @copydoc coordinate_system_oct_m::coordinate_system_det_jac
    procedure(coordinate_system_write_info),             deferred :: write_info
    !< @copydoc coordinate_system_oct_m::coordinate_system_write_info
    procedure(coordinates_surface_element),              deferred :: surface_element
    !< @copydoc coordinate_system_oct_m::coordinates_surface_element
  end type coordinate_system_t