Lines Matching refs:sp

129 PetscErrorCode PetscDualSpaceSetType(PetscDualSpace sp, PetscDualSpaceType name)  in PetscDualSpaceSetType()  argument
135 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceSetType()
136 PetscCall(PetscObjectTypeCompare((PetscObject)sp, name, &match)); in PetscDualSpaceSetType()
141 …PetscCheck(r, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown PetscDualSpac… in PetscDualSpaceSetType()
143 PetscTryTypeMethod(sp, destroy); in PetscDualSpaceSetType()
144 sp->ops->destroy = NULL; in PetscDualSpaceSetType()
146 PetscCall((*r)(sp)); in PetscDualSpaceSetType()
147 PetscCall(PetscObjectChangeTypeName((PetscObject)sp, name)); in PetscDualSpaceSetType()
166 PetscErrorCode PetscDualSpaceGetType(PetscDualSpace sp, PetscDualSpaceType *name) in PetscDualSpaceGetType() argument
169 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetType()
172 *name = ((PetscObject)sp)->type_name; in PetscDualSpaceGetType()
176 static PetscErrorCode PetscDualSpaceView_ASCII(PetscDualSpace sp, PetscViewer v) in PetscDualSpaceView_ASCII() argument
182 PetscCall(PetscDualSpaceGetDimension(sp, &pdim)); in PetscDualSpaceView_ASCII()
183 PetscCall(PetscObjectPrintClassNamePrefixType((PetscObject)sp, v)); in PetscDualSpaceView_ASCII()
185 if (sp->k != 0 && sp->k != PETSC_FORM_DEGREE_UNDEFINED) { in PetscDualSpaceView_ASCII()
186 …omponents, size %" PetscInt_FMT "\n", PetscAbsInt(sp->k), sp->k < 0 ? "(stored in dual form) " : "… in PetscDualSpaceView_ASCII()
188 …Printf(v, "Dual space with %" PetscInt_FMT " components, size %" PetscInt_FMT "\n", sp->Nc, pdim)); in PetscDualSpaceView_ASCII()
190 PetscTryTypeMethod(sp, view, v); in PetscDualSpaceView_ASCII()
197 PetscCall(PetscQuadratureView(sp->functional[f], v)); in PetscDualSpaceView_ASCII()
244 PetscErrorCode PetscDualSpaceView(PetscDualSpace sp, PetscViewer v) in PetscDualSpaceView() argument
249 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceView()
251 if (!v) PetscCall(PetscViewerASCIIGetStdout(PetscObjectComm((PetscObject)sp), &v)); in PetscDualSpaceView()
253 if (isascii) PetscCall(PetscDualSpaceView_ASCII(sp, v)); in PetscDualSpaceView()
283 PetscErrorCode PetscDualSpaceSetFromOptions(PetscDualSpace sp) in PetscDualSpaceSetFromOptions() argument
291 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceSetFromOptions()
292 if (!((PetscObject)sp)->type_name) { in PetscDualSpaceSetFromOptions()
295 defaultType = ((PetscObject)sp)->type_name; in PetscDualSpaceSetFromOptions()
299 PetscObjectOptionsBegin((PetscObject)sp); in PetscDualSpaceSetFromOptions()
302 PetscCall(PetscDualSpaceSetType(sp, name)); in PetscDualSpaceSetFromOptions()
303 } else if (!((PetscObject)sp)->type_name) { in PetscDualSpaceSetFromOptions()
304 PetscCall(PetscDualSpaceSetType(sp, defaultType)); in PetscDualSpaceSetFromOptions()
306 …alspace_order", "The approximation order", "PetscDualSpaceSetOrder", sp->order, &sp->order, NULL, … in PetscDualSpaceSetFromOptions()
307 …_form_degree", "The form degree of the dofs", "PetscDualSpaceSetFormDegree", sp->k, &sp->k, NULL)); in PetscDualSpaceSetFromOptions()
308 …ponents", "The number of components", "PetscDualSpaceSetNumComponents", sp->Nc, &sp->Nc, NULL, 1)); in PetscDualSpaceSetFromOptions()
309 PetscTryTypeMethod(sp, setfromoptions, PetscOptionsObject); in PetscDualSpaceSetFromOptions()
315 PetscCall(PetscDualSpaceSetDM(sp, K)); in PetscDualSpaceSetFromOptions()
320 PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)sp, PetscOptionsObject)); in PetscDualSpaceSetFromOptions()
322 sp->setfromoptionscalled = PETSC_TRUE; in PetscDualSpaceSetFromOptions()
338 PetscErrorCode PetscDualSpaceSetUp(PetscDualSpace sp) in PetscDualSpaceSetUp() argument
341 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceSetUp()
342 if (sp->setupcalled) PetscFunctionReturn(PETSC_SUCCESS); in PetscDualSpaceSetUp()
343 PetscCall(PetscLogEventBegin(PETSCDUALSPACE_SetUp, sp, 0, 0, 0)); in PetscDualSpaceSetUp()
344 sp->setupcalled = PETSC_TRUE; in PetscDualSpaceSetUp()
345 PetscTryTypeMethod(sp, setup); in PetscDualSpaceSetUp()
346 PetscCall(PetscLogEventEnd(PETSCDUALSPACE_SetUp, sp, 0, 0, 0)); in PetscDualSpaceSetUp()
347 …if (sp->setfromoptionscalled) PetscCall(PetscDualSpaceViewFromOptions(sp, NULL, "-petscdualspace_v… in PetscDualSpaceSetUp()
351 static PetscErrorCode PetscDualSpaceClearDMData_Internal(PetscDualSpace sp, DM dm) in PetscDualSpaceClearDMData_Internal() argument
360 if (sp->pointSpaces) { in PetscDualSpaceClearDMData_Internal()
363 for (i = 0; i < pEnd - pStart; i++) PetscCall(PetscDualSpaceDestroy(&sp->pointSpaces[i])); in PetscDualSpaceClearDMData_Internal()
365 PetscCall(PetscFree(sp->pointSpaces)); in PetscDualSpaceClearDMData_Internal()
367 if (sp->heightSpaces) { in PetscDualSpaceClearDMData_Internal()
370 for (i = 0; i <= depth; i++) PetscCall(PetscDualSpaceDestroy(&sp->heightSpaces[i])); in PetscDualSpaceClearDMData_Internal()
372 PetscCall(PetscFree(sp->heightSpaces)); in PetscDualSpaceClearDMData_Internal()
374 PetscCall(PetscSectionDestroy(&sp->pointSection)); in PetscDualSpaceClearDMData_Internal()
375 PetscCall(PetscSectionDestroy(&sp->intPointSection)); in PetscDualSpaceClearDMData_Internal()
376 PetscCall(PetscQuadratureDestroy(&sp->intNodes)); in PetscDualSpaceClearDMData_Internal()
377 PetscCall(VecDestroy(&sp->intDofValues)); in PetscDualSpaceClearDMData_Internal()
378 PetscCall(VecDestroy(&sp->intNodeValues)); in PetscDualSpaceClearDMData_Internal()
379 PetscCall(MatDestroy(&sp->intMat)); in PetscDualSpaceClearDMData_Internal()
380 PetscCall(PetscQuadratureDestroy(&sp->allNodes)); in PetscDualSpaceClearDMData_Internal()
381 PetscCall(VecDestroy(&sp->allDofValues)); in PetscDualSpaceClearDMData_Internal()
382 PetscCall(VecDestroy(&sp->allNodeValues)); in PetscDualSpaceClearDMData_Internal()
383 PetscCall(MatDestroy(&sp->allMat)); in PetscDualSpaceClearDMData_Internal()
384 PetscCall(PetscFree(sp->numDof)); in PetscDualSpaceClearDMData_Internal()
400 PetscErrorCode PetscDualSpaceDestroy(PetscDualSpace *sp) in PetscDualSpaceDestroy() argument
406 if (!*sp) PetscFunctionReturn(PETSC_SUCCESS); in PetscDualSpaceDestroy()
407 PetscValidHeaderSpecific(*sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceDestroy()
409 if (--((PetscObject)*sp)->refct > 0) { in PetscDualSpaceDestroy()
410 *sp = NULL; in PetscDualSpaceDestroy()
413 ((PetscObject)*sp)->refct = 0; in PetscDualSpaceDestroy()
415 PetscCall(PetscDualSpaceGetDimension(*sp, &dim)); in PetscDualSpaceDestroy()
416 dm = (*sp)->dm; in PetscDualSpaceDestroy()
418 PetscTryTypeMethod(*sp, destroy); in PetscDualSpaceDestroy()
419 PetscCall(PetscDualSpaceClearDMData_Internal(*sp, dm)); in PetscDualSpaceDestroy()
421 for (f = 0; f < dim; ++f) PetscCall(PetscQuadratureDestroy(&(*sp)->functional[f])); in PetscDualSpaceDestroy()
422 PetscCall(PetscFree((*sp)->functional)); in PetscDualSpaceDestroy()
423 PetscCall(DMDestroy(&(*sp)->dm)); in PetscDualSpaceDestroy()
424 PetscCall(PetscHeaderDestroy(sp)); in PetscDualSpaceDestroy()
443 PetscErrorCode PetscDualSpaceCreate(MPI_Comm comm, PetscDualSpace *sp) in PetscDualSpaceCreate() argument
448 PetscAssertPointer(sp, 2); in PetscDualSpaceCreate()
460 *sp = s; in PetscDualSpaceCreate()
479 PetscErrorCode PetscDualSpaceDuplicate(PetscDualSpace sp, PetscDualSpace *spNew) in PetscDualSpaceDuplicate() argument
486 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceDuplicate()
488 PetscCall(PetscDualSpaceCreate(PetscObjectComm((PetscObject)sp), spNew)); in PetscDualSpaceDuplicate()
489 name = ((PetscObject)sp)->name; in PetscDualSpaceDuplicate()
491 PetscCall(PetscDualSpaceGetType(sp, &type)); in PetscDualSpaceDuplicate()
493 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpaceDuplicate()
496 (*spNew)->order = sp->order; in PetscDualSpaceDuplicate()
497 (*spNew)->k = sp->k; in PetscDualSpaceDuplicate()
498 (*spNew)->Nc = sp->Nc; in PetscDualSpaceDuplicate()
499 (*spNew)->uniform = sp->uniform; in PetscDualSpaceDuplicate()
500 PetscTryTypeMethod(sp, duplicate, *spNew); in PetscDualSpaceDuplicate()
519 PetscErrorCode PetscDualSpaceGetDM(PetscDualSpace sp, DM *dm) in PetscDualSpaceGetDM() argument
522 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetDM()
524 *dm = sp->dm; in PetscDualSpaceGetDM()
541 PetscErrorCode PetscDualSpaceSetDM(PetscDualSpace sp, DM dm) in PetscDualSpaceSetDM() argument
544 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceSetDM()
546 …PetscCheck(!sp->setupcalled, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONGSTATE, "Cannot c… in PetscDualSpaceSetDM()
548 if (sp->dm && sp->dm != dm) PetscCall(PetscDualSpaceClearDMData_Internal(sp, sp->dm)); in PetscDualSpaceSetDM()
549 PetscCall(DMDestroy(&sp->dm)); in PetscDualSpaceSetDM()
550 sp->dm = dm; in PetscDualSpaceSetDM()
569 PetscErrorCode PetscDualSpaceGetOrder(PetscDualSpace sp, PetscInt *order) in PetscDualSpaceGetOrder() argument
572 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetOrder()
574 *order = sp->order; in PetscDualSpaceGetOrder()
591 PetscErrorCode PetscDualSpaceSetOrder(PetscDualSpace sp, PetscInt order) in PetscDualSpaceSetOrder() argument
594 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceSetOrder()
595 …PetscCheck(!sp->setupcalled, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONGSTATE, "Cannot c… in PetscDualSpaceSetOrder()
596 sp->order = order; in PetscDualSpaceSetOrder()
616 PetscErrorCode PetscDualSpaceGetNumComponents(PetscDualSpace sp, PetscInt *Nc) in PetscDualSpaceGetNumComponents() argument
619 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetNumComponents()
621 *Nc = sp->Nc; in PetscDualSpaceGetNumComponents()
636 PetscErrorCode PetscDualSpaceSetNumComponents(PetscDualSpace sp, PetscInt Nc) in PetscDualSpaceSetNumComponents() argument
639 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceSetNumComponents()
640 …PetscCheck(!sp->setupcalled, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_WRONGSTATE, "Cannot c… in PetscDualSpaceSetNumComponents()
641 sp->Nc = Nc; in PetscDualSpaceSetNumComponents()
661 PetscErrorCode PetscDualSpaceGetFunctional(PetscDualSpace sp, PetscInt i, PetscQuadrature *function… in PetscDualSpaceGetFunctional() argument
666 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetFunctional()
668 PetscCall(PetscDualSpaceGetDimension(sp, &dim)); in PetscDualSpaceGetFunctional()
670 *functional = sp->functional[i]; in PetscDualSpaceGetFunctional()
689 PetscErrorCode PetscDualSpaceGetDimension(PetscDualSpace sp, PetscInt *dim) in PetscDualSpaceGetDimension() argument
692 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetDimension()
694 if (sp->spdim < 0) { in PetscDualSpaceGetDimension()
697 PetscCall(PetscDualSpaceGetSection(sp, &section)); in PetscDualSpaceGetDimension()
698 if (section) PetscCall(PetscSectionGetStorageSize(section, &sp->spdim)); in PetscDualSpaceGetDimension()
699 else sp->spdim = 0; in PetscDualSpaceGetDimension()
701 *dim = sp->spdim; in PetscDualSpaceGetDimension()
720 PetscErrorCode PetscDualSpaceGetInteriorDimension(PetscDualSpace sp, PetscInt *intdim) in PetscDualSpaceGetInteriorDimension() argument
723 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetInteriorDimension()
725 if (sp->spintdim < 0) { in PetscDualSpaceGetInteriorDimension()
728 PetscCall(PetscDualSpaceGetSection(sp, &section)); in PetscDualSpaceGetInteriorDimension()
729 if (section) PetscCall(PetscSectionGetConstrainedStorageSize(section, &sp->spintdim)); in PetscDualSpaceGetInteriorDimension()
730 else sp->spintdim = 0; in PetscDualSpaceGetInteriorDimension()
732 *intdim = sp->spintdim; in PetscDualSpaceGetInteriorDimension()
756 PetscErrorCode PetscDualSpaceGetUniform(PetscDualSpace sp, PetscBool *uniform) in PetscDualSpaceGetUniform() argument
759 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetUniform()
761 *uniform = sp->uniform; in PetscDualSpaceGetUniform()
783 PetscErrorCode PetscDualSpaceGetNumDof(PetscDualSpace sp, const PetscInt *numDof[]) in PetscDualSpaceGetNumDof() argument
786 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetNumDof()
788 …PetscCheck(sp->uniform, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "A non-uniform space does not have a… in PetscDualSpaceGetNumDof()
789 if (!sp->numDof) { in PetscDualSpaceGetNumDof()
794 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpaceGetNumDof()
796 PetscCall(PetscCalloc1(depth + 1, &sp->numDof)); in PetscDualSpaceGetNumDof()
797 PetscCall(PetscDualSpaceGetSection(sp, &section)); in PetscDualSpaceGetNumDof()
803 PetscCall(PetscSectionGetDof(section, dStart, &sp->numDof[d])); in PetscDualSpaceGetNumDof()
806 *numDof = sp->numDof; in PetscDualSpaceGetNumDof()
807 …PetscCheck(*numDof, PetscObjectComm((PetscObject)sp), PETSC_ERR_LIB, "Empty numDof[] returned from… in PetscDualSpaceGetNumDof()
812 PetscErrorCode PetscDualSpaceSectionCreate_Internal(PetscDualSpace sp, PetscSection *topSection) in PetscDualSpaceSectionCreate_Internal() argument
820 dm = sp->dm; in PetscDualSpaceSectionCreate_Internal()
863 PetscErrorCode PetscDualSpaceSectionSetUp_Internal(PetscDualSpace sp, PetscSection section) in PetscDualSpaceSectionSetUp_Internal() argument
870 dm = sp->dm; in PetscDualSpaceSectionSetUp_Internal()
872 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpaceSectionSetUp_Internal()
907 PetscErrorCode PetscDualSpaceGetSection(PetscDualSpace sp, PetscSection *section) in PetscDualSpaceGetSection() argument
912 if (!sp->dm) { in PetscDualSpaceGetSection()
916 if (!sp->pointSection) { in PetscDualSpaceGetSection()
918 PetscCall(PetscDualSpaceSectionCreate_Internal(sp, &sp->pointSection)); in PetscDualSpaceGetSection()
919 PetscCall(DMPlexGetChart(sp->dm, &pStart, &pEnd)); in PetscDualSpaceGetSection()
923 PetscCall(PetscDualSpaceGetPointSubspace(sp, p, &psp)); in PetscDualSpaceGetSection()
928 PetscCall(PetscSectionSetDof(sp->pointSection, p, dof)); in PetscDualSpaceGetSection()
931 PetscCall(PetscDualSpaceSectionSetUp_Internal(sp, sp->pointSection)); in PetscDualSpaceGetSection()
933 *section = sp->pointSection; in PetscDualSpaceGetSection()
959 PetscErrorCode PetscDualSpaceGetInteriorSection(PetscDualSpace sp, PetscSection *section) in PetscDualSpaceGetInteriorSection() argument
964 if (!sp->dm) { in PetscDualSpaceGetInteriorSection()
968 if (!sp->intPointSection) { in PetscDualSpaceGetInteriorSection()
971 PetscCall(PetscDualSpaceGetSection(sp, &full_section)); in PetscDualSpaceGetInteriorSection()
972 PetscCall(PetscDualSpaceSectionCreate_Internal(sp, &sp->intPointSection)); in PetscDualSpaceGetInteriorSection()
979 PetscCall(PetscSectionSetDof(sp->intPointSection, p, dof - cdof)); in PetscDualSpaceGetInteriorSection()
981 PetscCall(PetscDualSpaceSectionSetUp_Internal(sp, sp->intPointSection)); in PetscDualSpaceGetInteriorSection()
983 *section = sp->intPointSection; in PetscDualSpaceGetInteriorSection()
989 PetscErrorCode PetscDualSpacePushForwardSubspaces_Internal(PetscDualSpace sp, PetscInt sStart, Pets… in PetscDualSpacePushForwardSubspaces_Internal() argument
997 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpacePushForwardSubspaces_Internal()
999 PetscCall(PetscDualSpaceGetSection(sp, &section)); in PetscDualSpacePushForwardSubspaces_Internal()
1001 PetscCall(PetscDualSpaceGetFormDegree(sp, &k)); in PetscDualSpacePushForwardSubspaces_Internal()
1009 PetscCall(PetscDualSpaceGetPointSubspace(sp, s, &ssp)); in PetscDualSpacePushForwardSubspaces_Internal()
1025 PetscCall(PetscQuadraturePushForward(fn, dim, sv0, v0, J, k, &sp->functional[off + f])); in PetscDualSpacePushForwardSubspaces_Internal()
1056 PetscErrorCode PetscDualSpaceApply(PetscDualSpace sp, PetscInt f, PetscReal time, PetscFEGeom *cgeo… in PetscDualSpaceApply() argument
1059 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApply()
1062 PetscUseTypeMethod(sp, apply, f, time, cgeom, numComp, func, ctx, value); in PetscDualSpaceApply()
1080 PetscErrorCode PetscDualSpaceApplyAll(PetscDualSpace sp, const PetscScalar *pointEval, PetscScalar … in PetscDualSpaceApplyAll() argument
1083 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApplyAll()
1084 PetscUseTypeMethod(sp, applyall, pointEval, spValue); in PetscDualSpaceApplyAll()
1102 PetscErrorCode PetscDualSpaceApplyInterior(PetscDualSpace sp, const PetscScalar *pointEval, PetscSc… in PetscDualSpaceApplyInterior() argument
1105 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApplyInterior()
1106 PetscUseTypeMethod(sp, applyint, pointEval, spValue); in PetscDualSpaceApplyInterior()
1137 PetscErrorCode PetscDualSpaceApplyDefault(PetscDualSpace sp, PetscInt f, PetscReal time, PetscFEGeo… in PetscDualSpaceApplyDefault() argument
1148 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApplyDefault()
1150 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpaceApplyDefault()
1151 PetscCall(PetscDualSpaceGetFunctional(sp, f, &n)); in PetscDualSpaceApplyDefault()
1153 …PetscCheck(dim == cgeom->dim, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_SIZ, "The quadrature… in PetscDualSpaceApplyDefault()
1154 …PetscCheck(qNc == Nc, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_SIZ, "The quadrature compone… in PetscDualSpaceApplyDefault()
1186 PetscErrorCode PetscDualSpaceApplyAllDefault(PetscDualSpace sp, const PetscScalar *pointEval, Petsc… in PetscDualSpaceApplyAllDefault() argument
1192 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApplyAllDefault()
1195 PetscCall(PetscDualSpaceGetAllData(sp, NULL, &allMat)); in PetscDualSpaceApplyAllDefault()
1196 if (!sp->allNodeValues) PetscCall(MatCreateVecs(allMat, &sp->allNodeValues, NULL)); in PetscDualSpaceApplyAllDefault()
1197 pointValues = sp->allNodeValues; in PetscDualSpaceApplyAllDefault()
1198 if (!sp->allDofValues) PetscCall(MatCreateVecs(allMat, NULL, &sp->allDofValues)); in PetscDualSpaceApplyAllDefault()
1199 dofValues = sp->allDofValues; in PetscDualSpaceApplyAllDefault()
1222 PetscErrorCode PetscDualSpaceApplyInteriorDefault(PetscDualSpace sp, const PetscScalar *pointEval, … in PetscDualSpaceApplyInteriorDefault() argument
1228 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApplyInteriorDefault()
1231 PetscCall(PetscDualSpaceGetInteriorData(sp, NULL, &intMat)); in PetscDualSpaceApplyInteriorDefault()
1232 if (!sp->intNodeValues) PetscCall(MatCreateVecs(intMat, &sp->intNodeValues, NULL)); in PetscDualSpaceApplyInteriorDefault()
1233 pointValues = sp->intNodeValues; in PetscDualSpaceApplyInteriorDefault()
1234 if (!sp->intDofValues) PetscCall(MatCreateVecs(intMat, NULL, &sp->intDofValues)); in PetscDualSpaceApplyInteriorDefault()
1235 dofValues = sp->intDofValues; in PetscDualSpaceApplyInteriorDefault()
1258 PetscErrorCode PetscDualSpaceGetAllData(PetscDualSpace sp, PeOp PetscQuadrature *allNodes, PeOp Mat… in PetscDualSpaceGetAllData() argument
1261 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetAllData()
1264 if ((!sp->allNodes || !sp->allMat) && sp->ops->createalldata) { in PetscDualSpaceGetAllData()
1268 PetscUseTypeMethod(sp, createalldata, &qpoints, &amat); in PetscDualSpaceGetAllData()
1269 PetscCall(PetscQuadratureDestroy(&sp->allNodes)); in PetscDualSpaceGetAllData()
1270 PetscCall(MatDestroy(&sp->allMat)); in PetscDualSpaceGetAllData()
1271 sp->allNodes = qpoints; in PetscDualSpaceGetAllData()
1272 sp->allMat = amat; in PetscDualSpaceGetAllData()
1274 if (allNodes) *allNodes = sp->allNodes; in PetscDualSpaceGetAllData()
1275 if (allMat) *allMat = sp->allMat; in PetscDualSpaceGetAllData()
1293 PetscErrorCode PetscDualSpaceCreateAllDataDefault(PetscDualSpace sp, PetscQuadrature *allNodes, Mat… in PetscDualSpaceCreateAllDataDefault() argument
1305 PetscCall(PetscDualSpaceGetNumComponents(sp, &Nc)); in PetscDualSpaceCreateAllDataDefault()
1306 PetscCall(PetscDualSpaceGetDimension(sp, &spdim)); in PetscDualSpaceCreateAllDataDefault()
1312 PetscCall(PetscDualSpaceGetFunctional(sp, 0, &q)); in PetscDualSpaceCreateAllDataDefault()
1318 PetscCall(PetscDualSpaceGetFunctional(sp, f, &q)); in PetscDualSpaceCreateAllDataDefault()
1331 PetscCall(PetscDualSpaceGetFunctional(sp, f, &q)); in PetscDualSpaceCreateAllDataDefault()
1372 PetscErrorCode PetscDualSpaceGetInteriorData(PetscDualSpace sp, PeOp PetscQuadrature *intNodes, PeO… in PetscDualSpaceGetInteriorData() argument
1375 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetInteriorData()
1378 if ((!sp->intNodes || !sp->intMat) && sp->ops->createintdata) { in PetscDualSpaceGetInteriorData()
1382 PetscUseTypeMethod(sp, createintdata, &qpoints, &imat); in PetscDualSpaceGetInteriorData()
1383 PetscCall(PetscQuadratureDestroy(&sp->intNodes)); in PetscDualSpaceGetInteriorData()
1384 PetscCall(MatDestroy(&sp->intMat)); in PetscDualSpaceGetInteriorData()
1385 sp->intNodes = qpoints; in PetscDualSpaceGetInteriorData()
1386 sp->intMat = imat; in PetscDualSpaceGetInteriorData()
1388 if (intNodes) *intNodes = sp->intNodes; in PetscDualSpaceGetInteriorData()
1389 if (intMat) *intMat = sp->intMat; in PetscDualSpaceGetInteriorData()
1409 PetscErrorCode PetscDualSpaceCreateInteriorDataDefault(PetscDualSpace sp, PetscQuadrature *intNodes… in PetscDualSpaceCreateInteriorDataDefault() argument
1424 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceCreateInteriorDataDefault()
1425 PetscCall(PetscDualSpaceGetSection(sp, &section)); in PetscDualSpaceCreateInteriorDataDefault()
1432 PetscCall(PetscDualSpaceGetNumComponents(sp, &Nc)); in PetscDualSpaceCreateInteriorDataDefault()
1434 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpaceCreateInteriorDataDefault()
1447 PetscCall(PetscDualSpaceGetFunctional(sp, off, &q)); in PetscDualSpaceCreateInteriorDataDefault()
1468 PetscCall(PetscDualSpaceGetFunctional(sp, off, &q)); in PetscDualSpaceCreateInteriorDataDefault()
1564 PetscErrorCode PetscDualSpaceApplyFVM(PetscDualSpace sp, PetscInt f, PetscReal time, PetscFVCellGeo… in PetscDualSpaceApplyFVM() argument
1573 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceApplyFVM()
1575 PetscCall(PetscDualSpaceGetDM(sp, &dm)); in PetscDualSpaceApplyFVM()
1577 PetscCall(PetscDualSpaceGetFunctional(sp, f, &n)); in PetscDualSpaceApplyFVM()
1579 …PetscCheck(qNc == Nc, PetscObjectComm((PetscObject)sp), PETSC_ERR_ARG_SIZ, "The quadrature compone… in PetscDualSpaceApplyFVM()
1615 PetscErrorCode PetscDualSpaceGetHeightSubspace(PetscDualSpace sp, PetscInt height, PetscDualSpace *… in PetscDualSpaceGetHeightSubspace() argument
1621 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetHeightSubspace()
1623 …PetscCheck(sp->uniform, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "A non-uniform dual space does not h… in PetscDualSpaceGetHeightSubspace()
1625 dm = sp->dm; in PetscDualSpaceGetHeightSubspace()
1630 *subsp = sp; in PetscDualSpaceGetHeightSubspace()
1633 if (!sp->heightSpaces) { in PetscDualSpaceGetHeightSubspace()
1635 PetscCall(PetscCalloc1(depth + 1, &sp->heightSpaces)); in PetscDualSpaceGetHeightSubspace()
1639 …if (sp->ops->createheightsubspace) PetscUseTypeMethod(sp, createheightsubspace, height, &sp->heigh… in PetscDualSpaceGetHeightSubspace()
1640 else if (sp->pointSpaces) { in PetscDualSpaceGetHeightSubspace()
1647 PetscCall(PetscObjectReference((PetscObject)sp->pointSpaces[hStart])); in PetscDualSpaceGetHeightSubspace()
1648 if (sp->pointSpaces[hStart]) { in PetscDualSpaceGetHeightSubspace()
1649 PetscCall(PetscObjectGetName((PetscObject)sp, &name)); in PetscDualSpaceGetHeightSubspace()
1650 PetscCall(PetscObjectSetName((PetscObject)sp->pointSpaces[hStart], name)); in PetscDualSpaceGetHeightSubspace()
1652 sp->heightSpaces[h] = sp->pointSpaces[hStart]; in PetscDualSpaceGetHeightSubspace()
1657 *subsp = sp->heightSpaces[height]; in PetscDualSpaceGetHeightSubspace()
1687 PetscErrorCode PetscDualSpaceGetPointSubspace(PetscDualSpace sp, PetscInt point, PetscDualSpace *bd… in PetscDualSpaceGetPointSubspace() argument
1693 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetPointSubspace()
1696 dm = sp->dm; in PetscDualSpaceGetPointSubspace()
1701 *bdsp = sp; in PetscDualSpaceGetPointSubspace()
1704 if (!sp->pointSpaces) { in PetscDualSpaceGetPointSubspace()
1706 PetscCall(PetscCalloc1(pEnd - pStart, &sp->pointSpaces)); in PetscDualSpaceGetPointSubspace()
1710 …if (sp->ops->createpointsubspace) PetscUseTypeMethod(sp, createpointsubspace, p + pStart, &sp->poi… in PetscDualSpaceGetPointSubspace()
1711 else if (sp->heightSpaces || sp->ops->createheightsubspace) { in PetscDualSpaceGetPointSubspace()
1719 PetscCall(PetscDualSpaceGetHeightSubspace(sp, height, &sp->pointSpaces[p])); in PetscDualSpaceGetPointSubspace()
1720 PetscCall(PetscObjectReference((PetscObject)sp->pointSpaces[p])); in PetscDualSpaceGetPointSubspace()
1724 *bdsp = sp->pointSpaces[point - pStart]; in PetscDualSpaceGetPointSubspace()
1751 PetscErrorCode PetscDualSpaceGetSymmetries(PetscDualSpace sp, const PetscInt ****perms, const Petsc… in PetscDualSpaceGetSymmetries() argument
1754 PetscValidHeaderSpecific(sp, PETSCDUALSPACE_CLASSID, 1); in PetscDualSpaceGetSymmetries()
1763 PetscTryTypeMethod(sp, getsymmetries, perms, flips); in PetscDualSpaceGetSymmetries()