genCurvGrid is an example of generating curvilinear coordinates when the mapping is known. It should be in the proper example.