Skip to content

Commit

Permalink
Merge pull request CEED#1549 from CEED/jrwrigh/fix_stg_explicit
Browse files Browse the repository at this point in the history
fluids: Enable Ceed-based strong BCs for explicit methods
  • Loading branch information
jrwrigh authored Apr 2, 2024
2 parents a4ce970 + 5d5213b commit d8d1641
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/fluids/src/setuplibceed.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,7 @@ PetscErrorCode SetupLibceed(Ceed ceed, CeedData ceed_data, DM dm, User user, App
NULL));
PetscCall(OperatorApplyContextCreate(dm, dm, ceed, op_rhs, user->q_ceed, user->g_ceed, user->Q_loc, NULL, &user->op_rhs_ctx));
PetscCallCeed(ceed, CeedOperatorDestroy(&op_rhs));
PetscCheck(app_ctx->sgs_model_type == SGS_MODEL_NONE, user->comm, PETSC_ERR_SUP, "SGS modeling not implemented for explicit timestepping");
} else { // IFunction
CeedOperator op_ijacobian = NULL;

Expand All @@ -425,10 +426,10 @@ PetscErrorCode SetupLibceed(Ceed ceed, CeedData ceed_data, DM dm, User user, App
PetscCallCeed(ceed, CeedOperatorGetContextFieldLabel(op_ijacobian, "ijacobian time shift", &user->phys->ijacobian_time_shift_label));
PetscCallCeed(ceed, CeedOperatorDestroy(&op_ijacobian));
}
if (problem->use_strong_bc_ceed) PetscCall(SetupStrongBC_Ceed(ceed, ceed_data, dm, user, problem, bc));
if (app_ctx->sgs_model_type == SGS_MODEL_DATA_DRIVEN) PetscCall(SgsDDSetup(ceed, user, ceed_data, problem));
}

if (problem->use_strong_bc_ceed) PetscCall(SetupStrongBC_Ceed(ceed, ceed_data, dm, user, problem, bc));
if (app_ctx->turb_spanstats_enable) PetscCall(TurbulenceStatisticsSetup(ceed, user, ceed_data, problem));
if (app_ctx->diff_filter_monitor && !user->diff_filter) PetscCall(DifferentialFilterSetup(ceed, user, ceed_data, problem));
if (app_ctx->sgs_train_enable) PetscCall(SGS_DD_TrainingSetup(ceed, user, ceed_data, problem));
Expand Down
6 changes: 1 addition & 5 deletions examples/fluids/src/strong_boundary_conditions.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,13 @@ PetscErrorCode SetupStrongSTG_Ceed(Ceed ceed, CeedData ceed_data, DM dm, Problem
CeedQFunction qf_setup, qf_strongbc, qf_stgdata;
CeedOperator op_setup, op_strong_bc_sub, op_stgdata;
DMLabel domain_label;
PetscInt dm_field = 0;
PetscInt dm_field = 0, height = 1;

PetscFunctionBeginUser;
PetscCall(DMGetLabel(dm, "Face Sets", &domain_label));

// Basis
CeedInt height = 1;
PetscCallCeed(ceed, CeedBasisCreateProjection(ceed_data->basis_x_sur, ceed_data->basis_q_sur, &basis_x_to_q_sur));
// --- Get number of quadrature points for the boundaries
CeedInt num_qpts_sur;
PetscCallCeed(ceed, CeedBasisGetNumQuadraturePoints(ceed_data->basis_q_sur, &num_qpts_sur));

// Setup QFunction
PetscCallCeed(ceed, CeedQFunctionCreateInterior(ceed, 1, SetupStrongBC, SetupStrongBC_loc, &qf_setup));
Expand Down

0 comments on commit d8d1641

Please sign in to comment.