fm_detect_manifold function

Detect manifold type