Lines Matching refs:sgs_dd_data
25 static PetscErrorCode SgsDDDataDestroy(SgsDDData *sgs_dd_data) { in SgsDDDataDestroy() argument
26 SgsDDData sgs_dd_data_ = *sgs_dd_data; in SgsDDDataDestroy()
43 *sgs_dd_data = NULL; in SgsDDDataDestroy()
99 SgsDDData sgs_dd_data; in SgsDDNodalStressEval_Fused() local
103 PetscCall(HoneeGetContainer(honee, SGS_DD_DATA_KEY, &sgs_dd_data)); in SgsDDNodalStressEval_Fused()
106 …PetscCall(ApplyCeedOperatorGlobalToLocal(VelocityGradient, SGSNodal_loc, sgs_dd_data->op_nodal_eva… in SgsDDNodalStressEval_Fused()
114 SgsDDData sgs_dd_data; in SgsDDSetupNodalEvaluation_Fused() local
130 PetscCall(HoneeGetContainer(honee, SGS_DD_DATA_KEY, &sgs_dd_data)); in SgsDDSetupNodalEvaluation_Fused()
140 …PetscCall(DMPlexCeedElemRestrictionCreate(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DMLABEL_DEFA… in SgsDDSetupNodalEvaluation_Fused()
141 …PetscCallCeed(ceed, CeedElemRestrictionCreateVector(elem_restr_sgs, &sgs_dd_data->sgs_nodal_ceed, … in SgsDDSetupNodalEvaluation_Fused()
143 …PetscCall(GetInverseMultiplicity(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DMLABEL_DEFAULT_VALUE… in SgsDDSetupNodalEvaluation_Fused()
170 …PetscCallCeed(ceed, CeedQFunctionAddOutput(qf_sgs_dd_nodal, "km_sgs", sgs_dd_data->num_comp_sgs, C… in SgsDDSetupNodalEvaluation_Fused()
181 …peratorApplyContextCreate(grad_velo_proj->dm, sgs_dd_data->dm_sgs, ceed, op_sgs_dd_nodal, NULL, sg… in SgsDDSetupNodalEvaluation_Fused()
182 &sgs_dd_data->op_nodal_evaluation_ctx)); in SgsDDSetupNodalEvaluation_Fused()
185 sgs_dd_data->sgs_nodal_eval = SgsDDNodalStressEval_Fused; in SgsDDSetupNodalEvaluation_Fused()
202 static PetscErrorCode SgsDDSetupNodalEvaluation_Sequential_Ceed(Ceed ceed, SgsDDData sgs_dd_data, S… in SgsDDSetupNodalEvaluation_Sequential_Ceed() argument
215 …PetscCallCeed(ceed, CeedQFunctionAddInput(qf_sgs_dd_inference, "model inputs", sgs_dd_data->num_co… in SgsDDSetupNodalEvaluation_Sequential_Ceed()
217 …PetscCallCeed(ceed, CeedQFunctionAddOutput(qf_sgs_dd_inference, "model outputs", sgs_dd_data->num_… in SgsDDSetupNodalEvaluation_Sequential_Ceed()
225 …PetscCall(OperatorApplyContextCreate(sgs_dd_data->dm_dd_inputs, sgs_dd_data->dm_dd_outputs, ceed, … in SgsDDSetupNodalEvaluation_Sequential_Ceed()
227 sgs_dd_data->sgs_nodal_inference_ctx_destroy = (PetscCtxDestroyFn *)OperatorApplyContextDestroy; in SgsDDSetupNodalEvaluation_Sequential_Ceed()
250 static PetscErrorCode SgsDDSetupNodalEvaluation_Sequential_Torch(Ceed ceed, SgsDDData sgs_dd_data, … in SgsDDSetupNodalEvaluation_Sequential_Torch() argument
290 SgsDDData sgs_dd_data; in SgsDDNodalStressEval_Sequential() local
295 PetscCall(HoneeGetContainer(honee, SGS_DD_DATA_KEY, &sgs_dd_data)); in SgsDDNodalStressEval_Sequential()
296 PetscCall(DMGetLocalVector(sgs_dd_data->dm_dd_inputs, &DD_Inputs_loc)); in SgsDDNodalStressEval_Sequential()
297 PetscCall(DMGetLocalVector(sgs_dd_data->dm_dd_outputs, &DD_Outputs_loc)); in SgsDDNodalStressEval_Sequential()
300 …PetscCall(ApplyCeedOperatorGlobalToLocal(VelocityGradient, DD_Inputs_loc, sgs_dd_data->op_nodal_dd… in SgsDDNodalStressEval_Sequential()
301 …PetscCall(sgs_dd_data->sgs_nodal_inference(DD_Inputs_loc, DD_Outputs_loc, &sgs_dd_data->sgs_nodal_… in SgsDDNodalStressEval_Sequential()
302 …PetscCall(ApplyCeedOperatorLocalToLocal(DD_Outputs_loc, SGSNodal_loc, sgs_dd_data->op_nodal_dd_out… in SgsDDNodalStressEval_Sequential()
305 PetscCall(DMRestoreLocalVector(sgs_dd_data->dm_dd_inputs, &DD_Inputs_loc)); in SgsDDNodalStressEval_Sequential()
306 PetscCall(DMRestoreLocalVector(sgs_dd_data->dm_dd_outputs, &DD_Outputs_loc)); in SgsDDNodalStressEval_Sequential()
312 SgsDDData sgs_dd_data; in SgsDDSetupNodalEvaluation_Sequential() local
322 PetscCall(HoneeGetContainer(honee, SGS_DD_DATA_KEY, &sgs_dd_data)); in SgsDDSetupNodalEvaluation_Sequential()
331 PetscCall(DMGetField(sgs_dd_data->dm_sgs, 0, NULL, (PetscObject *)&fe)); in SgsDDSetupNodalEvaluation_Sequential()
339 PetscCall(DMClone(sgs_dd_data->dm_sgs, &sgs_dd_data->dm_dd_inputs)); in SgsDDSetupNodalEvaluation_Sequential()
340 PetscCall(DMSetMatrixPreallocateSkip(sgs_dd_data->dm_dd_inputs, PETSC_TRUE)); in SgsDDSetupNodalEvaluation_Sequential()
341 … PetscCall(PetscObjectSetName((PetscObject)sgs_dd_data->dm_dd_inputs, "Data-Driven Model Inputs")); in SgsDDSetupNodalEvaluation_Sequential()
342 …der_FEM(PETSC_TRUE, PETSC_TRUE, degree, 1, q_extra, 1, &sgs_dd_data->num_comp_inputs, sgs_dd_data-… in SgsDDSetupNodalEvaluation_Sequential()
343 PetscCall(DMGetLocalSection(sgs_dd_data->dm_dd_inputs, §ion)); in SgsDDSetupNodalEvaluation_Sequential()
345 for (CeedInt i = 0; i < sgs_dd_data->num_comp_inputs; i++) { in SgsDDSetupNodalEvaluation_Sequential()
352 PetscCall(DMClone(sgs_dd_data->dm_sgs, &sgs_dd_data->dm_dd_outputs)); in SgsDDSetupNodalEvaluation_Sequential()
353 PetscCall(DMSetMatrixPreallocateSkip(sgs_dd_data->dm_dd_outputs, PETSC_TRUE)); in SgsDDSetupNodalEvaluation_Sequential()
354 …PetscCall(PetscObjectSetName((PetscObject)sgs_dd_data->dm_dd_outputs, "Data-Driven Model Outputs")… in SgsDDSetupNodalEvaluation_Sequential()
355 …er_FEM(PETSC_TRUE, PETSC_TRUE, degree, 1, q_extra, 1, &sgs_dd_data->num_comp_outputs, sgs_dd_data-… in SgsDDSetupNodalEvaluation_Sequential()
356 PetscCall(DMGetLocalSection(sgs_dd_data->dm_dd_outputs, §ion)); in SgsDDSetupNodalEvaluation_Sequential()
358 for (CeedInt i = 0; i < sgs_dd_data->num_comp_outputs; i++) { in SgsDDSetupNodalEvaluation_Sequential()
376 …PetscCallCeed(ceed, CeedElemRestrictionCreateVector(elem_restr_grad_velo, &sgs_dd_data->grad_velo_… in SgsDDSetupNodalEvaluation_Sequential()
379 …PetscCall(DMPlexCeedElemRestrictionCreate(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DMLABEL_DEFA… in SgsDDSetupNodalEvaluation_Sequential()
380 …PetscCallCeed(ceed, CeedElemRestrictionCreateVector(elem_restr_sgs, &sgs_dd_data->sgs_nodal_ceed, … in SgsDDSetupNodalEvaluation_Sequential()
381 …PetscCall(DMPlexCeedElemRestrictionCollocatedCreate(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DM… in SgsDDSetupNodalEvaluation_Sequential()
385 …PetscCall(DMPlexCeedElemRestrictionCreate(ceed, sgs_dd_data->dm_dd_inputs, DMLABEL_DEFAULT, DMLABE… in SgsDDSetupNodalEvaluation_Sequential()
387 …PetscCall(DMPlexCeedElemRestrictionCreate(ceed, sgs_dd_data->dm_dd_outputs, DMLABEL_DEFAULT, DMLAB… in SgsDDSetupNodalEvaluation_Sequential()
390 …PetscCall(GetInverseMultiplicity(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DMLABEL_DEFAULT_VALUE… in SgsDDSetupNodalEvaluation_Sequential()
418 …PetscCallCeed(ceed, CeedQFunctionAddOutput(qf_sgs_dd_inputs, "model inputs", sgs_dd_data->num_comp… in SgsDDSetupNodalEvaluation_Sequential()
430 …PetscCall(OperatorApplyContextCreate(grad_velo_proj->dm, sgs_dd_data->dm_dd_inputs, ceed, op_sgs_d… in SgsDDSetupNodalEvaluation_Sequential()
431 &sgs_dd_data->op_nodal_dd_inputs_ctx)); in SgsDDSetupNodalEvaluation_Sequential()
443 …PetscCallCeed(ceed, CeedQFunctionAddInput(qf_sgs_dd_outputs, "model outputs", sgs_dd_data->num_com… in SgsDDSetupNodalEvaluation_Sequential()
447 …PetscCallCeed(ceed, CeedQFunctionAddOutput(qf_sgs_dd_outputs, "km_sgs", sgs_dd_data->num_comp_sgs,… in SgsDDSetupNodalEvaluation_Sequential()
458 …all(OperatorApplyContextCreate(sgs_dd_data->dm_dd_outputs, sgs_dd_data->dm_sgs, ceed, op_sgs_dd_ou… in SgsDDSetupNodalEvaluation_Sequential()
459 NULL, NULL, &sgs_dd_data->op_nodal_dd_outputs_ctx)); in SgsDDSetupNodalEvaluation_Sequential()
464 sgs_dd_data->sgs_nodal_eval = SgsDDNodalStressEval_Sequential; in SgsDDSetupNodalEvaluation_Sequential()
467 sgs_dd_data->sgs_nodal_inference = SgsDDNodalStressEval_Sequential_Ceed; in SgsDDSetupNodalEvaluation_Sequential()
468 …PetscCall(SgsDDSetupNodalEvaluation_Sequential_Ceed(ceed, sgs_dd_data, sgs_dd_setup_data, elem_res… in SgsDDSetupNodalEvaluation_Sequential()
469 … elem_restr_inv_multiplicity, inv_multiplicity, &sgs_dd_data->sgs_nodal_inference_ctx)); in SgsDDSetupNodalEvaluation_Sequential()
471 sgs_dd_data->sgs_nodal_inference = SgsDDNodalStressEval_Sequential_Torch; in SgsDDSetupNodalEvaluation_Sequential()
472 …PetscCall(SgsDDSetupNodalEvaluation_Sequential_Torch(ceed, sgs_dd_data, sgs_dd_setup_data, elem_re… in SgsDDSetupNodalEvaluation_Sequential()
473 … elem_restr_inv_multiplicity, inv_multiplicity, &sgs_dd_data->sgs_nodal_inference_ctx)); in SgsDDSetupNodalEvaluation_Sequential()
491 SgsDDData sgs_dd_data; in SgsSetupNodalIFunction() local
501 PetscCall(HoneeGetContainer(honee, SGS_DD_DATA_KEY, &sgs_dd_data)); in SgsSetupNodalIFunction()
511 …PetscCall(DMPlexCeedBasisCreate(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DMLABEL_DEFAULT_VALUE,… in SgsSetupNodalIFunction()
512 …PetscCall(QDataGet(ceed, sgs_dd_data->dm_sgs, DMLABEL_DEFAULT, DMLABEL_DEFAULT_VALUE, &elem_restr_… in SgsSetupNodalIFunction()
530 …PetscCallCeed(ceed, CeedQFunctionAddInput(qf_sgs_apply, "km_sgs", sgs_dd_data->num_comp_sgs, CEED_… in SgsSetupNodalIFunction()
536 …(op_sgs_apply, "km_sgs", sgs_dd_setup_data->elem_restr_sgs, basis_sgs, sgs_dd_data->sgs_nodal_ceed… in SgsSetupNodalIFunction()
540 &sgs_dd_data->op_sgs_apply_ctx)); in SgsSetupNodalIFunction()
554 SgsDDData sgs_dd_data; in SgsDDApplyIFunction() local
561 PetscCall(HoneeGetContainer(honee, SGS_DD_DATA_KEY, &sgs_dd_data)); in SgsDDApplyIFunction()
567 PetscCall(DMGetLocalVector(sgs_dd_data->dm_sgs, &SGSNodal_loc)); in SgsDDApplyIFunction()
568 PetscCall(sgs_dd_data->sgs_nodal_eval(honee, Q_loc, VelocityGradient, SGSNodal_loc)); in SgsDDApplyIFunction()
571 …PetscCall(VecPetscToCeed(SGSNodal_loc, &sgs_nodal_mem_type, sgs_dd_data->sgs_nodal_ceed)); // sgs… in SgsDDApplyIFunction()
572 PetscCall(ApplyAddCeedOperatorLocalToLocal(Q_loc, G_loc, sgs_dd_data->op_sgs_apply_ctx)); in SgsDDApplyIFunction()
575 PetscCall(VecCeedToPetsc(sgs_dd_data->sgs_nodal_ceed, sgs_nodal_mem_type, SGSNodal_loc)); in SgsDDApplyIFunction()
576 PetscCall(DMRestoreLocalVector(sgs_dd_data->dm_sgs, &SGSNodal_loc)); in SgsDDApplyIFunction()
652 SgsDDData sgs_dd_data; in SgsDDSetup() local
668 PetscCall(PetscNew(&sgs_dd_data)); in SgsDDSetup()
669 sgs_dd_data->num_comp_inputs = 6; in SgsDDSetup()
670 sgs_dd_data->num_comp_outputs = 6; in SgsDDSetup()
671 …PetscCall(HoneeSetContainer(honee, SGS_DD_DATA_KEY, sgs_dd_data, (PetscCtxDestroyFn *)SgsDDDataDes… in SgsDDSetup()
698 …etscCall(SgsDDCreateDM(honee->dm, &sgs_dd_data->dm_sgs, honee->app_ctx->degree, honee->app_ctx->q_… in SgsDDSetup()