Skip to content

Commit

Permalink
fluids: Consolidate QF and Op creation for BCs
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwrigh committed Apr 26, 2024
1 parent 64f98e9 commit 9826d03
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 147 deletions.
7 changes: 0 additions & 7 deletions examples/fluids/navierstokes.c
Expand Up @@ -268,9 +268,6 @@ int main(int argc, char **argv) {
// -- Bases
PetscCallCeed(ceed, CeedBasisDestroy(&ceed_data->basis_q));
PetscCallCeed(ceed, CeedBasisDestroy(&ceed_data->basis_x));
PetscCallCeed(ceed, CeedBasisDestroy(&ceed_data->basis_xc));
PetscCallCeed(ceed, CeedBasisDestroy(&ceed_data->basis_q_sur));
PetscCallCeed(ceed, CeedBasisDestroy(&ceed_data->basis_x_sur));

// -- Restrictions
PetscCallCeed(ceed, CeedElemRestrictionDestroy(&ceed_data->elem_restr_q));
Expand Down Expand Up @@ -298,10 +295,6 @@ int main(int argc, char **argv) {

// -- QFunctions
PetscCallCeed(ceed, CeedQFunctionDestroy(&ceed_data->qf_setup_sur));
PetscCallCeed(ceed, CeedQFunctionDestroy(&ceed_data->qf_apply_inflow));
PetscCallCeed(ceed, CeedQFunctionDestroy(&ceed_data->qf_apply_inflow_jacobian));
PetscCallCeed(ceed, CeedQFunctionDestroy(&ceed_data->qf_apply_freestream));
PetscCallCeed(ceed, CeedQFunctionDestroy(&ceed_data->qf_apply_freestream_jacobian));

// -- Operators
PetscCall(OperatorApplyContextDestroy(ceed_data->op_ics_ctx));
Expand Down
10 changes: 2 additions & 8 deletions examples/fluids/navierstokes.h
Expand Up @@ -152,11 +152,10 @@ struct AppCtx_private {
// libCEED data struct
struct CeedData_private {
CeedVector x_coord, q_data;
CeedBasis basis_x, basis_xc, basis_q, basis_x_sur, basis_q_sur;
CeedBasis basis_x, basis_q;
CeedElemRestriction elem_restr_x, elem_restr_q, elem_restr_qd_i;
OperatorApplyContext op_ics_ctx;
CeedQFunction qf_setup_sur, qf_apply_inflow, qf_apply_inflow_jacobian, qf_apply_outflow, qf_apply_outflow_jacobian, qf_apply_freestream,
qf_apply_freestream_jacobian, qf_apply_slip, qf_apply_slip_jacobian;
CeedQFunction qf_setup_sur;
};

typedef struct {
Expand Down Expand Up @@ -348,11 +347,6 @@ PetscErrorCode DMPlexCeedElemRestrictionCollocatedCreate(Ceed ceed, DM dm, DMLab

PetscErrorCode CreateBasisFromPlex(Ceed ceed, DM dm, DMLabel domain_label, CeedInt label_value, CeedInt height, CeedInt dm_field, CeedBasis *basis);

// Utility function to create CEED Composite Operator for the entire domain
PetscErrorCode CreateOperatorForDomain(Ceed ceed, DM dm, SimpleBC bc, CeedData ceed_data, Physics phys, CeedOperator op_apply_vol,
CeedOperator op_apply_ijacobian_vol, CeedInt height, CeedInt P_sur, CeedInt Q_sur, CeedInt q_data_size_sur,
CeedInt jac_data_size_sur, CeedOperator *op_apply, CeedOperator *op_apply_ijacobian);

PetscErrorCode SetupLibceed(Ceed ceed, CeedData ceed_data, DM dm, User user, AppCtx app_ctx, ProblemData problem, SimpleBC bc);

// -----------------------------------------------------------------------------
Expand Down

0 comments on commit 9826d03

Please sign in to comment.