From a0b9cdb58aea93f18f3393b0714a2d52e2b87fe8 Mon Sep 17 00:00:00 2001 From: James Wright Date: Mon, 11 Dec 2023 15:37:04 -0700 Subject: [PATCH] fluids: Support higher-order geometry --- examples/fluids/src/dm_utils.c | 11 +++++------ examples/fluids/src/setupdm.c | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/examples/fluids/src/dm_utils.c b/examples/fluids/src/dm_utils.c index 533254ef1f..964f0fe6eb 100644 --- a/examples/fluids/src/dm_utils.c +++ b/examples/fluids/src/dm_utils.c @@ -406,8 +406,8 @@ PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label, CeedI @param[in] setup_faces Flag to setup face geometry @param[in] setup_coords Flag to setup coordinate spaces @param[in] degree Polynomial orders of field - @param[in] coord_order Polynomial order of coordinate basis, or `RATEL_DECIDE` for default - @param[in] q_extra Additional quadrature order, or `RATEL_DECIDE` for default + @param[in] coord_order Polynomial order of coordinate basis, or `PETSC_DECIDE` for default + @param[in] q_extra Additional quadrature order @param[in] num_fields Number of fields in solution vector @param[in] field_sizes Array of number of components for each field @param[out] dm `DM` to setup @@ -453,8 +453,7 @@ PetscErrorCode DMSetupByOrderBegin_FEM(PetscBool setup_faces, PetscBool setup_co PetscCall(PetscDualSpaceGetOrder(fe_coord_dual_space, &fe_coord_order)); // Create FE for coordinates - PetscCheck(fe_coord_order == 1 || coord_order == 1, comm, PETSC_ERR_USER_INPUT, - "Only linear mesh geometry supported. Recieved %" PetscInt_FMT " order", fe_coord_order); + if (coord_order != PETSC_DECIDE) fe_coord_order = coord_order; PetscCall(PetscFECreateLagrange(comm, dim, num_comp_coord, is_simplex, fe_coord_order, q_order, &fe_coord_new)); if (setup_faces) PetscCall(PetscFEGetHeightSubspace(fe_coord_new, 1, &fe_coord_face_new)); PetscCall(DMSetCoordinateDisc(dm, fe_coord_new, PETSC_TRUE)); @@ -502,8 +501,8 @@ PetscErrorCode DMSetupByOrderEnd_FEM(PetscBool setup_coords, DM dm) { @param[in] setup_faces Flag to setup face geometry @param[in] setup_coords Flag to setup coordinate spaces @param[in] degree Polynomial orders of field - @param[in] coord_order Polynomial order of coordinate basis, or `RATEL_DECIDE` for default - @param[in] q_extra Additional quadrature order, or `RATEL_DECIDE` for default + @param[in] coord_order Polynomial order of coordinate basis, or `PETSC_DECIDE` for default + @param[in] q_extra Additional quadrature order @param[in] num_fields Number of fields in solution vector @param[in] field_sizes Array of number of components for each field @param[out] dm `DM` to setup diff --git a/examples/fluids/src/setupdm.c b/examples/fluids/src/setupdm.c index ca9fafc0d5..ead3264e13 100644 --- a/examples/fluids/src/setupdm.c +++ b/examples/fluids/src/setupdm.c @@ -43,7 +43,7 @@ PetscErrorCode SetUpDM(DM dm, ProblemData *problem, PetscInt degree, PetscInt q_ PetscInt num_comp_q = 5; PetscFunctionBeginUser; - PetscCall(DMSetupByOrderBegin_FEM(PETSC_TRUE, PETSC_TRUE, degree, 1, q_extra, 1, &num_comp_q, dm)); + PetscCall(DMSetupByOrderBegin_FEM(PETSC_TRUE, PETSC_TRUE, degree, PETSC_DECIDE, q_extra, 1, &num_comp_q, dm)); { // Add strong boundary conditions to DM DMLabel label;