setuplibceed.c (1d2a96591ed6b7a5c5441b03ee49dc6676583130) setuplibceed.c (a2f6637ed9f7b99e1cdac198632ca3cb6dbe41d4)
1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8/// @file

--- 89 unchanged lines hidden (view full) ---

98 PetscCallCeed(ceed, CeedCompositeOperatorCreate(ceed, op_apply));
99 if (op_apply_ijacobian) PetscCallCeed(ceed, CeedCompositeOperatorCreate(ceed, op_apply_ijacobian));
100
101 // --Apply Sub-Operator for the volume
102 PetscCallCeed(ceed, CeedCompositeOperatorAddSub(*op_apply, op_apply_vol));
103 if (op_apply_ijacobian) PetscCallCeed(ceed, CeedCompositeOperatorAddSub(*op_apply_ijacobian, op_apply_ijacobian_vol));
104
105 // -- Create Sub-Operator for in/outflow BCs
1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8/// @file

--- 89 unchanged lines hidden (view full) ---

98 PetscCallCeed(ceed, CeedCompositeOperatorCreate(ceed, op_apply));
99 if (op_apply_ijacobian) PetscCallCeed(ceed, CeedCompositeOperatorCreate(ceed, op_apply_ijacobian));
100
101 // --Apply Sub-Operator for the volume
102 PetscCallCeed(ceed, CeedCompositeOperatorAddSub(*op_apply, op_apply_vol));
103 if (op_apply_ijacobian) PetscCallCeed(ceed, CeedCompositeOperatorAddSub(*op_apply_ijacobian, op_apply_ijacobian_vol));
104
105 // -- Create Sub-Operator for in/outflow BCs
106 if (phys->has_neumann || 1) {
107 // --- Setup
108 PetscCall(DMGetLabel(dm, "Face Sets", &domain_label));
106 PetscCall(DMGetLabel(dm, "Face Sets", &domain_label));
109
107
110 // --- Create Sub-Operator for inflow boundaries
111 for (CeedInt i = 0; i < bc->num_inflow; i++) {
112 PetscCall(AddBCSubOperator(ceed, dm, ceed_data, domain_label, bc->inflows[i], height, Q_sur, q_data_size_sur, jac_data_size_sur,
113 ceed_data->qf_apply_inflow, ceed_data->qf_apply_inflow_jacobian, op_apply, op_apply_ijacobian));
114 }
115 // --- Create Sub-Operator for outflow boundaries
116 for (CeedInt i = 0; i < bc->num_outflow; i++) {
117 PetscCall(AddBCSubOperator(ceed, dm, ceed_data, domain_label, bc->outflows[i], height, Q_sur, q_data_size_sur, jac_data_size_sur,
118 ceed_data->qf_apply_outflow, ceed_data->qf_apply_outflow_jacobian, op_apply, op_apply_ijacobian));
119 }
120 // --- Create Sub-Operator for freestream boundaries
121 for (CeedInt i = 0; i < bc->num_freestream; i++) {
122 PetscCall(AddBCSubOperator(ceed, dm, ceed_data, domain_label, bc->freestreams[i], height, Q_sur, q_data_size_sur, jac_data_size_sur,
123 ceed_data->qf_apply_freestream, ceed_data->qf_apply_freestream_jacobian, op_apply, op_apply_ijacobian));
124 }
108 // --- Create Sub-Operator for inflow boundaries
109 for (CeedInt i = 0; i < bc->num_inflow; i++) {
110 PetscCall(AddBCSubOperator(ceed, dm, ceed_data, domain_label, bc->inflows[i], height, Q_sur, q_data_size_sur, jac_data_size_sur,
111 ceed_data->qf_apply_inflow, ceed_data->qf_apply_inflow_jacobian, op_apply, op_apply_ijacobian));
125 }
112 }
113 // --- Create Sub-Operator for outflow boundaries
114 for (CeedInt i = 0; i < bc->num_outflow; i++) {
115 PetscCall(AddBCSubOperator(ceed, dm, ceed_data, domain_label, bc->outflows[i], height, Q_sur, q_data_size_sur, jac_data_size_sur,
116 ceed_data->qf_apply_outflow, ceed_data->qf_apply_outflow_jacobian, op_apply, op_apply_ijacobian));
117 }
118 // --- Create Sub-Operator for freestream boundaries
119 for (CeedInt i = 0; i < bc->num_freestream; i++) {
120 PetscCall(AddBCSubOperator(ceed, dm, ceed_data, domain_label, bc->freestreams[i], height, Q_sur, q_data_size_sur, jac_data_size_sur,
121 ceed_data->qf_apply_freestream, ceed_data->qf_apply_freestream_jacobian, op_apply, op_apply_ijacobian));
122 }
126
127 // ----- Get Context Labels for Operator
128 PetscCallCeed(ceed, CeedOperatorGetContextFieldLabel(*op_apply, "solution time", &phys->solution_time_label));
129 PetscCallCeed(ceed, CeedOperatorGetContextFieldLabel(*op_apply, "timestep size", &phys->timestep_size_label));
130 PetscFunctionReturn(PETSC_SUCCESS);
131}
132
133PetscErrorCode SetupBCQFunctions(Ceed ceed, PetscInt dim_sur, PetscInt num_comp_x, PetscInt num_comp_q, PetscInt q_data_size_sur,

--- 289 unchanged lines hidden ---
123
124 // ----- Get Context Labels for Operator
125 PetscCallCeed(ceed, CeedOperatorGetContextFieldLabel(*op_apply, "solution time", &phys->solution_time_label));
126 PetscCallCeed(ceed, CeedOperatorGetContextFieldLabel(*op_apply, "timestep size", &phys->timestep_size_label));
127 PetscFunctionReturn(PETSC_SUCCESS);
128}
129
130PetscErrorCode SetupBCQFunctions(Ceed ceed, PetscInt dim_sur, PetscInt num_comp_x, PetscInt num_comp_q, PetscInt q_data_size_sur,

--- 289 unchanged lines hidden ---