diff --git a/examples/fluids/navierstokes.c b/examples/fluids/navierstokes.c index 4f2c5ae93f..7468ef5a05 100644 --- a/examples/fluids/navierstokes.c +++ b/examples/fluids/navierstokes.c @@ -328,22 +328,8 @@ int main(int argc, char **argv) { PetscCall(PetscFree(app_ctx->amat_type)); PetscCall(PetscFree(app_ctx->wall_forces.walls)); - { - const char *filename = NULL; - PetscBool is_stdout = PETSC_FALSE; - - if (app_ctx->wall_forces.viewer) { - PetscCall(PetscViewerFileGetName(app_ctx->wall_forces.viewer, &filename)); - if (filename) PetscCall(PetscStrncmp(filename, "stdout", 7, &is_stdout)); - if (!is_stdout) PetscCall(PetscViewerDestroy(&app_ctx->wall_forces.viewer)); - } - - if (app_ctx->turb_spanstats_viewer) { - PetscCall(PetscViewerFileGetName(app_ctx->turb_spanstats_viewer, &filename)); - if (filename) PetscCall(PetscStrncmp(filename, "stdout", 7, &is_stdout)); - if (!is_stdout) PetscCall(PetscViewerDestroy(&app_ctx->turb_spanstats_viewer)); - } - } + PetscCall(PetscViewerDestroy(&app_ctx->wall_forces.viewer)); + PetscCall(PetscViewerDestroy(&app_ctx->turb_spanstats_viewer)); // -- Structs for (PetscInt i = 0; i < problem->num_bc_defs; i++) { diff --git a/examples/fluids/problems/advection.c b/examples/fluids/problems/advection.c index 3c8423a9d7..1795d6db0b 100644 --- a/examples/fluids/problems/advection.c +++ b/examples/fluids/problems/advection.c @@ -74,6 +74,7 @@ PetscErrorCode CreateKSPMassOperator_AdvectionStabilized(User user, CeedOperator PetscCallCeed(ceed, CeedOperatorSetField(*op_mass, "v", elem_restr_q, basis_q, CEED_VECTOR_ACTIVE)); PetscCallCeed(ceed, CeedOperatorSetField(*op_mass, "Grad_v", elem_restr_q, basis_q, CEED_VECTOR_ACTIVE)); + PetscCallCeed(ceed, CeedQFunctionContextDestroy(&qf_ctx)); PetscCallCeed(ceed, CeedQFunctionDestroy(&qf_mass)); PetscFunctionReturn(PETSC_SUCCESS); }