Lines Matching refs:ds

109 static PetscErrorCode PetscDSView_Ascii(PetscDS ds, PetscViewer viewer)  in PetscDSView_Ascii()  argument
116 PetscCall(PetscDSGetNumFields(ds, &Nf)); in PetscDSView_Ascii()
120 …er, " cell total dim %" PetscInt_FMT " total comp %" PetscInt_FMT "\n", ds->totDim, ds->totComp)); in PetscDSView_Ascii()
121 if (ds->isCohesive) PetscCall(PetscViewerASCIIPrintf(viewer, " cohesive cell\n")); in PetscDSView_Ascii()
130 PetscCall(PetscDSGetDiscretization(ds, f, &obj)); in PetscDSView_Ascii()
143 …} else SETERRQ(PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_WRONG, "Unknown discretization type… in PetscDSView_Ascii()
146 if (ds->implicit[f]) PetscCall(PetscViewerASCIIPrintf(viewer, " (implicit)")); in PetscDSView_Ascii()
152 PetscCall(PetscViewerASCIIPrintf(viewer, " %" PetscInt_FMT "-jet", ds->jetDegree[f])); in PetscDSView_Ascii()
160 for (b = ds->boundary; b; b = b->next) { in PetscDSView_Ascii()
209 PetscCall(PetscDSGetConstants(ds, &numConstants, &constants)); in PetscDSView_Ascii()
216 PetscCall(PetscWeakFormView(ds->wf, viewer)); in PetscDSView_Ascii()
624 PetscErrorCode PetscDSDestroy(PetscDS *ds) in PetscDSDestroy() argument
629 if (!*ds) PetscFunctionReturn(PETSC_SUCCESS); in PetscDSDestroy()
630 PetscValidHeaderSpecific(*ds, PETSCDS_CLASSID, 1); in PetscDSDestroy()
632 if (--((PetscObject)*ds)->refct > 0) { in PetscDSDestroy()
633 *ds = NULL; in PetscDSDestroy()
636 ((PetscObject)*ds)->refct = 0; in PetscDSDestroy()
637 if ((*ds)->subprobs) { in PetscDSDestroy()
640 PetscCall(PetscDSGetSpatialDimension(*ds, &dim)); in PetscDSDestroy()
641 for (d = 0; d < dim; ++d) PetscCall(PetscDSDestroy(&(*ds)->subprobs[d])); in PetscDSDestroy()
643 PetscCall(PetscFree((*ds)->subprobs)); in PetscDSDestroy()
644 PetscCall(PetscDSDestroyStructs_Static(*ds)); in PetscDSDestroy()
645 for (f = 0; f < (*ds)->Nf; ++f) PetscCall(PetscObjectDereference((*ds)->disc[f])); in PetscDSDestroy()
646 PetscCall(PetscFree4((*ds)->disc, (*ds)->implicit, (*ds)->cohesive, (*ds)->jetDegree)); in PetscDSDestroy()
647 PetscCall(PetscWeakFormDestroy(&(*ds)->wf)); in PetscDSDestroy()
648 PetscCall(PetscFree2((*ds)->update, (*ds)->ctx)); in PetscDSDestroy()
649 PetscCall(PetscFree4((*ds)->exactSol, (*ds)->exactCtx, (*ds)->exactSol_t, (*ds)->exactCtx_t)); in PetscDSDestroy()
650 PetscCall(PetscFree4((*ds)->lowerBound, (*ds)->lowerCtx, (*ds)->upperBound, (*ds)->upperCtx)); in PetscDSDestroy()
651 PetscTryTypeMethod(*ds, destroy); in PetscDSDestroy()
652 PetscCall(PetscDSDestroyBoundary(*ds)); in PetscDSDestroy()
653 PetscCall(PetscFree((*ds)->constants)); in PetscDSDestroy()
656 if ((*ds)->quadPerm[c]) in PetscDSDestroy()
657 for (PetscInt o = 0; o < Na; ++o) PetscCall(ISDestroy(&(*ds)->quadPerm[c][o])); in PetscDSDestroy()
658 PetscCall(PetscFree((*ds)->quadPerm[c])); in PetscDSDestroy()
659 (*ds)->quadPerm[c] = NULL; in PetscDSDestroy()
661 PetscCall(PetscHeaderDestroy(ds)); in PetscDSDestroy()
680 PetscErrorCode PetscDSCreate(MPI_Comm comm, PetscDS *ds) in PetscDSCreate() argument
685 PetscAssertPointer(ds, 2); in PetscDSCreate()
699 *ds = p; in PetscDSCreate()
825 PetscErrorCode PetscDSGetForceQuad(PetscDS ds, PetscBool *forceQuad) in PetscDSGetForceQuad() argument
828 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetForceQuad()
830 *forceQuad = ds->forceQuad; in PetscDSGetForceQuad()
847 PetscErrorCode PetscDSSetForceQuad(PetscDS ds, PetscBool forceQuad) in PetscDSSetForceQuad() argument
850 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetForceQuad()
851 ds->forceQuad = forceQuad; in PetscDSSetForceQuad()
870 PetscErrorCode PetscDSIsCohesive(PetscDS ds, PetscBool *isCohesive) in PetscDSIsCohesive() argument
873 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSIsCohesive()
875 *isCohesive = ds->isCohesive; in PetscDSIsCohesive()
894 PetscErrorCode PetscDSGetNumCohesive(PetscDS ds, PetscInt *numCohesive) in PetscDSGetNumCohesive() argument
899 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetNumCohesive()
902 for (f = 0; f < ds->Nf; ++f) *numCohesive += ds->cohesive[f] ? 1 : 0; in PetscDSGetNumCohesive()
922 PetscErrorCode PetscDSGetCohesive(PetscDS ds, PetscInt f, PetscBool *isCohesive) in PetscDSGetCohesive() argument
925 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetCohesive()
927 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetCohesive()
928 *isCohesive = ds->cohesive[f]; in PetscDSGetCohesive()
946 PetscErrorCode PetscDSSetCohesive(PetscDS ds, PetscInt f, PetscBool isCohesive) in PetscDSSetCohesive() argument
951 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetCohesive()
952 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSSetCohesive()
953 ds->cohesive[f] = isCohesive; in PetscDSSetCohesive()
954 ds->isCohesive = PETSC_FALSE; in PetscDSSetCohesive()
955 …for (i = 0; i < ds->Nf; ++i) ds->isCohesive = ds->isCohesive || ds->cohesive[f] ? PETSC_TRUE : PET… in PetscDSSetCohesive()
1088 PetscErrorCode PetscDSGetWeakForm(PetscDS ds, PetscWeakForm *wf) in PetscDSGetWeakForm() argument
1091 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetWeakForm()
1093 *wf = ds->wf; in PetscDSGetWeakForm()
1110 PetscErrorCode PetscDSSetWeakForm(PetscDS ds, PetscWeakForm wf) in PetscDSSetWeakForm() argument
1113 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetWeakForm()
1115 PetscCall(PetscObjectDereference((PetscObject)ds->wf)); in PetscDSSetWeakForm()
1116 ds->wf = wf; in PetscDSSetWeakForm()
1118 PetscCall(PetscWeakFormSetNumFields(wf, ds->Nf)); in PetscDSSetWeakForm()
1238 PetscErrorCode PetscDSGetJetDegree(PetscDS ds, PetscInt f, PetscInt *k) in PetscDSGetJetDegree() argument
1241 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetJetDegree()
1243 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetJetDegree()
1244 *k = ds->jetDegree[f]; in PetscDSGetJetDegree()
1262 PetscErrorCode PetscDSSetJetDegree(PetscDS ds, PetscInt f, PetscInt k) in PetscDSSetJetDegree() argument
1265 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetJetDegree()
1266 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSSetJetDegree()
1267 ds->jetDegree[f] = k; in PetscDSSetJetDegree()
1290 PetscErrorCode PetscDSGetObjective(PetscDS ds, PetscInt f, PetscPointFn **obj) in PetscDSGetObjective() argument
1296 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetObjective()
1298 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetObjective()
1299 PetscCall(PetscWeakFormGetObjective(ds->wf, NULL, 0, f, 0, &n, &tmp)); in PetscDSGetObjective()
1321 PetscErrorCode PetscDSSetObjective(PetscDS ds, PetscInt f, PetscPointFn *obj) in PetscDSSetObjective() argument
1324 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetObjective()
1327 PetscCall(PetscWeakFormSetIndexObjective(ds->wf, NULL, 0, f, 0, 0, obj)); in PetscDSSetObjective()
1351 PetscErrorCode PetscDSGetResidual(PetscDS ds, PetscInt f, PetscPointFn **f0, PetscPointFn **f1) in PetscDSGetResidual() argument
1357 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetResidual()
1358 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetResidual()
1359 PetscCall(PetscWeakFormGetResidual(ds->wf, NULL, 0, f, 0, &n0, &tmp0, &n1, &tmp1)); in PetscDSGetResidual()
1383 PetscErrorCode PetscDSSetResidual(PetscDS ds, PetscInt f, PetscPointFn *f0, PetscPointFn *f1) in PetscDSSetResidual() argument
1386 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetResidual()
1390 PetscCall(PetscWeakFormSetIndexResidual(ds->wf, NULL, 0, f, 0, 0, f0, 0, f1)); in PetscDSSetResidual()
1414 PetscErrorCode PetscDSGetRHSResidual(PetscDS ds, PetscInt f, PetscPointFn **f0, PetscPointFn **f1) in PetscDSGetRHSResidual() argument
1420 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetRHSResidual()
1421 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetRHSResidual()
1422 PetscCall(PetscWeakFormGetResidual(ds->wf, NULL, 0, f, 100, &n0, &tmp0, &n1, &tmp1)); in PetscDSGetRHSResidual()
1446 PetscErrorCode PetscDSSetRHSResidual(PetscDS ds, PetscInt f, PetscPointFn *f0, PetscPointFn *f1) in PetscDSSetRHSResidual() argument
1449 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetRHSResidual()
1453 PetscCall(PetscWeakFormSetIndexResidual(ds->wf, NULL, 0, f, 100, 0, f0, 0, f1)); in PetscDSSetRHSResidual()
1472 PetscErrorCode PetscDSHasJacobian(PetscDS ds, PetscBool *hasJac) in PetscDSHasJacobian() argument
1475 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSHasJacobian()
1476 PetscCall(PetscWeakFormHasJacobian(ds->wf, hasJac)); in PetscDSHasJacobian()
1508 PetscErrorCode PetscDSGetJacobian(PetscDS ds, PetscInt f, PetscInt g, PetscPointJacFn **g0, PetscPo… in PetscDSGetJacobian() argument
1514 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetJacobian()
1515 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetJacobian()
1516 … 0) && !(g >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetJacobian()
1517 …PetscCall(PetscWeakFormGetJacobian(ds->wf, NULL, 0, f, g, 0, &n0, &tmp0, &n1, &tmp1, &n2, &tmp2, &… in PetscDSGetJacobian()
1551 PetscErrorCode PetscDSSetJacobian(PetscDS ds, PetscInt f, PetscInt g, PetscPointJacFn *g0, PetscPoi… in PetscDSSetJacobian() argument
1554 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetJacobian()
1561 PetscCall(PetscWeakFormSetIndexJacobian(ds->wf, NULL, 0, f, g, 0, 0, g0, 0, g1, 0, g2, 0, g3)); in PetscDSSetJacobian()
1604 PetscErrorCode PetscDSHasJacobianPreconditioner(PetscDS ds, PetscBool *hasJacPre) in PetscDSHasJacobianPreconditioner() argument
1607 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSHasJacobianPreconditioner()
1609 if (!ds->useJacPre) PetscFunctionReturn(PETSC_SUCCESS); in PetscDSHasJacobianPreconditioner()
1610 PetscCall(PetscWeakFormHasJacobianPreconditioner(ds->wf, hasJacPre)); in PetscDSHasJacobianPreconditioner()
1646 PetscErrorCode PetscDSGetJacobianPreconditioner(PetscDS ds, PetscInt f, PetscInt g, PetscPointJacFn… in PetscDSGetJacobianPreconditioner() argument
1652 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetJacobianPreconditioner()
1653 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetJacobianPreconditioner()
1654 … 0) && !(g >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetJacobianPreconditioner()
1655 …PetscCall(PetscWeakFormGetJacobianPreconditioner(ds->wf, NULL, 0, f, g, 0, &n0, &tmp0, &n1, &tmp1,… in PetscDSGetJacobianPreconditioner()
1693 PetscErrorCode PetscDSSetJacobianPreconditioner(PetscDS ds, PetscInt f, PetscInt g, PetscPointJacFn… in PetscDSSetJacobianPreconditioner() argument
1696 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetJacobianPreconditioner()
1703 …PetscCall(PetscWeakFormSetIndexJacobianPreconditioner(ds->wf, NULL, 0, f, g, 0, 0, g0, 0, g1, 0, g… in PetscDSSetJacobianPreconditioner()
1722 PetscErrorCode PetscDSHasDynamicJacobian(PetscDS ds, PetscBool *hasDynJac) in PetscDSHasDynamicJacobian() argument
1725 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSHasDynamicJacobian()
1726 PetscCall(PetscWeakFormHasDynamicJacobian(ds->wf, hasDynJac)); in PetscDSHasDynamicJacobian()
1758 PetscErrorCode PetscDSGetDynamicJacobian(PetscDS ds, PetscInt f, PetscInt g, PetscPointJacFn **g0, … in PetscDSGetDynamicJacobian() argument
1764 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetDynamicJacobian()
1765 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetDynamicJacobian()
1766 … 0) && !(g >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetDynamicJacobian()
1767 …PetscCall(PetscWeakFormGetDynamicJacobian(ds->wf, NULL, 0, f, g, 0, &n0, &tmp0, &n1, &tmp1, &n2, &… in PetscDSGetDynamicJacobian()
1801 PetscErrorCode PetscDSSetDynamicJacobian(PetscDS ds, PetscInt f, PetscInt g, PetscPointJacFn *g0, P… in PetscDSSetDynamicJacobian() argument
1804 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetDynamicJacobian()
1811 …PetscCall(PetscWeakFormSetIndexDynamicJacobian(ds->wf, NULL, 0, f, g, 0, 0, g0, 0, g1, 0, g2, 0, g… in PetscDSSetDynamicJacobian()
1831 PetscErrorCode PetscDSGetRiemannSolver(PetscDS ds, PetscInt f, PetscRiemannFn **r) in PetscDSGetRiemannSolver() argument
1837 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetRiemannSolver()
1839 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetRiemannSolver()
1840 PetscCall(PetscWeakFormGetRiemannSolver(ds->wf, NULL, 0, f, 0, &n, &tmp)); in PetscDSGetRiemannSolver()
1859 PetscErrorCode PetscDSSetRiemannSolver(PetscDS ds, PetscInt f, PetscRiemannFn *r) in PetscDSSetRiemannSolver() argument
1862 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetRiemannSolver()
1865 PetscCall(PetscWeakFormSetIndexRiemannSolver(ds->wf, NULL, 0, f, 0, 0, r)); in PetscDSSetRiemannSolver()
1885 PetscErrorCode PetscDSGetUpdate(PetscDS ds, PetscInt f, PetscPointFn **update) in PetscDSGetUpdate() argument
1888 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetUpdate()
1889 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetUpdate()
1892 *update = ds->update[f]; in PetscDSGetUpdate()
1911 PetscErrorCode PetscDSSetUpdate(PetscDS ds, PetscInt f, PetscPointFn *update) in PetscDSSetUpdate() argument
1914 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetUpdate()
1917 PetscCall(PetscDSEnlarge_Static(ds, f + 1)); in PetscDSSetUpdate()
1918 ds->update[f] = update; in PetscDSSetUpdate()
1942 PetscErrorCode PetscDSGetContext(PetscDS ds, PetscInt f, PetscCtxRt ctx) in PetscDSGetContext() argument
1945 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetContext()
1946 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetContext()
1948 *(void **)ctx = ds->ctx[f]; in PetscDSGetContext()
1966 PetscErrorCode PetscDSSetContext(PetscDS ds, PetscInt f, PetscCtx ctx) in PetscDSSetContext() argument
1969 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetContext()
1971 PetscCall(PetscDSEnlarge_Static(ds, f + 1)); in PetscDSSetContext()
1972 ds->ctx[f] = ctx; in PetscDSSetContext()
2000 PetscErrorCode PetscDSGetBdResidual(PetscDS ds, PetscInt f, PetscBdPointFn **f0, PetscBdPointFn **f… in PetscDSGetBdResidual() argument
2006 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetBdResidual()
2007 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetBdResidual()
2008 PetscCall(PetscWeakFormGetBdResidual(ds->wf, NULL, 0, f, 0, &n0, &tmp0, &n1, &tmp1)); in PetscDSGetBdResidual()
2036 PetscErrorCode PetscDSSetBdResidual(PetscDS ds, PetscInt f, PetscBdPointFn *f0, PetscBdPointFn *f1) in PetscDSSetBdResidual() argument
2039 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetBdResidual()
2041 PetscCall(PetscWeakFormSetIndexBdResidual(ds->wf, NULL, 0, f, 0, 0, f0, 0, f1)); in PetscDSSetBdResidual()
2060 PetscErrorCode PetscDSHasBdJacobian(PetscDS ds, PetscBool *hasBdJac) in PetscDSHasBdJacobian() argument
2063 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSHasBdJacobian()
2065 PetscCall(PetscWeakFormHasBdJacobian(ds->wf, hasBdJac)); in PetscDSHasBdJacobian()
2097 PetscErrorCode PetscDSGetBdJacobian(PetscDS ds, PetscInt f, PetscInt g, PetscBdPointJacFn **g0, Pet… in PetscDSGetBdJacobian() argument
2103 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetBdJacobian()
2104 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetBdJacobian()
2105 … 0) && !(g >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetBdJacobian()
2106 …PetscCall(PetscWeakFormGetBdJacobian(ds->wf, NULL, 0, f, g, 0, &n0, &tmp0, &n1, &tmp1, &n2, &tmp2,… in PetscDSGetBdJacobian()
2140 PetscErrorCode PetscDSSetBdJacobian(PetscDS ds, PetscInt f, PetscInt g, PetscBdPointJacFn *g0, Pets… in PetscDSSetBdJacobian() argument
2143 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetBdJacobian()
2150 PetscCall(PetscWeakFormSetIndexBdJacobian(ds->wf, NULL, 0, f, g, 0, 0, g0, 0, g1, 0, g2, 0, g3)); in PetscDSSetBdJacobian()
2172 PetscErrorCode PetscDSHasBdJacobianPreconditioner(PetscDS ds, PetscBool *hasBdJacPre) in PetscDSHasBdJacobianPreconditioner() argument
2175 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSHasBdJacobianPreconditioner()
2177 PetscCall(PetscWeakFormHasBdJacobianPreconditioner(ds->wf, hasBdJacPre)); in PetscDSHasBdJacobianPreconditioner()
2213 PetscErrorCode PetscDSGetBdJacobianPreconditioner(PetscDS ds, PetscInt f, PetscInt g, PetscBdPointJ… in PetscDSGetBdJacobianPreconditioner() argument
2219 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetBdJacobianPreconditioner()
2220 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetBdJacobianPreconditioner()
2221 … 0) && !(g >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetBdJacobianPreconditioner()
2222 …PetscCall(PetscWeakFormGetBdJacobianPreconditioner(ds->wf, NULL, 0, f, g, 0, &n0, &tmp0, &n1, &tmp… in PetscDSGetBdJacobianPreconditioner()
2260 PetscErrorCode PetscDSSetBdJacobianPreconditioner(PetscDS ds, PetscInt f, PetscInt g, PetscBdPointJ… in PetscDSSetBdJacobianPreconditioner() argument
2263 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetBdJacobianPreconditioner()
2270 …PetscCall(PetscWeakFormSetIndexBdJacobianPreconditioner(ds->wf, NULL, 0, f, g, 0, 0, g0, 0, g1, 0,… in PetscDSSetBdJacobianPreconditioner()
2421 PetscErrorCode PetscDSGetLowerBound(PetscDS ds, PetscInt f, PetscPointBoundFn **lb, void **ctx) in PetscDSGetLowerBound() argument
2424 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetLowerBound()
2425 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetLowerBound()
2428 *lb = ds->lowerBound[f]; in PetscDSGetLowerBound()
2432 *ctx = ds->lowerCtx[f]; in PetscDSGetLowerBound()
2452 PetscErrorCode PetscDSSetLowerBound(PetscDS ds, PetscInt f, PetscPointBoundFn *lb, PetscCtx ctx) in PetscDSSetLowerBound() argument
2455 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetLowerBound()
2457 PetscCall(PetscDSEnlarge_Static(ds, f + 1)); in PetscDSSetLowerBound()
2460 ds->lowerBound[f] = lb; in PetscDSSetLowerBound()
2464 ds->lowerCtx[f] = ctx; in PetscDSSetLowerBound()
2486 PetscErrorCode PetscDSGetUpperBound(PetscDS ds, PetscInt f, PetscPointBoundFn **ub, void **ctx) in PetscDSGetUpperBound() argument
2489 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetUpperBound()
2490 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetUpperBound()
2493 *ub = ds->upperBound[f]; in PetscDSGetUpperBound()
2497 *ctx = ds->upperCtx[f]; in PetscDSGetUpperBound()
2517 PetscErrorCode PetscDSSetUpperBound(PetscDS ds, PetscInt f, PetscPointBoundFn *ub, PetscCtx ctx) in PetscDSSetUpperBound() argument
2520 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetUpperBound()
2522 PetscCall(PetscDSEnlarge_Static(ds, f + 1)); in PetscDSSetUpperBound()
2525 ds->upperBound[f] = ub; in PetscDSSetUpperBound()
2529 ds->upperCtx[f] = ctx; in PetscDSSetUpperBound()
2550 PetscErrorCode PetscDSGetConstants(PetscDS ds, PeOp PetscInt *numConstants, PeOp const PetscScalar … in PetscDSGetConstants() argument
2553 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetConstants()
2556 *numConstants = ds->numConstants; in PetscDSGetConstants()
2560 *constants = ds->constants; in PetscDSGetConstants()
2579 PetscErrorCode PetscDSSetConstants(PetscDS ds, PetscInt numConstants, PetscScalar constants[]) in PetscDSSetConstants() argument
2582 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetConstants()
2583 if (numConstants != ds->numConstants) { in PetscDSSetConstants()
2584 PetscCall(PetscFree(ds->constants)); in PetscDSSetConstants()
2585 ds->numConstants = numConstants; in PetscDSSetConstants()
2586 PetscCall(PetscMalloc1(ds->numConstants + ds->numFuncConstants, &ds->constants)); in PetscDSSetConstants()
2588 if (ds->numConstants) { in PetscDSSetConstants()
2590 PetscCall(PetscArraycpy(ds->constants, constants, ds->numConstants)); in PetscDSSetConstants()
2609 PetscErrorCode PetscDSSetIntegrationParameters(PetscDS ds, PetscInt fieldI, PetscInt fieldJ) in PetscDSSetIntegrationParameters() argument
2612 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetIntegrationParameters()
2613 ds->constants[ds->numConstants] = fieldI; in PetscDSSetIntegrationParameters()
2614 ds->constants[ds->numConstants + 1] = fieldJ; in PetscDSSetIntegrationParameters()
2631 PetscErrorCode PetscDSSetCellParameters(PetscDS ds, PetscReal volume) in PetscDSSetCellParameters() argument
2634 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSSetCellParameters()
2635 ds->constants[ds->numConstants + 2] = volume; in PetscDSSetCellParameters()
2746 PetscErrorCode PetscDSGetFieldOffsetCohesive(PetscDS ds, PetscInt f, PetscInt *off) in PetscDSGetFieldOffsetCohesive() argument
2751 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetFieldOffsetCohesive()
2753 … 0) && !(f >= ds->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetFieldOffsetCohesive()
2758 PetscCall(PetscDSGetCohesive(ds, g, &cohesive)); in PetscDSGetFieldOffsetCohesive()
2759 PetscCall(PetscDSGetFieldSize(ds, g, &size)); in PetscDSGetFieldOffsetCohesive()
2908 PetscErrorCode PetscDSGetComponentOffsetsCohesive(PetscDS ds, PetscInt s, PetscInt *offsets[]) in PetscDSGetComponentOffsetsCohesive() argument
2911 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetComponentOffsetsCohesive()
2913 …PetscCheck(ds->isCohesive, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Cohesive offsets are only v… in PetscDSGetComponentOffsetsCohesive()
2915 PetscCall(PetscDSSetUp(ds)); in PetscDSGetComponentOffsetsCohesive()
2916 *offsets = ds->offCohesive[s]; in PetscDSGetComponentOffsetsCohesive()
2936 PetscErrorCode PetscDSGetComponentDerivativeOffsetsCohesive(PetscDS ds, PetscInt s, PetscInt *offse… in PetscDSGetComponentDerivativeOffsetsCohesive() argument
2939 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetComponentDerivativeOffsetsCohesive()
2941 …PetscCheck(ds->isCohesive, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Cohesive offsets are only v… in PetscDSGetComponentDerivativeOffsetsCohesive()
2943 PetscCall(PetscDSSetUp(ds)); in PetscDSGetComponentDerivativeOffsetsCohesive()
2944 *offsets = ds->offDerCohesive[s]; in PetscDSGetComponentDerivativeOffsetsCohesive()
3168 PetscErrorCode PetscDSAddBoundary(PetscDS ds, DMBoundaryConditionType type, const char name[], DMLa… in PetscDSAddBoundary() argument
3170 DSBoundary head = ds->boundary, b; in PetscDSAddBoundary()
3175 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSAddBoundary()
3176 PetscValidLogicalCollectiveEnum(ds, type, 2); in PetscDSAddBoundary()
3179 PetscValidLogicalCollectiveInt(ds, Nv, 5); in PetscDSAddBoundary()
3180 PetscValidLogicalCollectiveInt(ds, field, 7); in PetscDSAddBoundary()
3181 PetscValidLogicalCollectiveInt(ds, Nc, 8); in PetscDSAddBoundary()
3182 …field < ds->Nf, PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_OUTOFRANGE, "Field %" PetscInt_FMT… in PetscDSAddBoundary()
3187 PetscCall(PetscDSGetComponents(ds, &fcomps)); in PetscDSAddBoundary()
3188 …PetscCheck(Nc <= fcomps[field], PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_OUTOFRANGE, "Numbe… in PetscDSAddBoundary()
3190 …PetscCheck(comps[c] >= 0 && comps[c] < fcomps[field], PetscObjectComm((PetscObject)ds), PETSC_ERR_… in PetscDSAddBoundary()
3196 PetscCall(PetscWeakFormSetNumFields(b->wf, ds->Nf)); in PetscDSAddBoundary()
3213 if (!head) ds->boundary = b; in PetscDSAddBoundary()
3298 PetscErrorCode PetscDSAddBoundaryByName(PetscDS ds, DMBoundaryConditionType type, const char name[]… in PetscDSAddBoundaryByName() argument
3300 DSBoundary head = ds->boundary, b; in PetscDSAddBoundaryByName()
3304 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSAddBoundaryByName()
3305 PetscValidLogicalCollectiveEnum(ds, type, 2); in PetscDSAddBoundaryByName()
3308 PetscValidLogicalCollectiveInt(ds, Nv, 5); in PetscDSAddBoundaryByName()
3309 PetscValidLogicalCollectiveInt(ds, field, 7); in PetscDSAddBoundaryByName()
3310 PetscValidLogicalCollectiveInt(ds, Nc, 8); in PetscDSAddBoundaryByName()
3314 PetscCall(PetscWeakFormSetNumFields(b->wf, ds->Nf)); in PetscDSAddBoundaryByName()
3330 if (!head) ds->boundary = b; in PetscDSAddBoundaryByName()
3377 PetscErrorCode PetscDSUpdateBoundary(PetscDS ds, PetscInt bd, DMBoundaryConditionType type, const c… in PetscDSUpdateBoundary() argument
3379 DSBoundary b = ds->boundary; in PetscDSUpdateBoundary()
3383 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSUpdateBoundary()
3435 PetscErrorCode PetscDSGetNumBoundary(PetscDS ds, PetscInt *numBd) in PetscDSGetNumBoundary() argument
3437 DSBoundary b = ds->boundary; in PetscDSGetNumBoundary()
3440 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetNumBoundary()
3479 PetscErrorCode PetscDSGetBoundary(PetscDS ds, PetscInt bd, PetscWeakForm *wf, DMBoundaryConditionTy… in PetscDSGetBoundary() argument
3481 DSBoundary b = ds->boundary; in PetscDSGetBoundary()
3485 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetBoundary()
3556 PetscErrorCode PetscDSUpdateBoundaryLabels(PetscDS ds, DM dm) in PetscDSUpdateBoundaryLabels() argument
3561 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSUpdateBoundaryLabels()
3563 for (b = ds->boundary; b; b = b->next) { in PetscDSUpdateBoundaryLabels()
3609 PetscErrorCode PetscDSCopyBoundary(PetscDS ds, PetscInt numFields, const PetscInt fields[], PetscDS… in PetscDSCopyBoundary() argument
3614 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSCopyBoundary()
3616 if (ds == newds) PetscFunctionReturn(PETSC_SUCCESS); in PetscDSCopyBoundary()
3619 for (b = ds->boundary; b; b = b->next) { in PetscDSCopyBoundary()
3651 PetscErrorCode PetscDSDestroyBoundary(PetscDS ds) in PetscDSDestroyBoundary() argument
3653 DSBoundary next = ds->boundary; in PetscDSDestroyBoundary()
3858 PetscErrorCode PetscDSCopyExactSolutions(PetscDS ds, PetscDS newds) in PetscDSCopyExactSolutions() argument
3865 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSCopyExactSolutions()
3867 PetscCall(PetscDSGetNumFields(ds, &Nf)); in PetscDSCopyExactSolutions()
3869 PetscCall(PetscDSGetExactSolution(ds, f, &sol, &ctx)); in PetscDSCopyExactSolutions()
3871 PetscCall(PetscDSGetExactSolutionTimeDerivative(ds, f, &sol, &ctx)); in PetscDSCopyExactSolutions()
3892 PetscErrorCode PetscDSCopyBounds(PetscDS ds, PetscDS newds) in PetscDSCopyBounds() argument
3899 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSCopyBounds()
3901 PetscCall(PetscDSGetNumFields(ds, &Nf)); in PetscDSCopyBounds()
3903 PetscCall(PetscDSGetLowerBound(ds, f, &bound, &ctx)); in PetscDSCopyBounds()
3905 PetscCall(PetscDSGetUpperBound(ds, f, &bound, &ctx)); in PetscDSCopyBounds()
3911 PetscErrorCode PetscDSCopy(PetscDS ds, PetscInt minDegree, PetscInt maxDegree, DM dmNew, PetscDS ds… in PetscDSCopy() argument
3919 PetscCall(PetscDSCopyConstants(ds, dsNew)); in PetscDSCopy()
3920 PetscCall(PetscDSCopyExactSolutions(ds, dsNew)); in PetscDSCopy()
3921 PetscCall(PetscDSCopyBounds(ds, dsNew)); in PetscDSCopy()
3922 PetscCall(PetscDSSelectDiscretizations(ds, PETSC_DETERMINE, NULL, minDegree, maxDegree, dsNew)); in PetscDSCopy()
3923 PetscCall(PetscDSCopyEquations(ds, dsNew)); in PetscDSCopy()
3924 PetscCall(PetscDSGetNumFields(ds, &Nf)); in PetscDSCopy()
3926 PetscCall(PetscDSGetContext(ds, f, &ctx)); in PetscDSCopy()
3928 PetscCall(PetscDSGetCohesive(ds, f, &isCohesive)); in PetscDSCopy()
3930 PetscCall(PetscDSGetJetDegree(ds, f, &d)); in PetscDSCopy()
3934 PetscCall(PetscDSGetCoordinateDimension(ds, &cdim)); in PetscDSCopy()
3937 PetscCall(PetscDSCopyBoundary(ds, PETSC_DETERMINE, NULL, dsNew)); in PetscDSCopy()
3983 PetscErrorCode PetscDSPermuteQuadPoint(PetscDS ds, PetscInt ornt, PetscInt field, PetscInt q, Petsc… in PetscDSPermuteQuadPoint() argument
3992 PetscCall(PetscFEGetQuadrature((PetscFE)ds->disc[field], &quad)); in PetscDSPermuteQuadPoint()
3998 …if (!ds->quadPerm[(PetscInt)ct]) PetscCall(PetscQuadratureComputePermutations(quad, NULL, &ds->qua… in PetscDSPermuteQuadPoint()
3999 permIS = ds->quadPerm[(PetscInt)ct][ornt + Na]; in PetscDSPermuteQuadPoint()
4006 PetscErrorCode PetscDSGetDiscType_Internal(PetscDS ds, PetscInt f, PetscDiscType *disctype) in PetscDSGetDiscType_Internal() argument
4013 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSGetDiscType_Internal()
4016 PetscCall(PetscDSGetNumFields(ds, &Nf)); in PetscDSGetDiscType_Internal()
4017 …PetscCheck(f < Nf, PetscObjectComm((PetscObject)ds), PETSC_ERR_ARG_SIZ, "Field %" PetscInt_FMT " m… in PetscDSGetDiscType_Internal()
4018 PetscCall(PetscDSGetDiscretization(ds, f, &obj)); in PetscDSGetDiscType_Internal()
4027 static PetscErrorCode PetscDSDestroy_Basic(PetscDS ds) in PetscDSDestroy_Basic() argument
4030 PetscCall(PetscFree(ds->data)); in PetscDSDestroy_Basic()
4034 static PetscErrorCode PetscDSInitialize_Basic(PetscDS ds) in PetscDSInitialize_Basic() argument
4037 ds->ops->setfromoptions = NULL; in PetscDSInitialize_Basic()
4038 ds->ops->setup = NULL; in PetscDSInitialize_Basic()
4039 ds->ops->view = NULL; in PetscDSInitialize_Basic()
4040 ds->ops->destroy = PetscDSDestroy_Basic; in PetscDSInitialize_Basic()
4052 PETSC_EXTERN PetscErrorCode PetscDSCreate_Basic(PetscDS ds) in PetscDSCreate_Basic() argument
4057 PetscValidHeaderSpecific(ds, PETSCDS_CLASSID, 1); in PetscDSCreate_Basic()
4059 ds->data = b; in PetscDSCreate_Basic()
4061 PetscCall(PetscDSInitialize_Basic(ds)); in PetscDSCreate_Basic()