@@ -151,23 +151,26 @@ PetscErrorCode SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra, Petsc
151151 // create FE field for coordinates
152152 PetscFE fe_coords ;
153153 PetscInt num_comp_coord ;
154+
154155 PetscCall (DMGetCoordinateDim (dm , & num_comp_coord ));
155156 PetscCall (PetscFECreateLagrange (comm , dim , num_comp_coord , is_simplex , 1 , q_degree , & fe_coords ));
156- PetscCall (DMSetCoordinateDisc (dm , fe_coords , PETSC_TRUE ));
157+ PetscCall (DMSetCoordinateDisc (dm , fe_coords , PETSC_FALSE , PETSC_TRUE ));
157158 PetscCall (PetscFEDestroy (& fe_coords ));
158159 }
159160
160161 // Setup Dirichlet BC
161162 // Note bp1, bp2 are projection and we don't need to apply BC
162- // For bp3,bp4, the target function is zero on the boundaries
163+ // For bp3, bp4, the target function is zero on the boundaries
163164 // So we pass bcFunc = NULL in DMAddBoundary function
164165 if (enforce_bc ) {
165166 PetscBool has_label ;
167+
166168 PetscCall (DMHasLabel (dm , "marker" , & has_label ));
167169 if (!has_label ) {
168170 PetscCall (CreateBCLabel (dm , "marker" ));
169171 }
170172 DMLabel label ;
173+
171174 PetscCall (DMGetLabel (dm , "marker" , & label ));
172175 PetscCall (DMAddBoundary (dm , DM_BC_ESSENTIAL , "wall" , label , 1 , marker_ids , 0 , 0 , NULL , NULL , NULL , NULL , NULL ));
173176 PetscCall (DMSetOptionsPrefix (dm , "final_" ));
@@ -176,6 +179,7 @@ PetscErrorCode SetupDMByDegree(DM dm, PetscInt p_degree, PetscInt q_extra, Petsc
176179
177180 if (!is_simplex ) {
178181 DM dm_coord ;
182+
179183 PetscCall (DMGetCoordinateDM (dm , & dm_coord ));
180184 PetscCall (DMPlexSetClosurePermutationTensor (dm , PETSC_DETERMINE , NULL ));
181185 PetscCall (DMPlexSetClosurePermutationTensor (dm_coord , PETSC_DETERMINE , NULL ));
0 commit comments