Lines Matching refs:prob

62 PetscErrorCode PetscDSSetType(PetscDS prob, PetscDSType name)  in PetscDSSetType()  argument
68 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetType()
69 PetscCall(PetscObjectTypeCompare((PetscObject)prob, name, &match)); in PetscDSSetType()
74 …PetscCheck(r, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_UNKNOWN_TYPE, "Unknown PetscDS typ… in PetscDSSetType()
76 PetscTryTypeMethod(prob, destroy); in PetscDSSetType()
77 prob->ops->destroy = NULL; in PetscDSSetType()
79 PetscCall((*r)(prob)); in PetscDSSetType()
80 PetscCall(PetscObjectChangeTypeName((PetscObject)prob, name)); in PetscDSSetType()
99 PetscErrorCode PetscDSGetType(PetscDS prob, PetscDSType *name) in PetscDSGetType() argument
102 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetType()
105 *name = ((PetscObject)prob)->type_name; in PetscDSGetType()
256 PetscErrorCode PetscDSView(PetscDS prob, PetscViewer v) in PetscDSView() argument
261 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSView()
262 if (!v) PetscCall(PetscViewerASCIIGetStdout(PetscObjectComm((PetscObject)prob), &v)); in PetscDSView()
265 if (isascii) PetscCall(PetscDSView_Ascii(prob, v)); in PetscDSView()
266 PetscTryTypeMethod(prob, view, v); in PetscDSView()
289 PetscErrorCode PetscDSSetFromOptions(PetscDS prob) in PetscDSSetFromOptions() argument
297 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetFromOptions()
298 if (!((PetscObject)prob)->type_name) { in PetscDSSetFromOptions()
301 defaultType = ((PetscObject)prob)->type_name; in PetscDSSetFromOptions()
305 PetscObjectOptionsBegin((PetscObject)prob); in PetscDSSetFromOptions()
306 for (b = prob->boundary; b; b = b->next) { in PetscDSSetFromOptions()
334 PetscCall(PetscDSSetType(prob, name)); in PetscDSSetFromOptions()
335 } else if (!((PetscObject)prob)->type_name) { in PetscDSSetFromOptions()
336 PetscCall(PetscDSSetType(prob, defaultType)); in PetscDSSetFromOptions()
338 …jac_pre", "Discrete System", "PetscDSUseJacobianPreconditioner", prob->useJacPre, &prob->useJacPre… in PetscDSSetFromOptions()
339 …"-petscds_force_quad", "Discrete System", "PetscDSSetForceQuad", prob->forceQuad, &prob->forceQuad… in PetscDSSetFromOptions()
340 …cOptionsInt("-petscds_print_integrate", "Discrete System", "", prob->printIntegrate, &prob->printI… in PetscDSSetFromOptions()
341 PetscTryTypeMethod(prob, setfromoptions); in PetscDSSetFromOptions()
343 PetscCall(PetscObjectProcessOptionsHandlers((PetscObject)prob, PetscOptionsObject)); in PetscDSSetFromOptions()
345 if (prob->Nf) PetscCall(PetscDSViewFromOptions(prob, NULL, "-petscds_view")); in PetscDSSetFromOptions()
361 PetscErrorCode PetscDSSetUp(PetscDS prob) in PetscDSSetUp() argument
363 const PetscInt Nf = prob->Nf; in PetscDSSetUp()
369 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetUp()
370 if (prob->setup) PetscFunctionReturn(PETSC_SUCCESS); in PetscDSSetUp()
372 PetscCall(PetscDSGetSpatialDimension(prob, &dim)); in PetscDSSetUp()
373 PetscCall(PetscDSGetCoordinateDimension(prob, &dimEmbed)); in PetscDSSetUp()
374 prob->totDim = prob->totComp = 0; in PetscDSSetUp()
375 PetscCall(PetscMalloc2(Nf, &prob->Nc, Nf, &prob->Nb)); in PetscDSSetUp()
376 PetscCall(PetscCalloc2(Nf + 1, &prob->off, Nf + 1, &prob->offDer)); in PetscDSSetUp()
377prob->offCohesive[0], Nf + 1, &prob->offCohesive[1], Nf + 1, &prob->offCohesive[2], Nf + 1, &prob-… in PetscDSSetUp()
378 PetscCall(PetscMalloc2(Nf, &prob->T, Nf, &prob->Tf)); in PetscDSSetUp()
379 if (prob->forceQuad) { in PetscDSSetUp()
390 PetscCall(PetscDSGetDiscretization(prob, f, &obj)); in PetscDSSetUp()
426 PetscCall(PetscDSGetDiscretization(prob, f, &obj)); in PetscDSSetUp()
451 PetscCall(PetscDSGetDiscretization(prob, f, &obj)); in PetscDSSetUp()
452 if (prob->jetDegree[f] > 1) hasH = PETSC_TRUE; in PetscDSSetUp()
456 prob->T[f] = prob->Tf[f] = NULL; in PetscDSSetUp()
481 PetscCall(PetscFEGetCellTabulation(fe, prob->jetDegree[f], &prob->T[f])); in PetscDSSetUp()
482 PetscCall(PetscFEGetFaceTabulation(fe, prob->jetDegree[f], &prob->Tf[f])); in PetscDSSetUp()
489 PetscCall(PetscFVGetCellTabulation(fv, &prob->T[f])); in PetscDSSetUp()
491 …} else SETERRQ(PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_WRONG, "Unknown discretization ty… in PetscDSSetUp()
493 prob->Nc[f] = Nc; in PetscDSSetUp()
494 prob->Nb[f] = Nb; in PetscDSSetUp()
495 prob->off[f + 1] = Nc + prob->off[f]; in PetscDSSetUp()
496 prob->offDer[f + 1] = Nc * dim + prob->offDer[f]; in PetscDSSetUp()
497 prob->offCohesive[0][f + 1] = (prob->cohesive[f] ? Nc : Nc * 2) + prob->offCohesive[0][f]; in PetscDSSetUp()
498prob->offDerCohesive[0][f + 1] = (prob->cohesive[f] ? Nc : Nc * 2) * dimEmbed + prob->offDerCohesi… in PetscDSSetUp()
499 prob->offCohesive[1][f] = (prob->cohesive[f] ? 0 : Nc) + prob->offCohesive[0][f]; in PetscDSSetUp()
500prob->offDerCohesive[1][f] = (prob->cohesive[f] ? 0 : Nc) * dimEmbed + prob->offDerCohesive[0]… in PetscDSSetUp()
501 prob->offCohesive[2][f + 1] = (prob->cohesive[f] ? Nc : Nc * 2) + prob->offCohesive[2][f]; in PetscDSSetUp()
502prob->offDerCohesive[2][f + 1] = (prob->cohesive[f] ? Nc : Nc * 2) * dimEmbed + prob->offDerCohesi… in PetscDSSetUp()
507 prob->totDim += Nb; in PetscDSSetUp()
508 prob->totComp += Nc; in PetscDSSetUp()
510 if (prob->isCohesive && !prob->cohesive[f]) prob->totDim += Nb; in PetscDSSetUp()
512 prob->offCohesive[1][Nf] = prob->offCohesive[0][Nf]; in PetscDSSetUp()
513 prob->offDerCohesive[1][Nf] = prob->offDerCohesive[0][Nf]; in PetscDSSetUp()
516prob->totComp, &prob->u, NsMax * prob->totComp, &prob->u_t, NsMax * prob->totComp * dimEmbed + (ha… in PetscDSSetUp()
517prob->x, NbMax * NcMax, &prob->basisReal, NbMax * NcMax * dimEmbed, &prob->basisDerReal, NbMax * N… in PetscDSSetUp()
518prob->f0, NsMax * NqMax * NcMax * dimEmbed, &prob->f1, NsMax * NsMax * NqMax * NcMax * NcMax, &pro… in PetscDSSetUp()
519 … &prob->g2, NsMax * NsMax * NqMax * NcMax * NcMax * dimEmbed * dimEmbed, &prob->g3)); in PetscDSSetUp()
520 PetscTryTypeMethod(prob, setup); in PetscDSSetUp()
521 prob->setup = PETSC_TRUE; in PetscDSSetUp()
525 static PetscErrorCode PetscDSDestroyStructs_Static(PetscDS prob) in PetscDSDestroyStructs_Static() argument
528 PetscCall(PetscFree2(prob->Nc, prob->Nb)); in PetscDSDestroyStructs_Static()
529 PetscCall(PetscFree2(prob->off, prob->offDer)); in PetscDSDestroyStructs_Static()
530 …Call(PetscFree6(prob->offCohesive[0], prob->offCohesive[1], prob->offCohesive[2], prob->offDerCohe… in PetscDSDestroyStructs_Static()
531 PetscCall(PetscFree2(prob->T, prob->Tf)); in PetscDSDestroyStructs_Static()
532 PetscCall(PetscFree3(prob->u, prob->u_t, prob->u_x)); in PetscDSDestroyStructs_Static()
533 …PetscCall(PetscFree5(prob->x, prob->basisReal, prob->basisDerReal, prob->testReal, prob->testDerRe… in PetscDSDestroyStructs_Static()
534 PetscCall(PetscFree6(prob->f0, prob->f1, prob->g0, prob->g1, prob->g2, prob->g3)); in PetscDSDestroyStructs_Static()
538 static PetscErrorCode PetscDSEnlarge_Static(PetscDS prob, PetscInt NfNew) in PetscDSEnlarge_Static() argument
548 PetscInt Nf = prob->Nf, f; in PetscDSEnlarge_Static()
552 prob->setup = PETSC_FALSE; in PetscDSEnlarge_Static()
553 PetscCall(PetscDSDestroyStructs_Static(prob)); in PetscDSEnlarge_Static()
556 tmpd[f] = prob->disc[f]; in PetscDSEnlarge_Static()
557 tmpi[f] = prob->implicit[f]; in PetscDSEnlarge_Static()
558 tmpc[f] = prob->cohesive[f]; in PetscDSEnlarge_Static()
559 tmpk[f] = prob->jetDegree[f]; in PetscDSEnlarge_Static()
566 PetscCall(PetscFree4(prob->disc, prob->implicit, prob->cohesive, prob->jetDegree)); in PetscDSEnlarge_Static()
567 PetscCall(PetscWeakFormSetNumFields(prob->wf, NfNew)); in PetscDSEnlarge_Static()
568 prob->Nf = NfNew; in PetscDSEnlarge_Static()
569 prob->disc = tmpd; in PetscDSEnlarge_Static()
570 prob->implicit = tmpi; in PetscDSEnlarge_Static()
571 prob->cohesive = tmpc; in PetscDSEnlarge_Static()
572 prob->jetDegree = tmpk; in PetscDSEnlarge_Static()
574 for (f = 0; f < Nf; ++f) tmpup[f] = prob->update[f]; in PetscDSEnlarge_Static()
575 for (f = 0; f < Nf; ++f) tmpctx[f] = prob->ctx[f]; in PetscDSEnlarge_Static()
578 PetscCall(PetscFree2(prob->update, prob->ctx)); in PetscDSEnlarge_Static()
579 prob->update = tmpup; in PetscDSEnlarge_Static()
580 prob->ctx = tmpctx; in PetscDSEnlarge_Static()
583 for (f = 0; f < Nf; ++f) tmpexactSol[f] = prob->exactSol[f]; in PetscDSEnlarge_Static()
584 for (f = 0; f < Nf; ++f) tmpexactCtx[f] = prob->exactCtx[f]; in PetscDSEnlarge_Static()
585 for (f = 0; f < Nf; ++f) tmpexactSol_t[f] = prob->exactSol_t[f]; in PetscDSEnlarge_Static()
586 for (f = 0; f < Nf; ++f) tmpexactCtx_t[f] = prob->exactCtx_t[f]; in PetscDSEnlarge_Static()
587 for (f = 0; f < Nf; ++f) tmplowerBound[f] = prob->lowerBound[f]; in PetscDSEnlarge_Static()
588 for (f = 0; f < Nf; ++f) tmplowerCtx[f] = prob->lowerCtx[f]; in PetscDSEnlarge_Static()
589 for (f = 0; f < Nf; ++f) tmpupperBound[f] = prob->upperBound[f]; in PetscDSEnlarge_Static()
590 for (f = 0; f < Nf; ++f) tmpupperCtx[f] = prob->upperCtx[f]; in PetscDSEnlarge_Static()
599 PetscCall(PetscFree4(prob->exactSol, prob->exactCtx, prob->exactSol_t, prob->exactCtx_t)); in PetscDSEnlarge_Static()
600 PetscCall(PetscFree4(prob->lowerBound, prob->lowerCtx, prob->upperBound, prob->upperCtx)); in PetscDSEnlarge_Static()
601 prob->exactSol = tmpexactSol; in PetscDSEnlarge_Static()
602 prob->exactCtx = tmpexactCtx; in PetscDSEnlarge_Static()
603 prob->exactSol_t = tmpexactSol_t; in PetscDSEnlarge_Static()
604 prob->exactCtx_t = tmpexactCtx_t; in PetscDSEnlarge_Static()
605 prob->lowerBound = tmplowerBound; in PetscDSEnlarge_Static()
606 prob->lowerCtx = tmplowerCtx; in PetscDSEnlarge_Static()
607 prob->upperBound = tmpupperBound; in PetscDSEnlarge_Static()
608 prob->upperCtx = tmpupperCtx; in PetscDSEnlarge_Static()
718 PetscErrorCode PetscDSGetNumFields(PetscDS prob, PetscInt *Nf) in PetscDSGetNumFields() argument
721 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetNumFields()
723 *Nf = prob->Nf; in PetscDSGetNumFields()
742 PetscErrorCode PetscDSGetSpatialDimension(PetscDS prob, PetscInt *dim) in PetscDSGetSpatialDimension() argument
745 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetSpatialDimension()
748 if (prob->Nf) { in PetscDSGetSpatialDimension()
752 PetscCall(PetscDSGetDiscretization(prob, 0, &obj)); in PetscDSGetSpatialDimension()
757 …else SETERRQ(PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_WRONG, "Unknown discretization type… in PetscDSGetSpatialDimension()
778 PetscErrorCode PetscDSGetCoordinateDimension(PetscDS prob, PetscInt *dimEmbed) in PetscDSGetCoordinateDimension() argument
781 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetCoordinateDimension()
783 …PetscCheck(prob->dimEmbed >= 0, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_WRONGSTATE, "No … in PetscDSGetCoordinateDimension()
784 *dimEmbed = prob->dimEmbed; in PetscDSGetCoordinateDimension()
801 PetscErrorCode PetscDSSetCoordinateDimension(PetscDS prob, PetscInt dimEmbed) in PetscDSSetCoordinateDimension() argument
804 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetCoordinateDimension()
806 prob->dimEmbed = dimEmbed; in PetscDSSetCoordinateDimension()
974 PetscErrorCode PetscDSGetTotalDimension(PetscDS prob, PetscInt *dim) in PetscDSGetTotalDimension() argument
977 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetTotalDimension()
978 PetscCall(PetscDSSetUp(prob)); in PetscDSGetTotalDimension()
980 *dim = prob->totDim; in PetscDSGetTotalDimension()
999 PetscErrorCode PetscDSGetTotalComponents(PetscDS prob, PetscInt *Nc) in PetscDSGetTotalComponents() argument
1002 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetTotalComponents()
1003 PetscCall(PetscDSSetUp(prob)); in PetscDSGetTotalComponents()
1005 *Nc = prob->totComp; in PetscDSGetTotalComponents()
1025 PetscErrorCode PetscDSGetDiscretization(PetscDS prob, PetscInt f, PetscObject *disc) in PetscDSGetDiscretization() argument
1028 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetDiscretization()
1030 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetDiscretization()
1031 *disc = prob->disc[f]; in PetscDSGetDiscretization()
1049 PetscErrorCode PetscDSSetDiscretization(PetscDS prob, PetscInt f, PetscObject disc) in PetscDSSetDiscretization() argument
1052 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetDiscretization()
1055 PetscCall(PetscDSEnlarge_Static(prob, f + 1)); in PetscDSSetDiscretization()
1056 PetscCall(PetscObjectDereference(prob->disc[f])); in PetscDSSetDiscretization()
1057 prob->disc[f] = disc; in PetscDSSetDiscretization()
1064 PetscCall(PetscDSSetImplicit(prob, f, PETSC_TRUE)); in PetscDSSetDiscretization()
1066 PetscCall(PetscDSSetImplicit(prob, f, PETSC_FALSE)); in PetscDSSetDiscretization()
1068 PetscCall(PetscDSSetJetDegree(prob, f, 1)); in PetscDSSetDiscretization()
1135 PetscErrorCode PetscDSAddDiscretization(PetscDS prob, PetscObject disc) in PetscDSAddDiscretization() argument
1138 PetscCall(PetscDSSetDiscretization(prob, prob->Nf, disc)); in PetscDSAddDiscretization()
1157 PetscErrorCode PetscDSGetQuadrature(PetscDS prob, PetscQuadrature *q) in PetscDSGetQuadrature() argument
1164 if (!prob->Nf) PetscFunctionReturn(PETSC_SUCCESS); in PetscDSGetQuadrature()
1165 PetscCall(PetscDSGetDiscretization(prob, 0, &obj)); in PetscDSGetQuadrature()
1169 …else SETERRQ(PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_WRONG, "Unknown discretization type… in PetscDSGetQuadrature()
1189 PetscErrorCode PetscDSGetImplicit(PetscDS prob, PetscInt f, PetscBool *implicit) in PetscDSGetImplicit() argument
1192 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetImplicit()
1194 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetImplicit()
1195 *implicit = prob->implicit[f]; in PetscDSGetImplicit()
1213 PetscErrorCode PetscDSSetImplicit(PetscDS prob, PetscInt f, PetscBool implicit) in PetscDSSetImplicit() argument
1216 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetImplicit()
1217 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSSetImplicit()
1218 prob->implicit[f] = implicit; in PetscDSSetImplicit()
1581 PetscErrorCode PetscDSUseJacobianPreconditioner(PetscDS prob, PetscBool useJacPre) in PetscDSUseJacobianPreconditioner() argument
1584 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSUseJacobianPreconditioner()
1585 prob->useJacPre = useJacPre; in PetscDSUseJacobianPreconditioner()
2291 PetscErrorCode PetscDSGetExactSolution(PetscDS prob, PetscInt f, PetscPointExactSolutionFn **sol, v… in PetscDSGetExactSolution() argument
2294 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetExactSolution()
2295 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetExactSolution()
2298 *sol = prob->exactSol[f]; in PetscDSGetExactSolution()
2302 *ctx = prob->exactCtx[f]; in PetscDSGetExactSolution()
2322 PetscErrorCode PetscDSSetExactSolution(PetscDS prob, PetscInt f, PetscPointExactSolutionFn *sol, Pe… in PetscDSSetExactSolution() argument
2325 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetExactSolution()
2327 PetscCall(PetscDSEnlarge_Static(prob, f + 1)); in PetscDSSetExactSolution()
2330 prob->exactSol[f] = sol; in PetscDSSetExactSolution()
2334 prob->exactCtx[f] = ctx; in PetscDSSetExactSolution()
2356 PetscErrorCode PetscDSGetExactSolutionTimeDerivative(PetscDS prob, PetscInt f, PetscPointExactSolut… in PetscDSGetExactSolutionTimeDerivative() argument
2359 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetExactSolutionTimeDerivative()
2360 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetExactSolutionTimeDerivative()
2363 *sol = prob->exactSol_t[f]; in PetscDSGetExactSolutionTimeDerivative()
2367 *ctx = prob->exactCtx_t[f]; in PetscDSGetExactSolutionTimeDerivative()
2387 PetscErrorCode PetscDSSetExactSolutionTimeDerivative(PetscDS prob, PetscInt f, PetscPointExactSolut… in PetscDSSetExactSolutionTimeDerivative() argument
2390 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSetExactSolutionTimeDerivative()
2392 PetscCall(PetscDSEnlarge_Static(prob, f + 1)); in PetscDSSetExactSolutionTimeDerivative()
2395 prob->exactSol_t[f] = sol; in PetscDSSetExactSolutionTimeDerivative()
2399 prob->exactCtx_t[f] = ctx; in PetscDSSetExactSolutionTimeDerivative()
2655 PetscErrorCode PetscDSGetFieldIndex(PetscDS prob, PetscObject disc, PetscInt *f) in PetscDSGetFieldIndex() argument
2660 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetFieldIndex()
2663 for (g = 0; g < prob->Nf; ++g) { in PetscDSGetFieldIndex()
2664 if (disc == prob->disc[g]) break; in PetscDSGetFieldIndex()
2666 …PetscCheck(g != prob->Nf, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_WRONG, "Field not foun… in PetscDSGetFieldIndex()
2687 PetscErrorCode PetscDSGetFieldSize(PetscDS prob, PetscInt f, PetscInt *size) in PetscDSGetFieldSize() argument
2690 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetFieldSize()
2692 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetFieldSize()
2693 PetscCall(PetscDSSetUp(prob)); in PetscDSGetFieldSize()
2694 *size = prob->Nb[f]; in PetscDSGetFieldSize()
2714 PetscErrorCode PetscDSGetFieldOffset(PetscDS prob, PetscInt f, PetscInt *off) in PetscDSGetFieldOffset() argument
2719 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetFieldOffset()
2721 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetFieldOffset()
2724 PetscCall(PetscDSGetFieldSize(prob, g, &size)); in PetscDSGetFieldOffset()
2780 PetscErrorCode PetscDSGetDimensions(PetscDS prob, PetscInt *dimensions[]) in PetscDSGetDimensions() argument
2783 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetDimensions()
2784 PetscCall(PetscDSSetUp(prob)); in PetscDSGetDimensions()
2786 *dimensions = prob->Nb; in PetscDSGetDimensions()
2805 PetscErrorCode PetscDSGetComponents(PetscDS prob, PetscInt *components[]) in PetscDSGetComponents() argument
2808 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetComponents()
2809 PetscCall(PetscDSSetUp(prob)); in PetscDSGetComponents()
2811 *components = prob->Nc; in PetscDSGetComponents()
2831 PetscErrorCode PetscDSGetComponentOffset(PetscDS prob, PetscInt f, PetscInt *off) in PetscDSGetComponentOffset() argument
2834 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetComponentOffset()
2836 …) && !(f >= prob->Nf), PETSC_COMM_SELF, PETSC_ERR_ARG_OUTOFRANGE, "Field number %" PetscInt_FMT " … in PetscDSGetComponentOffset()
2837 PetscCall(PetscDSSetUp(prob)); in PetscDSGetComponentOffset()
2838 *off = prob->off[f]; in PetscDSGetComponentOffset()
2857 PetscErrorCode PetscDSGetComponentOffsets(PetscDS prob, PetscInt *offsets[]) in PetscDSGetComponentOffsets() argument
2860 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetComponentOffsets()
2862 PetscCall(PetscDSSetUp(prob)); in PetscDSGetComponentOffsets()
2863 *offsets = prob->off; in PetscDSGetComponentOffsets()
2882 PetscErrorCode PetscDSGetComponentDerivativeOffsets(PetscDS prob, PetscInt *offsets[]) in PetscDSGetComponentDerivativeOffsets() argument
2885 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetComponentDerivativeOffsets()
2887 PetscCall(PetscDSSetUp(prob)); in PetscDSGetComponentDerivativeOffsets()
2888 *offsets = prob->offDer; in PetscDSGetComponentDerivativeOffsets()
2983 PetscErrorCode PetscDSGetTabulation(PetscDS prob, PetscTabulation *T[]) PeNS in PetscDSGetTabulation() argument
2986 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetTabulation()
2988 PetscCall(PetscDSSetUp(prob)); in PetscDSGetTabulation()
2989 *T = prob->T; in PetscDSGetTabulation()
3011 PetscErrorCode PetscDSGetFaceTabulation(PetscDS prob, PetscTabulation *Tf[]) in PetscDSGetFaceTabulation() argument
3014 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetFaceTabulation()
3016 PetscCall(PetscDSSetUp(prob)); in PetscDSGetFaceTabulation()
3017 *Tf = prob->Tf; in PetscDSGetFaceTabulation()
3021 PetscErrorCode PetscDSGetEvaluationArrays(PetscDS prob, PetscScalar *u[], PetscScalar *u_t[], Petsc… in PetscDSGetEvaluationArrays() argument
3024 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetEvaluationArrays()
3025 PetscCall(PetscDSSetUp(prob)); in PetscDSGetEvaluationArrays()
3028 *u = prob->u; in PetscDSGetEvaluationArrays()
3032 *u_t = prob->u_t; in PetscDSGetEvaluationArrays()
3036 *u_x = prob->u_x; in PetscDSGetEvaluationArrays()
3041 PetscErrorCode PetscDSGetWeakFormArrays(PetscDS prob, PetscScalar *f0[], PetscScalar *f1[], PetscSc… in PetscDSGetWeakFormArrays() argument
3044 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetWeakFormArrays()
3045 PetscCall(PetscDSSetUp(prob)); in PetscDSGetWeakFormArrays()
3048 *f0 = prob->f0; in PetscDSGetWeakFormArrays()
3052 *f1 = prob->f1; in PetscDSGetWeakFormArrays()
3056 *g0 = prob->g0; in PetscDSGetWeakFormArrays()
3060 *g1 = prob->g1; in PetscDSGetWeakFormArrays()
3064 *g2 = prob->g2; in PetscDSGetWeakFormArrays()
3068 *g3 = prob->g3; in PetscDSGetWeakFormArrays()
3073 PetscErrorCode PetscDSGetWorkspace(PetscDS prob, PetscReal **x, PetscScalar **basisReal, PetscScala… in PetscDSGetWorkspace() argument
3076 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetWorkspace()
3077 PetscCall(PetscDSSetUp(prob)); in PetscDSGetWorkspace()
3080 *x = prob->x; in PetscDSGetWorkspace()
3084 *basisReal = prob->basisReal; in PetscDSGetWorkspace()
3088 *basisDerReal = prob->basisDerReal; in PetscDSGetWorkspace()
3092 *testReal = prob->testReal; in PetscDSGetWorkspace()
3096 *testDerReal = prob->testDerReal; in PetscDSGetWorkspace()
3689 PetscErrorCode PetscDSSelectDiscretizations(PetscDS prob, PetscInt numFields, const PetscInt fields… in PetscDSSelectDiscretizations() argument
3694 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSelectDiscretizations()
3697 PetscCall(PetscDSGetNumFields(prob, &Nf)); in PetscDSSelectDiscretizations()
3706 PetscCall(PetscDSGetDiscretization(prob, f, &disc)); in PetscDSSelectDiscretizations()
3738 PetscErrorCode PetscDSSelectEquations(PetscDS prob, PetscInt numFields, const PetscInt fields[], Pe… in PetscDSSelectEquations() argument
3743 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSSelectEquations()
3746 PetscCall(PetscDSGetNumFields(prob, &Nf)); in PetscDSSelectEquations()
3748 …PetscCheck(numFields <= Nfn, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_SIZ, "Number of fie… in PetscDSSelectEquations()
3757 PetscCall(PetscDSGetObjective(prob, f, &obj)); in PetscDSSelectEquations()
3758 PetscCall(PetscDSGetResidual(prob, f, &f0, &f1)); in PetscDSSelectEquations()
3759 PetscCall(PetscDSGetBdResidual(prob, f, &f0Bd, &f1Bd)); in PetscDSSelectEquations()
3760 PetscCall(PetscDSGetRiemannSolver(prob, f, &r)); in PetscDSSelectEquations()
3772 PetscCall(PetscDSGetJacobian(prob, f, g, &g0, &g1, &g2, &g3)); in PetscDSSelectEquations()
3773 PetscCall(PetscDSGetJacobianPreconditioner(prob, f, g, &g0p, &g1p, &g2p, &g3p)); in PetscDSSelectEquations()
3774 PetscCall(PetscDSGetBdJacobian(prob, f, g, &g0Bd, &g1Bd, &g2Bd, &g3Bd)); in PetscDSSelectEquations()
3798 PetscErrorCode PetscDSCopyEquations(PetscDS prob, PetscDS newprob) in PetscDSCopyEquations() argument
3804 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSCopyEquations()
3806 PetscCall(PetscDSGetNumFields(prob, &Nf)); in PetscDSCopyEquations()
3808 …PetscCheck(Nf == Ng, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_SIZ, "Number of fields must… in PetscDSCopyEquations()
3809 PetscCall(PetscDSGetWeakForm(prob, &wf)); in PetscDSCopyEquations()
3830 PetscErrorCode PetscDSCopyConstants(PetscDS prob, PetscDS newprob) in PetscDSCopyConstants() argument
3836 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSCopyConstants()
3838 PetscCall(PetscDSGetConstants(prob, &Nc, &constants)); in PetscDSCopyConstants()
3946 PetscErrorCode PetscDSGetHeightSubspace(PetscDS prob, PetscInt height, PetscDS *subprob) in PetscDSGetHeightSubspace() argument
3951 PetscValidHeaderSpecific(prob, PETSCDS_CLASSID, 1); in PetscDSGetHeightSubspace()
3954 *subprob = prob; in PetscDSGetHeightSubspace()
3957 PetscCall(PetscDSGetNumFields(prob, &Nf)); in PetscDSGetHeightSubspace()
3958 PetscCall(PetscDSGetSpatialDimension(prob, &dim)); in PetscDSGetHeightSubspace()
3959 …PetscCheck(height <= dim, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_OUTOFRANGE, "DS can on… in PetscDSGetHeightSubspace()
3960 if (!prob->subprobs) PetscCall(PetscCalloc1(dim, &prob->subprobs)); in PetscDSGetHeightSubspace()
3961 if (!prob->subprobs[height - 1]) { in PetscDSGetHeightSubspace()
3964 PetscCall(PetscDSCreate(PetscObjectComm((PetscObject)prob), &prob->subprobs[height - 1])); in PetscDSGetHeightSubspace()
3965 PetscCall(PetscDSGetCoordinateDimension(prob, &cdim)); in PetscDSGetHeightSubspace()
3966 PetscCall(PetscDSSetCoordinateDimension(prob->subprobs[height - 1], cdim)); in PetscDSGetHeightSubspace()
3972 PetscCall(PetscDSGetDiscretization(prob, f, &obj)); in PetscDSGetHeightSubspace()
3974 …PetscCheck(id == PETSCFE_CLASSID, PetscObjectComm((PetscObject)prob), PETSC_ERR_ARG_WRONG, "Unsupp… in PetscDSGetHeightSubspace()
3976 PetscCall(PetscDSSetDiscretization(prob->subprobs[height - 1], f, (PetscObject)subfe)); in PetscDSGetHeightSubspace()
3979 *subprob = prob->subprobs[height - 1]; in PetscDSGetHeightSubspace()