Modal spectral element method in curvilinear domains