@@ -213,7 +213,7 @@ PetscErrorCode SetupPanelCoordTransformations(DM dm, PhysicsContext phys_ctx,
213213 const PetscScalar theta = asin (x [2 ] / R ); // latitude
214214 const PetscScalar lambda = atan2 (x [1 ], x [0 ]); // longitude
215215
216- // For P_1 (east ), P_3 (front ), P_4 (west ), P_5 (back ):
216+ // For P_0 (front ), P_1 (east ), P_2 (back ), P_3 (west ):
217217 PetscScalar T00 = cos (theta )* cos (lambda ) * cos (lambda );
218218 PetscScalar T01 = cos (theta )* cos (lambda ) * 0. ;
219219 PetscScalar T10 = cos (theta )* cos (lambda ) * - sin (theta )* sin (lambda );
@@ -232,7 +232,7 @@ PetscErrorCode SetupPanelCoordTransformations(DM dm, PhysicsContext phys_ctx,
232232 {Tinv10 ,
233233 Tinv11 }
234234 };
235- // For P2 (north):
235+ // For P4 (north):
236236 T00 = sin (theta ) * cos (lambda );
237237 T01 = sin (theta ) * sin (lambda );
238238 T10 = sin (theta ) * - sin (theta )* sin (lambda );
@@ -252,7 +252,7 @@ PetscErrorCode SetupPanelCoordTransformations(DM dm, PhysicsContext phys_ctx,
252252 Tinv11 }
253253 };
254254
255- // For P0 (south):
255+ // For P5 (south):
256256 T00 = sin (theta ) * (- cos (theta ));
257257 T01 = sin (theta ) * sin (lambda );
258258 T10 = sin (theta ) * sin (theta )* sin (lambda );
@@ -272,20 +272,20 @@ PetscErrorCode SetupPanelCoordTransformations(DM dm, PhysicsContext phys_ctx,
272272 Tinv11 }
273273 };
274274
275- const PetscScalar (* transforms [6 ])[2 ][2 ] = {& T_bottom ,
275+ const PetscScalar (* transforms [6 ])[2 ][2 ] = {& T_lateral ,
276276 & T_lateral ,
277- & T_top ,
278277 & T_lateral ,
279278 & T_lateral ,
280- & T_lateral
279+ & T_top ,
280+ & T_bottom
281281 };
282282
283- const PetscScalar (* inv_transforms [6 ])[2 ][2 ] = {& T_bottominv ,
283+ const PetscScalar (* inv_transforms [6 ])[2 ][2 ] = {& T_lateralinv ,
284284 & T_lateralinv ,
285- & T_topinv ,
286285 & T_lateralinv ,
287286 & T_lateralinv ,
288- & T_lateralinv
287+ & T_topinv ,
288+ & T_bottominv
289289 };
290290
291291 for (PetscInt e = 0 ; e < nedgenodes ; e ++ ) {
0 commit comments