Lines Matching refs:patch

50   PC_PATCH *patch = (PC_PATCH *)vpatch;  in PCPatchConstruct_Vanka()  local
61 if (patch->vankadim >= 0) { in PCPatchConstruct_Vanka()
63 PetscCall(DMPlexGetDepthStratum(dm, patch->vankadim, &iStart, &iEnd)); in PCPatchConstruct_Vanka()
91 PC_PATCH *patch = (PC_PATCH *)vpatch; in PCPatchConstruct_Pardecomp() local
129 for (overlapi = 0; overlapi < patch->pardecomp_overlap; ++overlapi) { in PCPatchConstruct_Pardecomp()
167 PC_PATCH *patch = (PC_PATCH *)vpatch; in PCPatchConstruct_User() local
168 IS patchis = patch->userIS[point]; in PCPatchConstruct_User()
190 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchCreateDefaultSF_Private() local
194 patch->sectionSF = sf[0]; in PCPatchCreateDefaultSF_Private()
195 PetscCall(PetscObjectReference((PetscObject)patch->sectionSF)); in PCPatchCreateDefaultSF_Private()
303 PetscCall(PetscSFCreate(PetscObjectComm((PetscObject)pc), &patch->sectionSF)); in PCPatchCreateDefaultSF_Private()
304 …PetscCall(PetscSFSetGraph(patch->sectionSF, allRoots, allLeaves, ilocal, PETSC_OWN_POINTER, iremot… in PCPatchCreateDefaultSF_Private()
312 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetIgnoreDim() local
315 *dim = patch->ignoredim; in PCPatchGetIgnoreDim()
322 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetSaveOperators() local
325 patch->save_operators = flg; in PCPatchSetSaveOperators()
332 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetSaveOperators() local
335 *flg = patch->save_operators; in PCPatchGetSaveOperators()
342 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetPrecomputeElementTensors() local
345 patch->precomputeElementTensors = flg; in PCPatchSetPrecomputeElementTensors()
352 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetPrecomputeElementTensors() local
355 *flg = patch->precomputeElementTensors; in PCPatchGetPrecomputeElementTensors()
362 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetPartitionOfUnity() local
365 patch->partition_of_unity = flg; in PCPatchSetPartitionOfUnity()
372 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetPartitionOfUnity() local
375 *flg = patch->partition_of_unity; in PCPatchGetPartitionOfUnity()
382 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetLocalComposition() local
386 patch->local_composition_type = type; in PCPatchSetLocalComposition()
393 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetSubKSP() local
397 PetscCall(PetscMalloc1(patch->npatch, ksp)); in PCPatchGetSubKSP()
398 for (PetscInt i = 0; i < patch->npatch; ++i) (*ksp)[i] = (KSP)patch->solver[i]; in PCPatchGetSubKSP()
399 if (npatch) *npatch = patch->npatch; in PCPatchGetSubKSP()
406 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetSubMatType() local
409 if (patch->sub_mat_type) PetscCall(PetscFree(patch->sub_mat_type)); in PCPatchSetSubMatType()
410 PetscCall(PetscStrallocpy(sub_mat_type, (char **)&patch->sub_mat_type)); in PCPatchSetSubMatType()
417 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetSubMatType() local
420 *sub_mat_type = patch->sub_mat_type; in PCPatchGetSubMatType()
427 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetCellNumbering() local
430 patch->cellNumbering = cellNumbering; in PCPatchSetCellNumbering()
438 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetCellNumbering() local
441 *cellNumbering = patch->cellNumbering; in PCPatchGetCellNumbering()
448 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetConstructType() local
451 patch->ctype = ctype; in PCPatchSetConstructType()
454 patch->user_patches = PETSC_FALSE; in PCPatchSetConstructType()
455 patch->patchconstructop = PCPatchConstruct_Star; in PCPatchSetConstructType()
458 patch->user_patches = PETSC_FALSE; in PCPatchSetConstructType()
459 patch->patchconstructop = PCPatchConstruct_Vanka; in PCPatchSetConstructType()
462 patch->user_patches = PETSC_FALSE; in PCPatchSetConstructType()
463 patch->patchconstructop = PCPatchConstruct_Pardecomp; in PCPatchSetConstructType()
467 patch->user_patches = PETSC_TRUE; in PCPatchSetConstructType()
468 patch->patchconstructop = PCPatchConstruct_User; in PCPatchSetConstructType()
470 patch->userpatchconstructionop = func; in PCPatchSetConstructType()
471 patch->userpatchconstructctx = ctx; in PCPatchSetConstructType()
475 …ect)pc), PETSC_ERR_USER, "Unknown patch construction type %" PetscInt_FMT, (PetscInt)patch->ctype); in PCPatchSetConstructType()
483 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetConstructType() local
486 *ctype = patch->ctype; in PCPatchGetConstructType()
487 switch (patch->ctype) { in PCPatchGetConstructType()
494 *func = patch->userpatchconstructionop; in PCPatchGetConstructType()
495 *ctx = patch->userpatchconstructctx; in PCPatchGetConstructType()
498 …ect)pc), PETSC_ERR_USER, "Unknown patch construction type %" PetscInt_FMT, (PetscInt)patch->ctype); in PCPatchGetConstructType()
506 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetDiscretisationInfo() local
517 PetscCall(PetscMalloc1(nsubspaces, &patch->dofSection)); in PCPatchSetDiscretisationInfo()
518 PetscCall(PetscMalloc1(nsubspaces, &patch->bs)); in PCPatchSetDiscretisationInfo()
519 PetscCall(PetscMalloc1(nsubspaces, &patch->nodesPerCell)); in PCPatchSetDiscretisationInfo()
520 PetscCall(PetscMalloc1(nsubspaces, &patch->cellNodeMap)); in PCPatchSetDiscretisationInfo()
521 PetscCall(PetscMalloc1(nsubspaces + 1, &patch->subspaceOffsets)); in PCPatchSetDiscretisationInfo()
523 patch->nsubspaces = nsubspaces; in PCPatchSetDiscretisationInfo()
524 patch->totalDofsPerCell = 0; in PCPatchSetDiscretisationInfo()
526 PetscCall(DMGetLocalSection(dms[i], &patch->dofSection[i])); in PCPatchSetDiscretisationInfo()
527 PetscCall(PetscObjectReference((PetscObject)patch->dofSection[i])); in PCPatchSetDiscretisationInfo()
529 patch->bs[i] = bs[i]; in PCPatchSetDiscretisationInfo()
530 patch->nodesPerCell[i] = nodesPerCell[i]; in PCPatchSetDiscretisationInfo()
531 patch->totalDofsPerCell += nodesPerCell[i] * bs[i]; in PCPatchSetDiscretisationInfo()
532 PetscCall(PetscMalloc1((cEnd - cStart) * nodesPerCell[i], &patch->cellNodeMap[i])); in PCPatchSetDiscretisationInfo()
533 …for (j = 0; j < (cEnd - cStart) * nodesPerCell[i]; ++j) patch->cellNodeMap[i][j] = cellNodeMap[i][… in PCPatchSetDiscretisationInfo()
534 patch->subspaceOffsets[i] = subspaceOffsets[i]; in PCPatchSetDiscretisationInfo()
536 PetscCall(PCPatchCreateDefaultSF_Private(pc, nsubspaces, sfs, patch->bs)); in PCPatchSetDiscretisationInfo()
539 patch->subspaceOffsets[nsubspaces] = subspaceOffsets[nsubspaces]; in PCPatchSetDiscretisationInfo()
540 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numGhostBcs, ghostBcNodes, PETSC_COPY_VALUES, &patch->g… in PCPatchSetDiscretisationInfo()
541 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numGlobalBcs, globalBcNodes, PETSC_COPY_VALUES, &patch-… in PCPatchSetDiscretisationInfo()
549 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetDiscretisationInfoCombined() local
553 patch->combined = PETSC_TRUE; in PCPatchSetDiscretisationInfoCombined()
555 PetscCall(DMGetNumFields(dm, &patch->nsubspaces)); in PCPatchSetDiscretisationInfoCombined()
556 PetscCall(PetscCalloc1(patch->nsubspaces, &patch->dofSection)); in PCPatchSetDiscretisationInfoCombined()
557 PetscCall(PetscMalloc1(patch->nsubspaces, &patch->bs)); in PCPatchSetDiscretisationInfoCombined()
558 PetscCall(PetscMalloc1(patch->nsubspaces, &patch->nodesPerCell)); in PCPatchSetDiscretisationInfoCombined()
559 PetscCall(PetscMalloc1(patch->nsubspaces, &patch->cellNodeMap)); in PCPatchSetDiscretisationInfoCombined()
560 PetscCall(PetscCalloc1(patch->nsubspaces + 1, &patch->subspaceOffsets)); in PCPatchSetDiscretisationInfoCombined()
561 PetscCall(DMGetLocalSection(dm, &patch->dofSection[0])); in PCPatchSetDiscretisationInfoCombined()
562 PetscCall(PetscObjectReference((PetscObject)patch->dofSection[0])); in PCPatchSetDiscretisationInfoCombined()
563 …PetscCall(PetscSectionGetStorageSize(patch->dofSection[0], &patch->subspaceOffsets[patch->nsubspac… in PCPatchSetDiscretisationInfoCombined()
564 patch->totalDofsPerCell = 0; in PCPatchSetDiscretisationInfoCombined()
565 for (i = 0; i < patch->nsubspaces; ++i) { in PCPatchSetDiscretisationInfoCombined()
566 patch->bs[i] = 1; in PCPatchSetDiscretisationInfoCombined()
567 patch->nodesPerCell[i] = nodesPerCell[i]; in PCPatchSetDiscretisationInfoCombined()
568 patch->totalDofsPerCell += nodesPerCell[i]; in PCPatchSetDiscretisationInfoCombined()
569 PetscCall(PetscMalloc1((cEnd - cStart) * nodesPerCell[i], &patch->cellNodeMap[i])); in PCPatchSetDiscretisationInfoCombined()
570 …for (j = 0; j < (cEnd - cStart) * nodesPerCell[i]; ++j) patch->cellNodeMap[i][j] = cellNodeMap[i][… in PCPatchSetDiscretisationInfoCombined()
572 PetscCall(DMGetSectionSF(dm, &patch->sectionSF)); in PCPatchSetDiscretisationInfoCombined()
573 PetscCall(PetscObjectReference((PetscObject)patch->sectionSF)); in PCPatchSetDiscretisationInfoCombined()
574 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numGhostBcs, ghostBcNodes, PETSC_COPY_VALUES, &patch->g… in PCPatchSetDiscretisationInfoCombined()
575 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numGlobalBcs, globalBcNodes, PETSC_COPY_VALUES, &patch-… in PCPatchSetDiscretisationInfoCombined()
609 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetComputeFunction() local
612 patch->usercomputef = func; in PCPatchSetComputeFunction()
613 patch->usercomputefctx = ctx; in PCPatchSetComputeFunction()
647 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetComputeFunctionInteriorFacets() local
650 patch->usercomputefintfacet = func; in PCPatchSetComputeFunctionInteriorFacets()
651 patch->usercomputefintfacetctx = ctx; in PCPatchSetComputeFunctionInteriorFacets()
685 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetComputeOperator() local
688 patch->usercomputeop = func; in PCPatchSetComputeOperator()
689 patch->usercomputeopctx = ctx; in PCPatchSetComputeOperator()
723 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchSetComputeOperatorInteriorFacets() local
726 patch->usercomputeopintfacet = func; in PCPatchSetComputeOperatorInteriorFacets()
727 patch->usercomputeopintfacetctx = ctx; in PCPatchSetComputeOperatorInteriorFacets()
739 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchCompleteCellPatch() local
774 if (patch->usercomputeopintfacet) { in PCPatchCompleteCellPatch()
807 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetGlobalDofs() local
812 for (g = 0; g < patch->nsubspaces; ++g) { in PCPatchGetGlobalDofs()
819 for (g = 0; g < patch->nsubspaces; ++g) { in PCPatchGetGlobalDofs()
839 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchGetPointDofs() local
846 for (k = 0; k < patch->nsubspaces; ++k) { in PCPatchGetPointDofs()
847 PetscInt subspaceOffset = patch->subspaceOffsets[k]; in PCPatchGetPointDofs()
848 PetscInt bs = patch->bs[k]; in PCPatchGetPointDofs()
856 … PetscCall(PCPatchGetGlobalDofs(pc, patch->dofSection, k, patch->combined, base, &ldof, &loff)); in PCPatchGetPointDofs()
872 PetscCall(PCPatchGetGlobalDofs(pc, patch->dofSection, k, patch->combined, p, &ldof, &loff)); in PCPatchGetPointDofs()
919 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchCreateCellPatches() local
942 if (patch->user_patches) { in PCPatchCreateCellPatches()
943 …PetscCall(patch->userpatchconstructionop(pc, &patch->npatch, &patch->userIS, &patch->iterationSet,… in PCPatchCreateCellPatches()
945 vEnd = patch->npatch; in PCPatchCreateCellPatches()
946 } else if (patch->ctype == PC_PATCH_PARDECOMP) { in PCPatchCreateCellPatches()
949 } else if (patch->codim < 0) { in PCPatchCreateCellPatches()
950 if (patch->dim < 0) PetscCall(DMPlexGetDepthStratum(dm, 0, &vStart, &vEnd)); in PCPatchCreateCellPatches()
951 else PetscCall(DMPlexGetDepthStratum(dm, patch->dim, &vStart, &vEnd)); in PCPatchCreateCellPatches()
952 } else PetscCall(DMPlexGetHeightStratum(dm, patch->codim, &vStart, &vEnd)); in PCPatchCreateCellPatches()
953 patch->npatch = vEnd - vStart; in PCPatchCreateCellPatches()
968 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->cellCounts)); in PCPatchCreateCellPatches()
969 PetscCall(PetscObjectSetName((PetscObject)patch->cellCounts, "Patch Cell Layout")); in PCPatchCreateCellPatches()
970 cellCounts = patch->cellCounts; in PCPatchCreateCellPatches()
972 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->pointCounts)); in PCPatchCreateCellPatches()
973 PetscCall(PetscObjectSetName((PetscObject)patch->pointCounts, "Patch Point Layout")); in PCPatchCreateCellPatches()
974 pointCounts = patch->pointCounts; in PCPatchCreateCellPatches()
976 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->extFacetCounts)); in PCPatchCreateCellPatches()
977 PetscCall(PetscObjectSetName((PetscObject)patch->extFacetCounts, "Patch Exterior Facet Layout")); in PCPatchCreateCellPatches()
978 extFacetCounts = patch->extFacetCounts; in PCPatchCreateCellPatches()
980 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->intFacetCounts)); in PCPatchCreateCellPatches()
981 PetscCall(PetscObjectSetName((PetscObject)patch->intFacetCounts, "Patch Interior Facet Layout")); in PCPatchCreateCellPatches()
982 intFacetCounts = patch->intFacetCounts; in PCPatchCreateCellPatches()
991 if (!patch->user_patches && patch->ctype != PC_PATCH_PARDECOMP) { in PCPatchCreateCellPatches()
1001 PetscCall(patch->patchconstructop((void *)patch, dm, v, ht)); in PCPatchCreateCellPatches()
1038 … PetscCall(PCPatchGetGlobalDofs(pc, patch->dofSection, -1, patch->combined, point, &pdof, NULL)); in PCPatchCreateCellPatches()
1075 PetscCall(patch->patchconstructop((void *)patch, dm, v, ht)); in PCPatchCreateCellPatches()
1109 … PetscCall(PCPatchGetGlobalDofs(pc, patch->dofSection, -1, patch->combined, point, &pdof, NULL)); in PCPatchCreateCellPatches()
1140 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numCells, cellsArray, PETSC_OWN_POINTER, &patch->cells)… in PCPatchCreateCellPatches()
1141 PetscCall(PetscObjectSetName((PetscObject)patch->cells, "Patch Cells")); in PCPatchCreateCellPatches()
1142 if (patch->viewCells) { in PCPatchCreateCellPatches()
1143 PetscCall(ObjectView((PetscObject)patch->cellCounts, patch->viewerCells, patch->formatCells)); in PCPatchCreateCellPatches()
1144 PetscCall(ObjectView((PetscObject)patch->cells, patch->viewerCells, patch->formatCells)); in PCPatchCreateCellPatches()
1146 …reateGeneral(PETSC_COMM_SELF, numIntFacets, intFacetsArray, PETSC_OWN_POINTER, &patch->intFacets)); in PCPatchCreateCellPatches()
1147 PetscCall(PetscObjectSetName((PetscObject)patch->intFacets, "Patch Interior Facets")); in PCPatchCreateCellPatches()
1148 …SC_COMM_SELF, 2 * numIntFacets, intFacetsToPatchCell, PETSC_OWN_POINTER, &patch->intFacetsToPatchC… in PCPatchCreateCellPatches()
1149 …PetscCall(PetscObjectSetName((PetscObject)patch->intFacetsToPatchCell, "Patch Interior Facets loca… in PCPatchCreateCellPatches()
1150 if (patch->viewIntFacets) { in PCPatchCreateCellPatches()
1151 …PetscCall(ObjectView((PetscObject)patch->intFacetCounts, patch->viewerIntFacets, patch->formatIntF… in PCPatchCreateCellPatches()
1152 …PetscCall(ObjectView((PetscObject)patch->intFacets, patch->viewerIntFacets, patch->formatIntFacets… in PCPatchCreateCellPatches()
1153 …PetscCall(ObjectView((PetscObject)patch->intFacetsToPatchCell, patch->viewerIntFacets, patch->form… in PCPatchCreateCellPatches()
1155 …reateGeneral(PETSC_COMM_SELF, numExtFacets, extFacetsArray, PETSC_OWN_POINTER, &patch->extFacets)); in PCPatchCreateCellPatches()
1156 PetscCall(PetscObjectSetName((PetscObject)patch->extFacets, "Patch Exterior Facets")); in PCPatchCreateCellPatches()
1157 if (patch->viewExtFacets) { in PCPatchCreateCellPatches()
1158 …PetscCall(ObjectView((PetscObject)patch->extFacetCounts, patch->viewerExtFacets, patch->formatExtF… in PCPatchCreateCellPatches()
1159 …PetscCall(ObjectView((PetscObject)patch->extFacets, patch->viewerExtFacets, patch->formatExtFacets… in PCPatchCreateCellPatches()
1161 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numPoints, pointsArray, PETSC_OWN_POINTER, &patch->poin… in PCPatchCreateCellPatches()
1162 PetscCall(PetscObjectSetName((PetscObject)patch->points, "Patch Points")); in PCPatchCreateCellPatches()
1163 if (patch->viewPoints) { in PCPatchCreateCellPatches()
1164 … PetscCall(ObjectView((PetscObject)patch->pointCounts, patch->viewerPoints, patch->formatPoints)); in PCPatchCreateCellPatches()
1165 PetscCall(ObjectView((PetscObject)patch->points, patch->viewerPoints, patch->formatPoints)); in PCPatchCreateCellPatches()
1189 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchCreateCellPatchDiscretisationInfo() local
1190 PetscSection cellCounts = patch->cellCounts; in PCPatchCreateCellPatchDiscretisationInfo()
1191 PetscSection pointCounts = patch->pointCounts; in PCPatchCreateCellPatchDiscretisationInfo()
1193 IS cells = patch->cells; in PCPatchCreateCellPatchDiscretisationInfo()
1194 IS points = patch->points; in PCPatchCreateCellPatchDiscretisationInfo()
1195 PetscSection cellNumbering = patch->cellNumbering; in PCPatchCreateCellPatchDiscretisationInfo()
1196 PetscInt Nf = patch->nsubspaces; in PCPatchCreateCellPatchDiscretisationInfo()
1200 PetscInt totalDofsPerCell = patch->totalDofsPerCell; in PCPatchCreateCellPatchDiscretisationInfo()
1237 PetscCall(PetscSectionGetStorageSize(patch->pointCounts, &numPoints)); in PCPatchCreateCellPatchDiscretisationInfo()
1244 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->gtolCounts)); in PCPatchCreateCellPatchDiscretisationInfo()
1245 gtolCounts = patch->gtolCounts; in PCPatchCreateCellPatchDiscretisationInfo()
1247 PetscCall(PetscObjectSetName((PetscObject)patch->gtolCounts, "Patch Global Index Section")); in PCPatchCreateCellPatchDiscretisationInfo()
1249 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1253 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->gtolCountsWithArtificial)); in PCPatchCreateCellPatchDiscretisationInfo()
1254 gtolCountsWithArtificial = patch->gtolCountsWithArtificial; in PCPatchCreateCellPatchDiscretisationInfo()
1256 …PetscCall(PetscObjectSetName((PetscObject)patch->gtolCountsWithArtificial, "Patch Global Index Sec… in PCPatchCreateCellPatchDiscretisationInfo()
1259 isNonlinear = patch->isNonlinear; in PCPatchCreateCellPatchDiscretisationInfo()
1264 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->gtolCountsWithAll)); in PCPatchCreateCellPatchDiscretisationInfo()
1265 gtolCountsWithAll = patch->gtolCountsWithAll; in PCPatchCreateCellPatchDiscretisationInfo()
1267 …PetscCall(PetscObjectSetName((PetscObject)patch->gtolCountsWithAll, "Patch Global Index Section In… in PCPatchCreateCellPatchDiscretisationInfo()
1273 PetscCall(ISGetIndices(patch->ghostBcNodes, &bcNodes)); in PCPatchCreateCellPatchDiscretisationInfo()
1274 PetscCall(ISGetSize(patch->ghostBcNodes, &numBcs)); in PCPatchCreateCellPatchDiscretisationInfo()
1276 PetscCall(ISRestoreIndices(patch->ghostBcNodes, &bcNodes)); in PCPatchCreateCellPatchDiscretisationInfo()
1277 PetscCall(ISDestroy(&patch->ghostBcNodes)); /* memory optimisation */ in PCPatchCreateCellPatchDiscretisationInfo()
1305 PetscCall(patch->patchconstructop((void *)patch, dm, v, ownedpts)); in PCPatchCreateCellPatchDiscretisationInfo()
1307 PetscCall(PCPatchGetPointDofs(pc, ownedpts, owneddofs, v, &patch->subspaces_to_exclude)); in PCPatchCreateCellPatchDiscretisationInfo()
1310 if (patch->viewPatches) { in PCPatchCreateCellPatchDiscretisationInfo()
1366 for (k = 0; k < patch->nsubspaces; ++k) { in PCPatchCreateCellPatchDiscretisationInfo()
1367 const PetscInt *cellNodeMap = patch->cellNodeMap[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1368 PetscInt nodesPerCell = patch->nodesPerCell[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1369 PetscInt subspaceOffset = patch->subspaceOffsets[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1370 PetscInt bs = patch->bs[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1410 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1443 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1461 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1485 for (k = 0; k < patch->nsubspaces; ++k) { in PCPatchCreateCellPatchDiscretisationInfo()
1486 const PetscInt *cellNodeMap = patch->cellNodeMap[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1487 PetscInt nodesPerCell = patch->nodesPerCell[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1488 PetscInt subspaceOffset = patch->subspaceOffsets[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1489 PetscInt bs = patch->bs[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1503 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1528 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1555 …PetscCall(PCPatchGetGlobalDofs(pc, patch->dofSection, k, patch->combined, point, NULL, &globalDof)… in PCPatchCreateCellPatchDiscretisationInfo()
1558 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1581 if (patch->nsubspaces > 1) { /* for nsubspaces = 1, data we need is already in dofsArray */ in PCPatchCreateCellPatchDiscretisationInfo()
1587 for (k = 0; k < patch->nsubspaces; ++k) { in PCPatchCreateCellPatchDiscretisationInfo()
1588 const PetscInt *cellNodeMap = patch->cellNodeMap[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1589 PetscInt nodesPerCell = patch->nodesPerCell[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1590 PetscInt subspaceOffset = patch->subspaceOffsets[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1591 PetscInt bs = patch->bs[k]; in PCPatchCreateCellPatchDiscretisationInfo()
1604 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1619 if (1 == patch->nsubspaces) { in PCPatchCreateCellPatchDiscretisationInfo()
1621 …if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) PetscCall(PetscArraycpy(asmArray… in PCPatchCreateCellPatchDiscretisationInfo()
1631 …if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) PetscCall(PetscFree(dofsArrayWit… in PCPatchCreateCellPatchDiscretisationInfo()
1634 PetscCall(PetscSectionCreate(PETSC_COMM_SELF, &patch->patchSection)); in PCPatchCreateCellPatchDiscretisationInfo()
1635 PetscCall(PetscSectionSetNumFields(patch->patchSection, patch->nsubspaces)); in PCPatchCreateCellPatchDiscretisationInfo()
1636 if (patch->combined) { in PCPatchCreateCellPatchDiscretisationInfo()
1638 PetscCall(PetscSectionGetNumFields(patch->dofSection[0], &numFields)); in PCPatchCreateCellPatchDiscretisationInfo()
1639patch->nsubspaces, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_WRONG, "Mismatch between number… in PCPatchCreateCellPatchDiscretisationInfo()
1640 PetscCall(PetscSectionGetChart(patch->dofSection[0], &pStart, &pEnd)); in PCPatchCreateCellPatchDiscretisationInfo()
1641 PetscCall(PetscSectionSetChart(patch->patchSection, pStart, pEnd)); in PCPatchCreateCellPatchDiscretisationInfo()
1645 PetscCall(PetscSectionGetDof(patch->dofSection[0], p, &dof)); in PCPatchCreateCellPatchDiscretisationInfo()
1646 PetscCall(PetscSectionSetDof(patch->patchSection, p, dof)); in PCPatchCreateCellPatchDiscretisationInfo()
1647 for (f = 0; f < patch->nsubspaces; ++f) { in PCPatchCreateCellPatchDiscretisationInfo()
1648 PetscCall(PetscSectionGetFieldDof(patch->dofSection[0], p, f, &fdof)); in PCPatchCreateCellPatchDiscretisationInfo()
1649 PetscCall(PetscSectionSetFieldDof(patch->patchSection, p, f, fdof)); in PCPatchCreateCellPatchDiscretisationInfo()
1656 for (f = 0; f < patch->nsubspaces; ++f) { in PCPatchCreateCellPatchDiscretisationInfo()
1657 PetscCall(PetscSectionGetChart(patch->dofSection[f], &pStartf, &pEndf)); in PCPatchCreateCellPatchDiscretisationInfo()
1661 PetscCall(PetscSectionSetChart(patch->patchSection, pStart, pEnd)); in PCPatchCreateCellPatchDiscretisationInfo()
1662 for (f = 0; f < patch->nsubspaces; ++f) { in PCPatchCreateCellPatchDiscretisationInfo()
1663 PetscCall(PetscSectionGetChart(patch->dofSection[f], &pStartf, &pEndf)); in PCPatchCreateCellPatchDiscretisationInfo()
1666 PetscCall(PetscSectionGetDof(patch->dofSection[f], p, &fdof)); in PCPatchCreateCellPatchDiscretisationInfo()
1667 PetscCall(PetscSectionAddDof(patch->patchSection, p, fdof)); in PCPatchCreateCellPatchDiscretisationInfo()
1668 PetscCall(PetscSectionSetFieldDof(patch->patchSection, p, f, fdof)); in PCPatchCreateCellPatchDiscretisationInfo()
1672 PetscCall(PetscSectionSetUp(patch->patchSection)); in PCPatchCreateCellPatchDiscretisationInfo()
1673 PetscCall(PetscSectionSetUseFieldOffsets(patch->patchSection, PETSC_TRUE)); in PCPatchCreateCellPatchDiscretisationInfo()
1676 …ISCreateGeneral(PETSC_COMM_SELF, numGlobalDofs, globalDofsArray, PETSC_OWN_POINTER, &patch->gtol)); in PCPatchCreateCellPatchDiscretisationInfo()
1677 PetscCall(PetscObjectSetName((PetscObject)patch->gtol, "Global Indices")); in PCPatchCreateCellPatchDiscretisationInfo()
1678 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_g2l_view", patch->classname)); in PCPatchCreateCellPatchDiscretisationInfo()
1679 PetscCall(PetscSectionViewFromOptions(patch->gtolCounts, (PetscObject)pc, option)); in PCPatchCreateCellPatchDiscretisationInfo()
1680 PetscCall(ISViewFromOptions(patch->gtol, (PetscObject)pc, option)); in PCPatchCreateCellPatchDiscretisationInfo()
1681 PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numDofs, asmArray, PETSC_OWN_POINTER, &patch->dofs)); in PCPatchCreateCellPatchDiscretisationInfo()
1682 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numPoints * Nf, offsArray, PETSC_OWN_POINTER, &patch->o… in PCPatchCreateCellPatchDiscretisationInfo()
1683 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCPatchCreateCellPatchDiscretisationInfo()
1684 …balDofsWithArtificial, globalDofsArrayWithArtificial, PETSC_OWN_POINTER, &patch->gtolWithArtificia… in PCPatchCreateCellPatchDiscretisationInfo()
1685 …ral(PETSC_COMM_SELF, numDofs, asmArrayWithArtificial, PETSC_OWN_POINTER, &patch->dofsWithArtificia… in PCPatchCreateCellPatchDiscretisationInfo()
1686 …C_COMM_SELF, numPoints * Nf, offsArrayWithArtificial, PETSC_OWN_POINTER, &patch->offsWithArtificia… in PCPatchCreateCellPatchDiscretisationInfo()
1689 …_COMM_SELF, numGlobalDofsWithAll, globalDofsArrayWithAll, PETSC_OWN_POINTER, &patch->gtolWithAll)); in PCPatchCreateCellPatchDiscretisationInfo()
1690 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, numDofs, asmArrayWithAll, PETSC_OWN_POINTER, &patch->do… in PCPatchCreateCellPatchDiscretisationInfo()
1691 …eneral(PETSC_COMM_SELF, numPoints * Nf, offsArrayWithAll, PETSC_OWN_POINTER, &patch->offsWithAll)); in PCPatchCreateCellPatchDiscretisationInfo()
1698 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchCreateMatrix_Private() local
1707 PetscCall(PetscSectionGetChart(patch->gtolCountsWithArtificial, &pStart, NULL)); in PCPatchCreateMatrix_Private()
1708 PetscCall(PetscSectionGetDof(patch->gtolCountsWithArtificial, point + pStart, &rsize)); in PCPatchCreateMatrix_Private()
1712 PetscCall(PetscSectionGetChart(patch->gtolCounts, &pStart, NULL)); in PCPatchCreateMatrix_Private()
1713 PetscCall(PetscSectionGetDof(patch->gtolCounts, point + pStart, &rsize)); in PCPatchCreateMatrix_Private()
1721 if (patch->sub_mat_type) PetscCall(MatSetType(*mat, patch->sub_mat_type)); in PCPatchCreateMatrix_Private()
1722 else if (!patch->sub_mat_type) PetscCall(MatSetType(*mat, MATDENSE)); in PCPatchCreateMatrix_Private()
1734 PetscCall(ISGetIndices(patch->dofsWithArtificial, &dofsArray)); in PCPatchCreateMatrix_Private()
1736 PetscCall(ISGetIndices(patch->dofs, &dofsArray)); in PCPatchCreateMatrix_Private()
1738 PetscCall(PetscSectionGetChart(patch->cellCounts, &pStart, &pEnd)); in PCPatchCreateMatrix_Private()
1741 PetscCall(PetscSectionGetDof(patch->cellCounts, point, &ncell)); in PCPatchCreateMatrix_Private()
1742 PetscCall(PetscSectionGetOffset(patch->cellCounts, point, &offset)); in PCPatchCreateMatrix_Private()
1754 const PetscInt *idx = dofsArray + (offset + c) * patch->totalDofsPerCell; in PCPatchCreateMatrix_Private()
1755 for (i = 0; i < patch->totalDofsPerCell; ++i) { in PCPatchCreateMatrix_Private()
1758 for (j = 0; j < patch->totalDofsPerCell; ++j) { in PCPatchCreateMatrix_Private()
1767 if (patch->usercomputeopintfacet) { in PCPatchCreateMatrix_Private()
1772 PetscCall(PetscSectionGetDof(patch->intFacetCounts, point, &numIntFacets)); in PCPatchCreateMatrix_Private()
1773 PetscCall(PetscSectionGetOffset(patch->intFacetCounts, point, &intFacetOffset)); in PCPatchCreateMatrix_Private()
1774 PetscCall(ISGetIndices(patch->intFacetsToPatchCell, &facetCells)); in PCPatchCreateMatrix_Private()
1775 PetscCall(ISGetIndices(patch->intFacets, &intFacetsArray)); in PCPatchCreateMatrix_Private()
1781 for (celli = 0; celli < patch->totalDofsPerCell; celli++) { in PCPatchCreateMatrix_Private()
1782 const PetscInt row = dofsArray[(offset + cell0) * patch->totalDofsPerCell + celli]; in PCPatchCreateMatrix_Private()
1784 for (cellj = 0; cellj < patch->totalDofsPerCell; cellj++) { in PCPatchCreateMatrix_Private()
1785 const PetscInt col = dofsArray[(offset + cell1) * patch->totalDofsPerCell + cellj]; in PCPatchCreateMatrix_Private()
1792 for (celli = 0; celli < patch->totalDofsPerCell; celli++) { in PCPatchCreateMatrix_Private()
1793 const PetscInt row = dofsArray[(offset + cell1) * patch->totalDofsPerCell + celli]; in PCPatchCreateMatrix_Private()
1795 for (cellj = 0; cellj < patch->totalDofsPerCell; cellj++) { in PCPatchCreateMatrix_Private()
1796 const PetscInt col = dofsArray[(offset + cell0) * patch->totalDofsPerCell + cellj]; in PCPatchCreateMatrix_Private()
1808 PetscCall(PetscCalloc1(patch->totalDofsPerCell * patch->totalDofsPerCell, &zeroes)); in PCPatchCreateMatrix_Private()
1810 const PetscInt *idx = &dofsArray[(offset + c) * patch->totalDofsPerCell]; in PCPatchCreateMatrix_Private()
1811 …PetscCall(MatSetValues(*mat, patch->totalDofsPerCell, idx, patch->totalDofsPerCell, idx, zeroes, I… in PCPatchCreateMatrix_Private()
1816 if (patch->usercomputeopintfacet) { in PCPatchCreateMatrix_Private()
1821 PetscCall(PetscSectionGetDof(patch->intFacetCounts, point, &numIntFacets)); in PCPatchCreateMatrix_Private()
1822 PetscCall(PetscSectionGetOffset(patch->intFacetCounts, point, &intFacetOffset)); in PCPatchCreateMatrix_Private()
1823 PetscCall(ISGetIndices(patch->intFacetsToPatchCell, &facetCells)); in PCPatchCreateMatrix_Private()
1824 PetscCall(ISGetIndices(patch->intFacets, &intFacetsArray)); in PCPatchCreateMatrix_Private()
1828 const PetscInt *cell0idx = &dofsArray[(offset + cell0) * patch->totalDofsPerCell]; in PCPatchCreateMatrix_Private()
1829 const PetscInt *cell1idx = &dofsArray[(offset + cell1) * patch->totalDofsPerCell]; in PCPatchCreateMatrix_Private()
1830 …PetscCall(MatSetValues(*mat, patch->totalDofsPerCell, cell0idx, patch->totalDofsPerCell, cell1idx,… in PCPatchCreateMatrix_Private()
1831 …PetscCall(MatSetValues(*mat, patch->totalDofsPerCell, cell1idx, patch->totalDofsPerCell, cell0idx,… in PCPatchCreateMatrix_Private()
1844 PetscCall(PetscCalloc1(patch->totalDofsPerCell * patch->totalDofsPerCell, &vals)); in PCPatchCreateMatrix_Private()
1851 const PetscInt *idx = dofsArray + (offset + c) * patch->totalDofsPerCell; in PCPatchCreateMatrix_Private()
1852 …PetscCall(MatSetValues(preallocator, patch->totalDofsPerCell, idx, patch->totalDofsPerCell, idx, v… in PCPatchCreateMatrix_Private()
1855 if (patch->usercomputeopintfacet) { in PCPatchCreateMatrix_Private()
1860 PetscCall(PetscSectionGetDof(patch->intFacetCounts, point, &numIntFacets)); in PCPatchCreateMatrix_Private()
1861 PetscCall(PetscSectionGetOffset(patch->intFacetCounts, point, &intFacetOffset)); in PCPatchCreateMatrix_Private()
1862 PetscCall(ISGetIndices(patch->intFacetsToPatchCell, &facetCells)); in PCPatchCreateMatrix_Private()
1863 PetscCall(ISGetIndices(patch->intFacets, &intFacetsArray)); in PCPatchCreateMatrix_Private()
1867 const PetscInt *cell0idx = &dofsArray[(offset + cell0) * patch->totalDofsPerCell]; in PCPatchCreateMatrix_Private()
1868 const PetscInt *cell1idx = &dofsArray[(offset + cell1) * patch->totalDofsPerCell]; in PCPatchCreateMatrix_Private()
1869 …PetscCall(MatSetValues(preallocator, patch->totalDofsPerCell, cell0idx, patch->totalDofsPerCell, c… in PCPatchCreateMatrix_Private()
1870 …PetscCall(MatSetValues(preallocator, patch->totalDofsPerCell, cell1idx, patch->totalDofsPerCell, c… in PCPatchCreateMatrix_Private()
1882 PetscCall(ISRestoreIndices(patch->dofsWithArtificial, &dofsArray)); in PCPatchCreateMatrix_Private()
1884 PetscCall(ISRestoreIndices(patch->dofs, &dofsArray)); in PCPatchCreateMatrix_Private()
1893 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchComputeFunction_DMPlex_Private() local
1897 PetscInt Nf = patch->nsubspaces, Np, poff, p, f; in PCPatchComputeFunction_DMPlex_Private()
1900 …PetscCheck(!patch->precomputeElementTensors, PetscObjectComm((PetscObject)pc), PETSC_ERR_ARG_WRONG… in PCPatchComputeFunction_DMPlex_Private()
1906 PetscCall(PetscSectionGetDof(patch->pointCounts, patchNum, &Np)); in PCPatchComputeFunction_DMPlex_Private()
1907 PetscCall(PetscSectionGetOffset(patch->pointCounts, patchNum, &poff)); in PCPatchComputeFunction_DMPlex_Private()
1908 PetscCall(ISGetIndices(patch->points, &parray)); in PCPatchComputeFunction_DMPlex_Private()
1909 PetscCall(ISGetIndices(patch->offs, &oarray)); in PCPatchComputeFunction_DMPlex_Private()
1915 PetscCall(PetscSectionGetFieldDof(patch->patchSection, point, f, &dof)); in PCPatchComputeFunction_DMPlex_Private()
1916 … PetscCall(PetscSectionSetFieldOffset(patch->patchSection, point, f, oarray[(poff + p) * Nf + f])); in PCPatchComputeFunction_DMPlex_Private()
1917 …if (patch->nsubspaces == 1) PetscCall(PetscSectionSetOffset(patch->patchSection, point, oarray[(po… in PCPatchComputeFunction_DMPlex_Private()
1918 else PetscCall(PetscSectionSetOffset(patch->patchSection, point, -1)); in PCPatchComputeFunction_DMPlex_Private()
1921 PetscCall(ISRestoreIndices(patch->points, &parray)); in PCPatchComputeFunction_DMPlex_Private()
1922 PetscCall(ISRestoreIndices(patch->offs, &oarray)); in PCPatchComputeFunction_DMPlex_Private()
1923 …if (patch->viewSection) PetscCall(ObjectView((PetscObject)patch->patchSection, patch->viewerSectio… in PCPatchComputeFunction_DMPlex_Private()
1924 …PetscCall(DMPlexComputeResidual_Patch_Internal(dm, patch->patchSection, cellIS, 0.0, x, NULL, F, c… in PCPatchComputeFunction_DMPlex_Private()
1931 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchComputeFunction_Internal() local
1939 …PetscCheck(patch->usercomputeop, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must call PCPatchSetC… in PCPatchComputeFunction_Internal()
1940 PetscCall(ISGetIndices(patch->dofs, &dofsArray)); in PCPatchComputeFunction_Internal()
1941 PetscCall(ISGetIndices(patch->dofsWithAll, &dofsArrayWithAll)); in PCPatchComputeFunction_Internal()
1942 PetscCall(ISGetIndices(patch->cells, &cellsArray)); in PCPatchComputeFunction_Internal()
1943 PetscCall(PetscSectionGetChart(patch->cellCounts, &pStart, &pEnd)); in PCPatchComputeFunction_Internal()
1948 PetscCall(PetscSectionGetDof(patch->cellCounts, point, &ncell)); in PCPatchComputeFunction_Internal()
1949 PetscCall(PetscSectionGetOffset(patch->cellCounts, point, &offset)); in PCPatchComputeFunction_Internal()
1956 …PetscCall(ISCreateGeneral(PETSC_COMM_SELF, ncell, cellsArray + offset, PETSC_USE_POINTER, &patch->… in PCPatchComputeFunction_Internal()
1957patch->usercomputef(pc, point, x, F, patch->cellIS, ncell * patch->totalDofsPerCell, dofsArray + o… in PCPatchComputeFunction_Internal()
1958 PetscCall(ISDestroy(&patch->cellIS)); in PCPatchComputeFunction_Internal()
1959 PetscCall(ISRestoreIndices(patch->dofs, &dofsArray)); in PCPatchComputeFunction_Internal()
1960 PetscCall(ISRestoreIndices(patch->dofsWithAll, &dofsArrayWithAll)); in PCPatchComputeFunction_Internal()
1961 PetscCall(ISRestoreIndices(patch->cells, &cellsArray)); in PCPatchComputeFunction_Internal()
1962 if (patch->viewMatrix) { in PCPatchComputeFunction_Internal()
1967 PetscCall(ObjectView((PetscObject)F, patch->viewerMatrix, patch->formatMatrix)); in PCPatchComputeFunction_Internal()
1975 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchComputeOperator_DMPlex_Private() local
1979 PetscInt Nf = patch->nsubspaces, Np, poff, p, f; in PCPatchComputeOperator_DMPlex_Private()
1987 PetscCall(PetscSectionGetDof(patch->pointCounts, patchNum, &Np)); in PCPatchComputeOperator_DMPlex_Private()
1988 PetscCall(PetscSectionGetOffset(patch->pointCounts, patchNum, &poff)); in PCPatchComputeOperator_DMPlex_Private()
1989 PetscCall(ISGetIndices(patch->points, &parray)); in PCPatchComputeOperator_DMPlex_Private()
1990 PetscCall(ISGetIndices(patch->offs, &oarray)); in PCPatchComputeOperator_DMPlex_Private()
1996 PetscCall(PetscSectionGetFieldDof(patch->patchSection, point, f, &dof)); in PCPatchComputeOperator_DMPlex_Private()
1997 … PetscCall(PetscSectionSetFieldOffset(patch->patchSection, point, f, oarray[(poff + p) * Nf + f])); in PCPatchComputeOperator_DMPlex_Private()
1998 …if (patch->nsubspaces == 1) PetscCall(PetscSectionSetOffset(patch->patchSection, point, oarray[(po… in PCPatchComputeOperator_DMPlex_Private()
1999 else PetscCall(PetscSectionSetOffset(patch->patchSection, point, -1)); in PCPatchComputeOperator_DMPlex_Private()
2002 PetscCall(ISRestoreIndices(patch->points, &parray)); in PCPatchComputeOperator_DMPlex_Private()
2003 PetscCall(ISRestoreIndices(patch->offs, &oarray)); in PCPatchComputeOperator_DMPlex_Private()
2004 …if (patch->viewSection) PetscCall(ObjectView((PetscObject)patch->patchSection, patch->viewerSectio… in PCPatchComputeOperator_DMPlex_Private()
2006 …PetscCall(DMPlexComputeJacobian_Patch_Internal(dm, patch->patchSection, patch->patchSection, cellI… in PCPatchComputeOperator_DMPlex_Private()
2014 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchComputeOperator_Internal() local
2023 isNonlinear = patch->isNonlinear; in PCPatchComputeOperator_Internal()
2024 …PetscCheck(patch->usercomputeop, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONGSTATE, "Must call PCPatchSetC… in PCPatchComputeOperator_Internal()
2026 PetscCall(ISGetIndices(patch->dofsWithArtificial, &dofsArray)); in PCPatchComputeOperator_Internal()
2028 PetscCall(ISGetIndices(patch->dofs, &dofsArray)); in PCPatchComputeOperator_Internal()
2030 if (isNonlinear) PetscCall(ISGetIndices(patch->dofsWithAll, &dofsArrayWithAll)); in PCPatchComputeOperator_Internal()
2031 PetscCall(ISGetIndices(patch->cells, &cellsArray)); in PCPatchComputeOperator_Internal()
2032 PetscCall(PetscSectionGetChart(patch->cellCounts, &pStart, &pEnd)); in PCPatchComputeOperator_Internal()
2037 PetscCall(PetscSectionGetDof(patch->cellCounts, point, &ncell)); in PCPatchComputeOperator_Internal()
2038 PetscCall(PetscSectionGetOffset(patch->cellCounts, point, &offset)); in PCPatchComputeOperator_Internal()
2044 if (patch->precomputeElementTensors) { in PCPatchComputeOperator_Internal()
2046 PetscInt ndof = patch->totalDofsPerCell; in PCPatchComputeOperator_Internal()
2049 PetscCall(VecGetArrayRead(patch->cellMats, &elementTensors)); in PCPatchComputeOperator_Internal()
2053 … const PetscScalar *v = elementTensors + patch->precomputedTensorLocations[cell] * ndof * ndof; in PCPatchComputeOperator_Internal()
2056 PetscCall(VecRestoreArrayRead(patch->cellMats, &elementTensors)); in PCPatchComputeOperator_Internal()
2061 …l(ISCreateGeneral(PETSC_COMM_SELF, ncell, cellsArray + offset, PETSC_USE_POINTER, &patch->cellIS)); in PCPatchComputeOperator_Internal()
2063patch->usercomputeop(pc, point, x, mat, patch->cellIS, ncell * patch->totalDofsPerCell, dofsArray … in PCPatchComputeOperator_Internal()
2065 if (patch->usercomputeopintfacet) { in PCPatchComputeOperator_Internal()
2066 PetscCall(PetscSectionGetDof(patch->intFacetCounts, point, &numIntFacets)); in PCPatchComputeOperator_Internal()
2067 PetscCall(PetscSectionGetOffset(patch->intFacetCounts, point, &intFacetOffset)); in PCPatchComputeOperator_Internal()
2079 PetscCall(ISGetIndices(patch->intFacetsToPatchCell, &facetCells)); in PCPatchComputeOperator_Internal()
2080 PetscCall(ISGetIndices(patch->intFacets, &intFacetsArray)); in PCPatchComputeOperator_Internal()
2086 PetscCall(PetscMalloc1(2 * patch->totalDofsPerCell * numIntFacets, &facetDofs)); in PCPatchComputeOperator_Internal()
2087 …if (dofsArrayWithAll) PetscCall(PetscMalloc1(2 * patch->totalDofsPerCell * numIntFacets, &facetDof… in PCPatchComputeOperator_Internal()
2088 if (patch->precomputeElementTensors) { in PCPatchComputeOperator_Internal()
2089 PetscInt nFacetDof = 2 * patch->totalDofsPerCell; in PCPatchComputeOperator_Internal()
2092 PetscCall(VecGetArrayRead(patch->intFacetMats, &elementTensors)); in PCPatchComputeOperator_Internal()
2096 …const PetscScalar *v = elementTensors + patch->precomputedIntFacetTensorLocations[facet - fSta… in PCPatchComputeOperator_Internal()
2107 for (d = 0; d < patch->totalDofsPerCell; d++) { in PCPatchComputeOperator_Internal()
2108 facetDofs[idx] = dofsArray[(offset + cell) * patch->totalDofsPerCell + d]; in PCPatchComputeOperator_Internal()
2114 PetscCall(VecRestoreArrayRead(patch->intFacetMats, &elementTensors)); in PCPatchComputeOperator_Internal()
2126 for (d = 0; d < patch->totalDofsPerCell; d++) { in PCPatchComputeOperator_Internal()
2127 facetDofs[idx] = dofsArray[(offset + cell) * patch->totalDofsPerCell + d]; in PCPatchComputeOperator_Internal()
2128 …sArrayWithAll) facetDofsWithAll[idx] = dofsArrayWithAll[(offset + cell) * patch->totalDofsPerCell … in PCPatchComputeOperator_Internal()
2134 …etscCall(patch->usercomputeopintfacet(pc, point, x, mat, facetIS, 2 * numIntFacets * patch->totalD… in PCPatchComputeOperator_Internal()
2137 PetscCall(ISRestoreIndices(patch->intFacetsToPatchCell, &facetCells)); in PCPatchComputeOperator_Internal()
2138 PetscCall(ISRestoreIndices(patch->intFacets, &intFacetsArray)); in PCPatchComputeOperator_Internal()
2148 if (!(withArtificial || isNonlinear) && patch->denseinverse) { in PCPatchComputeOperator_Internal()
2157 PetscCall(ISDestroy(&patch->cellIS)); in PCPatchComputeOperator_Internal()
2159 PetscCall(ISRestoreIndices(patch->dofsWithArtificial, &dofsArray)); in PCPatchComputeOperator_Internal()
2161 PetscCall(ISRestoreIndices(patch->dofs, &dofsArray)); in PCPatchComputeOperator_Internal()
2163 if (isNonlinear) PetscCall(ISRestoreIndices(patch->dofsWithAll, &dofsArrayWithAll)); in PCPatchComputeOperator_Internal()
2164 PetscCall(ISRestoreIndices(patch->cells, &cellsArray)); in PCPatchComputeOperator_Internal()
2165 if (patch->viewMatrix) { in PCPatchComputeOperator_Internal()
2170 PetscCall(ObjectView((PetscObject)mat, patch->viewerMatrix, patch->formatMatrix)); in PCPatchComputeOperator_Internal()
2206 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatchPrecomputePatchTensors_Private() local
2213 const PetscInt ndof = patch->totalDofsPerCell; in PCPatchPrecomputePatchTensors_Private()
2218 PetscCall(ISGetSize(patch->cells, &ncell)); in PCPatchPrecomputePatchTensors_Private()
2228 if (!patch->allCells) { in PCPatchPrecomputePatchTensors_Private()
2234 PetscCall(ISGetIndices(patch->cells, &cellsArray)); in PCPatchPrecomputePatchTensors_Private()
2235 PetscCall(PetscSectionGetChart(patch->cellCounts, &pStart, &pEnd)); in PCPatchPrecomputePatchTensors_Private()
2237 PetscCall(PetscSectionGetDof(patch->cellCounts, i, &ncell)); in PCPatchPrecomputePatchTensors_Private()
2238 PetscCall(PetscSectionGetOffset(patch->cellCounts, i, &offset)); in PCPatchPrecomputePatchTensors_Private()
2242 PetscCall(ISRestoreIndices(patch->cells, &cellsArray)); in PCPatchPrecomputePatchTensors_Private()
2246 PetscCall(PetscMalloc1(cEnd - cStart, &patch->precomputedTensorLocations)); in PCPatchPrecomputePatchTensors_Private()
2251 patch->precomputedTensorLocations[allCells[i]] = i; in PCPatchPrecomputePatchTensors_Private()
2256 … PetscCall(ISCreateGeneral(PETSC_COMM_SELF, ncell, allCells, PETSC_OWN_POINTER, &patch->allCells)); in PCPatchPrecomputePatchTensors_Private()
2258 PetscCall(ISGetSize(patch->allCells, &ncell)); in PCPatchPrecomputePatchTensors_Private()
2259 if (!patch->cellMats) { in PCPatchPrecomputePatchTensors_Private()
2260 PetscCall(VecCreateSeq(PETSC_COMM_SELF, ncell * ndof * ndof, &patch->cellMats)); in PCPatchPrecomputePatchTensors_Private()
2261 PetscCall(VecSetBlockSize(patch->cellMats, ndof)); in PCPatchPrecomputePatchTensors_Private()
2263 PetscCall(VecSet(patch->cellMats, 0)); in PCPatchPrecomputePatchTensors_Private()
2265 …OMM_SELF, ncell * ndof, ncell * ndof, ncell * ndof, ncell * ndof, (void *)patch->cellMats, &vecMat… in PCPatchPrecomputePatchTensors_Private()
2267 PetscCall(ISGetSize(patch->allCells, &ncell)); in PCPatchPrecomputePatchTensors_Private()
2270 PetscCall(ISGetIndices(patch->allCells, &cellsArray)); in PCPatchPrecomputePatchTensors_Private()
2273 …tscCallBack("PCPatch callback", patch->usercomputeop(pc, -1, NULL, vecMat, cellIS, ndof * ncell, d… in PCPatchPrecomputePatchTensors_Private()
2276 PetscCall(ISRestoreIndices(patch->allCells, &cellsArray)); in PCPatchPrecomputePatchTensors_Private()
2280 if (patch->usercomputeopintfacet) { in PCPatchPrecomputePatchTensors_Private()
2284 if (!patch->allIntFacets) { in PCPatchPrecomputePatchTensors_Private()
2290 PetscCall(ISGetIndices(patch->intFacets, &intFacetsArray)); in PCPatchPrecomputePatchTensors_Private()
2291 PetscCall(PetscSectionGetChart(patch->intFacetCounts, &pStart, &pEnd)); in PCPatchPrecomputePatchTensors_Private()
2294 PetscCall(PetscSectionGetDof(patch->intFacetCounts, i, &nIntFacets)); in PCPatchPrecomputePatchTensors_Private()
2295 PetscCall(PetscSectionGetOffset(patch->intFacetCounts, i, &offset)); in PCPatchPrecomputePatchTensors_Private()
2299 PetscCall(ISRestoreIndices(patch->intFacets, &intFacetsArray)); in PCPatchPrecomputePatchTensors_Private()
2302 PetscCall(PetscMalloc1(fEnd - fStart, &patch->precomputedIntFacetTensorLocations)); in PCPatchPrecomputePatchTensors_Private()
2307 patch->precomputedIntFacetTensorLocations[allIntFacets[i] - fStart] = i; in PCPatchPrecomputePatchTensors_Private()
2312 …CreateGeneral(PETSC_COMM_SELF, nIntFacets, allIntFacets, PETSC_OWN_POINTER, &patch->allIntFacets)); in PCPatchPrecomputePatchTensors_Private()
2314 PetscCall(ISGetSize(patch->allIntFacets, &nIntFacets)); in PCPatchPrecomputePatchTensors_Private()
2315 if (!patch->intFacetMats) { in PCPatchPrecomputePatchTensors_Private()
2316 PetscCall(VecCreateSeq(PETSC_COMM_SELF, nIntFacets * ndof * ndof * 4, &patch->intFacetMats)); in PCPatchPrecomputePatchTensors_Private()
2317 PetscCall(VecSetBlockSize(patch->intFacetMats, ndof * 2)); in PCPatchPrecomputePatchTensors_Private()
2319 PetscCall(VecSet(patch->intFacetMats, 0)); in PCPatchPrecomputePatchTensors_Private()
2321 …tFacets * ndof * 2, nIntFacets * ndof * 2, nIntFacets * ndof * 2, (void *)patch->intFacetMats, &ve… in PCPatchPrecomputePatchTensors_Private()
2325 PetscCall(ISGetIndices(patch->allIntFacets, &intFacetsArray)); in PCPatchPrecomputePatchTensors_Private()
2328 … (interior facets)", patch->usercomputeopintfacet(pc, -1, NULL, vecMat, intFacetsIS, 2 * ndof * nI… in PCPatchPrecomputePatchTensors_Private()
2331 PetscCall(ISRestoreIndices(patch->allIntFacets, &intFacetsArray)); in PCPatchPrecomputePatchTensors_Private()
2342 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCPatch_ScatterLocal_Private() local
2352 PetscCall(PetscSectionGetDof(patch->gtolCountsWithArtificial, p, &dof)); in PCPatch_ScatterLocal_Private()
2353 PetscCall(PetscSectionGetOffset(patch->gtolCountsWithArtificial, p, &offset)); in PCPatch_ScatterLocal_Private()
2354 PetscCall(ISGetIndices(patch->gtolWithArtificial, &gtolArray)); in PCPatch_ScatterLocal_Private()
2356 PetscCall(PetscSectionGetDof(patch->gtolCountsWithAll, p, &dof)); in PCPatch_ScatterLocal_Private()
2357 PetscCall(PetscSectionGetOffset(patch->gtolCountsWithAll, p, &offset)); in PCPatch_ScatterLocal_Private()
2358 PetscCall(ISGetIndices(patch->gtolWithAll, &gtolArray)); in PCPatch_ScatterLocal_Private()
2360 PetscCall(PetscSectionGetDof(patch->gtolCounts, p, &dof)); in PCPatch_ScatterLocal_Private()
2361 PetscCall(PetscSectionGetOffset(patch->gtolCounts, p, &offset)); in PCPatch_ScatterLocal_Private()
2362 PetscCall(ISGetIndices(patch->gtol, &gtolArray)); in PCPatch_ScatterLocal_Private()
2373 PetscCall(ISRestoreIndices(patch->gtolWithArtificial, &gtolArray)); in PCPatch_ScatterLocal_Private()
2375 PetscCall(ISRestoreIndices(patch->gtolWithAll, &gtolArray)); in PCPatch_ScatterLocal_Private()
2377 PetscCall(ISRestoreIndices(patch->gtol, &gtolArray)); in PCPatch_ScatterLocal_Private()
2386 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCSetUp_PATCH_Linear() local
2392 …PetscCheck(patch->save_operators || !patch->denseinverse, PetscObjectComm((PetscObject)pc), PETSC_… in PCSetUp_PATCH_Linear()
2393 if (!patch->denseinverse) { in PCSetUp_PATCH_Linear()
2394 PetscCall(PetscMalloc1(patch->npatch, &patch->solver)); in PCSetUp_PATCH_Linear()
2396 for (i = 0; i < patch->npatch; ++i) { in PCSetUp_PATCH_Linear()
2408 patch->solver[i] = (PetscObject)ksp; in PCSetUp_PATCH_Linear()
2412 if (patch->save_operators) { in PCSetUp_PATCH_Linear()
2413 if (patch->precomputeElementTensors) PetscCall(PCPatchPrecomputePatchTensors_Private(pc)); in PCSetUp_PATCH_Linear()
2414 for (i = 0; i < patch->npatch; ++i) { in PCSetUp_PATCH_Linear()
2415 PetscCall(PCPatchComputeOperator_Internal(pc, NULL, patch->mat[i], i, PETSC_FALSE)); in PCSetUp_PATCH_Linear()
2416 if (!patch->denseinverse) { in PCSetUp_PATCH_Linear()
2417 PetscCall(KSPSetOperators((KSP)patch->solver[i], patch->mat[i], patch->mat[i])); in PCSetUp_PATCH_Linear()
2418 } else if (patch->mat[i] && !patch->densesolve) { in PCSetUp_PATCH_Linear()
2420 … PetscCall(MatGetOperation(patch->mat[i], MATOP_MULT, (PetscErrorCodeFn **)&patch->densesolve)); in PCSetUp_PATCH_Linear()
2424 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCSetUp_PATCH_Linear()
2425 for (i = 0; i < patch->npatch; ++i) { in PCSetUp_PATCH_Linear()
2435 PetscCall(MatGetSize(patch->mat[i], &dof, NULL)); in PCSetUp_PATCH_Linear()
2437 patch->matWithArtificial[i] = NULL; in PCSetUp_PATCH_Linear()
2447 …Call(MatCreateSubMatrix(matSquare, rowis, patch->dofMappingWithoutToWithArtificial[i], MAT_REUSE_M… in PCSetUp_PATCH_Linear()
2449 …all(MatCreateSubMatrix(matSquare, rowis, patch->dofMappingWithoutToWithArtificial[i], MAT_INITIAL_… in PCSetUp_PATCH_Linear()
2460 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCSetUp_PATCH() local
2472 isNonlinear = patch->isNonlinear; in PCSetUp_PATCH()
2473 if (!patch->nsubspaces) { in PCSetUp_PATCH()
2539 localSize = patch->subspaceOffsets[patch->nsubspaces]; in PCSetUp_PATCH()
2540 PetscCall(VecCreateSeq(PETSC_COMM_SELF, localSize, &patch->localRHS)); in PCSetUp_PATCH()
2541 PetscCall(VecSetUp(patch->localRHS)); in PCSetUp_PATCH()
2542 PetscCall(VecDuplicate(patch->localRHS, &patch->localUpdate)); in PCSetUp_PATCH()
2547 PetscCall(PetscSectionGetChart(patch->gtolCounts, &pStart, &pEnd)); in PCSetUp_PATCH()
2549 …if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) PetscCall(PetscMalloc1(patch->np… in PCSetUp_PATCH()
2550 if (isNonlinear) PetscCall(PetscMalloc1(patch->npatch, &patch->dofMappingWithoutToWithAll)); in PCSetUp_PATCH()
2554 PetscCall(PetscSectionGetDof(patch->gtolCounts, p, &dof)); in PCSetUp_PATCH()
2556 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCSetUp_PATCH()
2563 PetscCall(PetscSectionGetDof(patch->gtolCountsWithArtificial, p, &dof)); in PCSetUp_PATCH()
2568 PetscCall(ISGetIndices(patch->gtol, &gtolArray)); in PCSetUp_PATCH()
2570 PetscCall(PetscSectionGetDof(patch->gtolCounts, p, &numPatchDofs)); in PCSetUp_PATCH()
2572 patch->dofMappingWithoutToWithArtificial[p - pStart] = NULL; in PCSetUp_PATCH()
2576 PetscCall(PetscSectionGetOffset(patch->gtolCounts, p, &offset)); in PCSetUp_PATCH()
2577 PetscCall(ISGetIndices(patch->gtolWithArtificial, &gtolArrayWithArtificial)); in PCSetUp_PATCH()
2578 … PetscCall(PetscSectionGetDof(patch->gtolCountsWithArtificial, p, &numPatchDofsWithArtificial)); in PCSetUp_PATCH()
2579 PetscCall(PetscSectionGetOffset(patch->gtolCountsWithArtificial, p, &offsetWithArtificial)); in PCSetUp_PATCH()
2589 …tchDofs, patchWithoutArtificialToWithArtificialArray, PETSC_OWN_POINTER, &patch->dofMappingWithout… in PCSetUp_PATCH()
2590 PetscCall(ISRestoreIndices(patch->gtol, &gtolArray)); in PCSetUp_PATCH()
2591 PetscCall(ISRestoreIndices(patch->gtolWithArtificial, &gtolArrayWithArtificial)); in PCSetUp_PATCH()
2604 PetscCall(ISGetIndices(patch->gtol, &gtolArray)); in PCSetUp_PATCH()
2606 PetscCall(PetscSectionGetDof(patch->gtolCounts, p, &numPatchDofs)); in PCSetUp_PATCH()
2608 patch->dofMappingWithoutToWithAll[p - pStart] = NULL; in PCSetUp_PATCH()
2612 PetscCall(PetscSectionGetOffset(patch->gtolCounts, p, &offset)); in PCSetUp_PATCH()
2613 PetscCall(ISGetIndices(patch->gtolWithAll, &gtolArrayWithAll)); in PCSetUp_PATCH()
2614 PetscCall(PetscSectionGetDof(patch->gtolCountsWithAll, p, &numPatchDofsWithAll)); in PCSetUp_PATCH()
2615 PetscCall(PetscSectionGetOffset(patch->gtolCountsWithAll, p, &offsetWithAll)); in PCSetUp_PATCH()
2626 …MM_SELF, numPatchDofs, patchWithoutAllToWithAllArray, PETSC_OWN_POINTER, &patch->dofMappingWithout… in PCSetUp_PATCH()
2627 PetscCall(ISRestoreIndices(patch->gtol, &gtolArray)); in PCSetUp_PATCH()
2628 PetscCall(ISRestoreIndices(patch->gtolWithAll, &gtolArrayWithAll)); in PCSetUp_PATCH()
2631 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCSetUp_PATCH()
2632 … PetscCall(VecCreateSeq(PETSC_COMM_SELF, maxDofWithArtificial, &patch->patchRHSWithArtificial)); in PCSetUp_PATCH()
2633 PetscCall(VecSetUp(patch->patchRHSWithArtificial)); in PCSetUp_PATCH()
2635 PetscCall(VecCreateSeq(PETSC_COMM_SELF, maxDof, &patch->patchRHS)); in PCSetUp_PATCH()
2636 PetscCall(VecSetUp(patch->patchRHS)); in PCSetUp_PATCH()
2637 PetscCall(VecCreateSeq(PETSC_COMM_SELF, maxDof, &patch->patchUpdate)); in PCSetUp_PATCH()
2638 PetscCall(VecSetUp(patch->patchUpdate)); in PCSetUp_PATCH()
2639 if (patch->save_operators) { in PCSetUp_PATCH()
2640 PetscCall(PetscMalloc1(patch->npatch, &patch->mat)); in PCSetUp_PATCH()
2641 …for (i = 0; i < patch->npatch; ++i) PetscCall(PCPatchCreateMatrix_Private(pc, i, &patch->mat[i], P… in PCSetUp_PATCH()
2646 if (patch->partition_of_unity) { in PCSetUp_PATCH()
2651 PetscCall(VecDuplicate(patch->localRHS, &patch->dof_weights)); in PCSetUp_PATCH()
2652 if (patch->local_composition_type == PC_COMPOSITE_ADDITIVE) { in PCSetUp_PATCH()
2653 for (i = 0; i < patch->npatch; ++i) { in PCSetUp_PATCH()
2656 PetscCall(PetscSectionGetDof(patch->gtolCounts, i + pStart, &dof)); in PCSetUp_PATCH()
2658 PetscCall(VecSet(patch->patchRHS, 1.0)); in PCSetUp_PATCH()
2659 …PetscCall(PCPatch_ScatterLocal_Private(pc, i + pStart, patch->patchRHS, patch->dof_weights, ADD_VA… in PCSetUp_PATCH()
2663 PetscCall(VecSet(patch->dof_weights, 1.0)); in PCSetUp_PATCH()
2666 PetscCall(VecDuplicate(patch->dof_weights, &global)); in PCSetUp_PATCH()
2669 PetscCall(VecGetArray(patch->dof_weights, &input)); in PCSetUp_PATCH()
2671 PetscCall(PetscSFReduceBegin(patch->sectionSF, MPIU_SCALAR, input, output, MPI_SUM)); in PCSetUp_PATCH()
2672 PetscCall(PetscSFReduceEnd(patch->sectionSF, MPIU_SCALAR, input, output, MPI_SUM)); in PCSetUp_PATCH()
2673 PetscCall(VecRestoreArray(patch->dof_weights, &input)); in PCSetUp_PATCH()
2678 PetscCall(VecGetArray(patch->dof_weights, &output)); in PCSetUp_PATCH()
2680 PetscCall(PetscSFBcastBegin(patch->sectionSF, MPIU_SCALAR, input, output, MPI_REPLACE)); in PCSetUp_PATCH()
2681 PetscCall(PetscSFBcastEnd(patch->sectionSF, MPIU_SCALAR, input, output, MPI_REPLACE)); in PCSetUp_PATCH()
2682 PetscCall(VecRestoreArray(patch->dof_weights, &output)); in PCSetUp_PATCH()
2686patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE && patch->save_operators && !patch->i… in PCSetUp_PATCH()
2688 PetscCall((*patch->setupsolver)(pc)); in PCSetUp_PATCH()
2694 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCApply_PATCH_Linear() local
2700 if (patch->denseinverse) { in PCApply_PATCH_Linear()
2701 PetscCall((*patch->densesolve)(patch->mat[i], x, y)); in PCApply_PATCH_Linear()
2704 ksp = (KSP)patch->solver[i]; in PCApply_PATCH_Linear()
2705 if (!patch->save_operators) { in PCApply_PATCH_Linear()
2727 if (!patch->save_operators) { in PCApply_PATCH_Linear()
2739 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCUpdateMultiplicative_PATCH_Linear() local
2744 if (patch->save_operators) { in PCUpdateMultiplicative_PATCH_Linear()
2745 multMat = patch->matWithArtificial[i]; in PCUpdateMultiplicative_PATCH_Linear()
2755 …PetscCall(MatCreateSubMatrix(matSquare, rowis, patch->dofMappingWithoutToWithArtificial[i], MAT_IN… in PCUpdateMultiplicative_PATCH_Linear()
2761 patch->patchUpdate->map->n = n; in PCUpdateMultiplicative_PATCH_Linear()
2762 patch->patchRHSWithArtificial->map->n = m; in PCUpdateMultiplicative_PATCH_Linear()
2763 patch->patchUpdate->map->N = n; in PCUpdateMultiplicative_PATCH_Linear()
2764 patch->patchRHSWithArtificial->map->N = m; in PCUpdateMultiplicative_PATCH_Linear()
2765 PetscCall(MatMult(multMat, patch->patchUpdate, patch->patchRHSWithArtificial)); in PCUpdateMultiplicative_PATCH_Linear()
2766 PetscCall(VecScale(patch->patchRHSWithArtificial, -1.0)); in PCUpdateMultiplicative_PATCH_Linear()
2767 …PetscCall(PCPatch_ScatterLocal_Private(pc, i + pStart, patch->patchRHSWithArtificial, patch->local… in PCUpdateMultiplicative_PATCH_Linear()
2768 if (!patch->save_operators) PetscCall(MatDestroy(&multMat)); in PCUpdateMultiplicative_PATCH_Linear()
2774 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCApply_PATCH() local
2779 PetscInt nsweep = patch->symmetrise_sweep ? 2 : 1; in PCApply_PATCH()
2791 end[0] = patch->npatch; in PCApply_PATCH()
2792 start[1] = patch->npatch - 1; in PCApply_PATCH()
2793 if (patch->user_patches) { in PCApply_PATCH()
2794 PetscCall(ISGetLocalSize(patch->iterationSet, &end[0])); in PCApply_PATCH()
2796 PetscCall(ISGetIndices(patch->iterationSet, &iterationSet)); in PCApply_PATCH()
2800 PetscCall(VecGetArray(patch->localRHS, &localRHS)); in PCApply_PATCH()
2801 PetscCall(PetscSFBcastBegin(patch->sectionSF, MPIU_SCALAR, globalRHS, localRHS, MPI_REPLACE)); in PCApply_PATCH()
2802 PetscCall(PetscSFBcastEnd(patch->sectionSF, MPIU_SCALAR, globalRHS, localRHS, MPI_REPLACE)); in PCApply_PATCH()
2804 PetscCall(VecRestoreArray(patch->localRHS, &localRHS)); in PCApply_PATCH()
2806 PetscCall(VecSet(patch->localUpdate, 0.0)); in PCApply_PATCH()
2807 PetscCall(PetscSectionGetChart(patch->gtolCounts, &pStart, NULL)); in PCApply_PATCH()
2811 PetscInt i = patch->user_patches ? iterationSet[j] : j; in PCApply_PATCH()
2814 PetscCall(PetscSectionGetDof(patch->gtolCounts, i + pStart, &len)); in PCApply_PATCH()
2815 PetscCall(PetscSectionGetOffset(patch->gtolCounts, i + pStart, &start)); in PCApply_PATCH()
2819 …PetscCall(PCPatch_ScatterLocal_Private(pc, i + pStart, patch->localRHS, patch->patchRHS, INSERT_VA… in PCApply_PATCH()
2820 PetscCall((*patch->applysolver)(pc, i, patch->patchRHS, patch->patchUpdate)); in PCApply_PATCH()
2821 …PetscCall(PCPatch_ScatterLocal_Private(pc, i + pStart, patch->patchUpdate, patch->localUpdate, ADD… in PCApply_PATCH()
2822 …if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) PetscCall((*patch->updatemultipl… in PCApply_PATCH()
2826 if (patch->user_patches) PetscCall(ISRestoreIndices(patch->iterationSet, &iterationSet)); in PCApply_PATCH()
2828 …if (patch->partition_of_unity) PetscCall(VecPointwiseMult(patch->localUpdate, patch->localUpdate, in PCApply_PATCH()
2832 PetscCall(VecGetArrayRead(patch->localUpdate, &localUpdate)); in PCApply_PATCH()
2833 PetscCall(PetscSFReduceBegin(patch->sectionSF, MPIU_SCALAR, localUpdate, globalUpdate, MPI_SUM)); in PCApply_PATCH()
2834 PetscCall(PetscSFReduceEnd(patch->sectionSF, MPIU_SCALAR, localUpdate, globalUpdate, MPI_SUM)); in PCApply_PATCH()
2835 PetscCall(VecRestoreArrayRead(patch->localUpdate, &localUpdate)); in PCApply_PATCH()
2839 PetscCall(ISGetSize(patch->globalBcNodes, &numBcs)); in PCApply_PATCH()
2840 PetscCall(ISGetIndices(patch->globalBcNodes, &bcNodes)); in PCApply_PATCH()
2847 PetscCall(ISRestoreIndices(patch->globalBcNodes, &bcNodes)); in PCApply_PATCH()
2858 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCReset_PATCH_Linear() local
2862 if (patch->solver) { in PCReset_PATCH_Linear()
2863 for (i = 0; i < patch->npatch; ++i) PetscCall(KSPReset((KSP)patch->solver[i])); in PCReset_PATCH_Linear()
2870 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCReset_PATCH() local
2874 PetscCall(PetscSFDestroy(&patch->sectionSF)); in PCReset_PATCH()
2875 PetscCall(PetscSectionDestroy(&patch->cellCounts)); in PCReset_PATCH()
2876 PetscCall(PetscSectionDestroy(&patch->pointCounts)); in PCReset_PATCH()
2877 PetscCall(PetscSectionDestroy(&patch->cellNumbering)); in PCReset_PATCH()
2878 PetscCall(PetscSectionDestroy(&patch->gtolCounts)); in PCReset_PATCH()
2879 PetscCall(ISDestroy(&patch->gtol)); in PCReset_PATCH()
2880 PetscCall(ISDestroy(&patch->cells)); in PCReset_PATCH()
2881 PetscCall(ISDestroy(&patch->points)); in PCReset_PATCH()
2882 PetscCall(ISDestroy(&patch->dofs)); in PCReset_PATCH()
2883 PetscCall(ISDestroy(&patch->offs)); in PCReset_PATCH()
2884 PetscCall(PetscSectionDestroy(&patch->patchSection)); in PCReset_PATCH()
2885 PetscCall(ISDestroy(&patch->ghostBcNodes)); in PCReset_PATCH()
2886 PetscCall(ISDestroy(&patch->globalBcNodes)); in PCReset_PATCH()
2887 PetscCall(PetscSectionDestroy(&patch->gtolCountsWithArtificial)); in PCReset_PATCH()
2888 PetscCall(ISDestroy(&patch->gtolWithArtificial)); in PCReset_PATCH()
2889 PetscCall(ISDestroy(&patch->dofsWithArtificial)); in PCReset_PATCH()
2890 PetscCall(ISDestroy(&patch->offsWithArtificial)); in PCReset_PATCH()
2891 PetscCall(PetscSectionDestroy(&patch->gtolCountsWithAll)); in PCReset_PATCH()
2892 PetscCall(ISDestroy(&patch->gtolWithAll)); in PCReset_PATCH()
2893 PetscCall(ISDestroy(&patch->dofsWithAll)); in PCReset_PATCH()
2894 PetscCall(ISDestroy(&patch->offsWithAll)); in PCReset_PATCH()
2895 PetscCall(VecDestroy(&patch->cellMats)); in PCReset_PATCH()
2896 PetscCall(VecDestroy(&patch->intFacetMats)); in PCReset_PATCH()
2897 PetscCall(ISDestroy(&patch->allCells)); in PCReset_PATCH()
2898 PetscCall(ISDestroy(&patch->intFacets)); in PCReset_PATCH()
2899 PetscCall(ISDestroy(&patch->extFacets)); in PCReset_PATCH()
2900 PetscCall(ISDestroy(&patch->intFacetsToPatchCell)); in PCReset_PATCH()
2901 PetscCall(PetscSectionDestroy(&patch->intFacetCounts)); in PCReset_PATCH()
2902 PetscCall(PetscSectionDestroy(&patch->extFacetCounts)); in PCReset_PATCH()
2904 if (patch->dofSection) in PCReset_PATCH()
2905 for (i = 0; i < patch->nsubspaces; i++) PetscCall(PetscSectionDestroy(&patch->dofSection[i])); in PCReset_PATCH()
2906 PetscCall(PetscFree(patch->dofSection)); in PCReset_PATCH()
2907 PetscCall(PetscFree(patch->bs)); in PCReset_PATCH()
2908 PetscCall(PetscFree(patch->nodesPerCell)); in PCReset_PATCH()
2909 if (patch->cellNodeMap) in PCReset_PATCH()
2910 for (i = 0; i < patch->nsubspaces; i++) PetscCall(PetscFree(patch->cellNodeMap[i])); in PCReset_PATCH()
2911 PetscCall(PetscFree(patch->cellNodeMap)); in PCReset_PATCH()
2912 PetscCall(PetscFree(patch->subspaceOffsets)); in PCReset_PATCH()
2914 PetscCall((*patch->resetsolver)(pc)); in PCReset_PATCH()
2916 if (patch->subspaces_to_exclude) PetscCall(PetscHSetIDestroy(&patch->subspaces_to_exclude)); in PCReset_PATCH()
2918 PetscCall(VecDestroy(&patch->localRHS)); in PCReset_PATCH()
2919 PetscCall(VecDestroy(&patch->localUpdate)); in PCReset_PATCH()
2920 PetscCall(VecDestroy(&patch->patchRHS)); in PCReset_PATCH()
2921 PetscCall(VecDestroy(&patch->patchUpdate)); in PCReset_PATCH()
2922 PetscCall(VecDestroy(&patch->dof_weights)); in PCReset_PATCH()
2923 if (patch->patch_dof_weights) { in PCReset_PATCH()
2924 for (i = 0; i < patch->npatch; ++i) PetscCall(VecDestroy(&patch->patch_dof_weights[i])); in PCReset_PATCH()
2925 PetscCall(PetscFree(patch->patch_dof_weights)); in PCReset_PATCH()
2927 if (patch->mat) { in PCReset_PATCH()
2928 for (i = 0; i < patch->npatch; ++i) PetscCall(MatDestroy(&patch->mat[i])); in PCReset_PATCH()
2929 PetscCall(PetscFree(patch->mat)); in PCReset_PATCH()
2931 if (patch->matWithArtificial && !patch->isNonlinear) { in PCReset_PATCH()
2932 for (i = 0; i < patch->npatch; ++i) PetscCall(MatDestroy(&patch->matWithArtificial[i])); in PCReset_PATCH()
2933 PetscCall(PetscFree(patch->matWithArtificial)); in PCReset_PATCH()
2935 PetscCall(VecDestroy(&patch->patchRHSWithArtificial)); in PCReset_PATCH()
2936 if (patch->dofMappingWithoutToWithArtificial) { in PCReset_PATCH()
2937 …for (i = 0; i < patch->npatch; ++i) PetscCall(ISDestroy(&patch->dofMappingWithoutToWithArtificial[… in PCReset_PATCH()
2938 PetscCall(PetscFree(patch->dofMappingWithoutToWithArtificial)); in PCReset_PATCH()
2940 if (patch->dofMappingWithoutToWithAll) { in PCReset_PATCH()
2941 for (i = 0; i < patch->npatch; ++i) PetscCall(ISDestroy(&patch->dofMappingWithoutToWithAll[i])); in PCReset_PATCH()
2942 PetscCall(PetscFree(patch->dofMappingWithoutToWithAll)); in PCReset_PATCH()
2944 PetscCall(PetscFree(patch->sub_mat_type)); in PCReset_PATCH()
2945 if (patch->userIS) { in PCReset_PATCH()
2946 for (i = 0; i < patch->npatch; ++i) PetscCall(ISDestroy(&patch->userIS[i])); in PCReset_PATCH()
2947 PetscCall(PetscFree(patch->userIS)); in PCReset_PATCH()
2949 PetscCall(PetscFree(patch->precomputedTensorLocations)); in PCReset_PATCH()
2950 PetscCall(PetscFree(patch->precomputedIntFacetTensorLocations)); in PCReset_PATCH()
2952 patch->bs = NULL; in PCReset_PATCH()
2953 patch->cellNodeMap = NULL; in PCReset_PATCH()
2954 patch->nsubspaces = 0; in PCReset_PATCH()
2955 PetscCall(ISDestroy(&patch->iterationSet)); in PCReset_PATCH()
2957 PetscCall(PetscViewerDestroy(&patch->viewerCells)); in PCReset_PATCH()
2958 PetscCall(PetscViewerDestroy(&patch->viewerIntFacets)); in PCReset_PATCH()
2959 PetscCall(PetscViewerDestroy(&patch->viewerPoints)); in PCReset_PATCH()
2960 PetscCall(PetscViewerDestroy(&patch->viewerSection)); in PCReset_PATCH()
2961 PetscCall(PetscViewerDestroy(&patch->viewerMatrix)); in PCReset_PATCH()
2967 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCDestroy_PATCH_Linear() local
2971 if (patch->solver) { in PCDestroy_PATCH_Linear()
2972 for (i = 0; i < patch->npatch; ++i) PetscCall(KSPDestroy((KSP *)&patch->solver[i])); in PCDestroy_PATCH_Linear()
2973 PetscCall(PetscFree(patch->solver)); in PCDestroy_PATCH_Linear()
2980 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCDestroy_PATCH() local
2984 PetscCall((*patch->destroysolver)(pc)); in PCDestroy_PATCH()
2991 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCSetFromOptions_PATCH() local
3006 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_save_operators", patch->classname)); in PCSetFromOptions_PATCH()
3007 …perators for lifetime of object?", "PCPatchSetSaveOperators", patch->save_operators, &patch->save_… in PCSetFromOptions_PATCH()
3009 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_precompute_element_tensors", patch-… in PCSetFromOptions_PATCH()
3010 …ensor only once?", "PCPatchSetPrecomputeElementTensors", patch->precomputeElementTensors, &patch->… in PCSetFromOptions_PATCH()
3011 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_partition_of_unity", patch->classna… in PCSetFromOptions_PATCH()
3012 …utions by dof multiplicity?", "PCPatchSetPartitionOfUnity", patch->partition_of_unity, &patch->par… in PCSetFromOptions_PATCH()
3014 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_local_type", patch->classname)); in PCSetFromOptions_PATCH()
3017 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_dense_inverse", patch->classname)); in PCSetFromOptions_PATCH()
3018 … Ignores KSP/PC settings on patch.", "PCPatchSetDenseInverse", patch->denseinverse, &patch->densei… in PCSetFromOptions_PATCH()
3019 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_construct_dim", patch->classname)); in PCSetFromOptions_PATCH()
3020 …of mesh point to construct patches by? (0 = vertices)", "PCPATCH", patch->dim, &patch->dim, &dimfl… in PCSetFromOptions_PATCH()
3021 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_construct_codim", patch->classname)… in PCSetFromOptions_PATCH()
3022 …n of mesh point to construct patches by? (0 = cells)", "PCPATCH", patch->codim, &patch->codim, &co… in PCSetFromOptions_PATCH()
3025 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_construct_type", patch->classname)); in PCSetFromOptions_PATCH()
3029 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_vanka_dim", patch->classname)); in PCSetFromOptions_PATCH()
3030 …pological dimension of entities for Vanka to ignore", "PCPATCH", patch->vankadim, &patch->vankadim… in PCSetFromOptions_PATCH()
3032 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_ignore_dim", patch->classname)); in PCSetFromOptions_PATCH()
3033 …cal dimension of entities for completion to ignore", "PCPATCH", patch->ignoredim, &patch->ignoredi… in PCSetFromOptions_PATCH()
3035 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_pardecomp_overlap", patch->classnam… in PCSetFromOptions_PATCH()
3036 …lap should we use in construct type pardecomp?", "PCPATCH", patch->pardecomp_overlap, &patch->pard… in PCSetFromOptions_PATCH()
3038 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_sub_mat_type", patch->classname)); in PCSetFromOptions_PATCH()
3042 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_symmetrise_sweep", patch->classname… in PCSetFromOptions_PATCH()
3043 …OptionsBool(option, "Go start->end, end->start?", "PCPATCH", patch->symmetrise_sweep, &patch->symm… in PCSetFromOptions_PATCH()
3047 if (patch->nsubspaces <= 0) { in PCSetFromOptions_PATCH()
3050 nfields = patch->nsubspaces; in PCSetFromOptions_PATCH()
3053 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_exclude_subspaces", patch->classnam… in PCSetFromOptions_PATCH()
3057 PetscCall(PetscHSetIClear(patch->subspaces_to_exclude)); in PCSetFromOptions_PATCH()
3058 for (k = 0; k < nfields; k++) PetscCall(PetscHSetIAdd(patch->subspaces_to_exclude, ifields[k])); in PCSetFromOptions_PATCH()
3062 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_patches_view", patch->classname)); in PCSetFromOptions_PATCH()
3063 … "Print out information during patch construction", "PCPATCH", patch->viewPatches, &patch->viewPat… in PCSetFromOptions_PATCH()
3064 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_cells_view", patch->classname)); in PCSetFromOptions_PATCH()
3065 …r(comm, ((PetscObject)pc)->options, prefix, option, &patch->viewerCells, &patch->formatCells, &pat… in PCSetFromOptions_PATCH()
3066 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_interior_facets_view", patch->class… in PCSetFromOptions_PATCH()
3067 …mm, ((PetscObject)pc)->options, prefix, option, &patch->viewerIntFacets, &patch->formatIntFacets, … in PCSetFromOptions_PATCH()
3068 …PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_exterior_facets_view", patch->class… in PCSetFromOptions_PATCH()
3069 …mm, ((PetscObject)pc)->options, prefix, option, &patch->viewerExtFacets, &patch->formatExtFacets, … in PCSetFromOptions_PATCH()
3070 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_points_view", patch->classname)); in PCSetFromOptions_PATCH()
3071 …(comm, ((PetscObject)pc)->options, prefix, option, &patch->viewerPoints, &patch->formatPoints, &pa… in PCSetFromOptions_PATCH()
3072 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_section_view", patch->classname)); in PCSetFromOptions_PATCH()
3073 …comm, ((PetscObject)pc)->options, prefix, option, &patch->viewerSection, &patch->formatSection, &p… in PCSetFromOptions_PATCH()
3074 PetscCall(PetscSNPrintf(option, PETSC_MAX_PATH_LEN, "-%s_patch_mat_view", patch->classname)); in PCSetFromOptions_PATCH()
3075 …(comm, ((PetscObject)pc)->options, prefix, option, &patch->viewerMatrix, &patch->formatMatrix, &pa… in PCSetFromOptions_PATCH()
3077 patch->optionsSet = PETSC_TRUE; in PCSetFromOptions_PATCH()
3083 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCSetUpOnBlocks_PATCH() local
3088 if (!patch->save_operators) { in PCSetUpOnBlocks_PATCH()
3092 if (patch->denseinverse) { in PCSetUpOnBlocks_PATCH()
3096 for (i = 0; i < patch->npatch; ++i) { in PCSetUpOnBlocks_PATCH()
3097 …if (!((KSP)patch->solver[i])->setfromoptionscalled) PetscCall(KSPSetFromOptions((KSP)patch->solver… in PCSetUpOnBlocks_PATCH()
3098 PetscCall(KSPSetUp((KSP)patch->solver[i])); in PCSetUpOnBlocks_PATCH()
3099 PetscCall(KSPGetConvergedReason((KSP)patch->solver[i], &reason)); in PCSetUpOnBlocks_PATCH()
3107 PC_PATCH *patch = (PC_PATCH *)pc->data; in PCView_PATCH() local
3118 …ntf(viewer, "Subspace Correction preconditioner with %" PetscInt_FMT " patches\n", patch->npatch)); in PCView_PATCH()
3119 if (patch->local_composition_type == PC_COMPOSITE_MULTIPLICATIVE) { in PCView_PATCH()
3124 …if (patch->partition_of_unity) PetscCall(PetscViewerASCIIPrintf(viewer, "Weighting by partition of… in PCView_PATCH()
3126 …if (patch->symmetrise_sweep) PetscCall(PetscViewerASCIIPrintf(viewer, "Symmetrising sweep (start->… in PCView_PATCH()
3128 …if (!patch->precomputeElementTensors) PetscCall(PetscViewerASCIIPrintf(viewer, "Not precomputing e… in PCView_PATCH()
3130 …if (!patch->save_operators) PetscCall(PetscViewerASCIIPrintf(viewer, "Not saving patch operators (… in PCView_PATCH()
3132 …if (patch->patchconstructop == PCPatchConstruct_Star) PetscCall(PetscViewerASCIIPrintf(viewer, "Pa… in PCView_PATCH()
3133 …else if (patch->patchconstructop == PCPatchConstruct_Vanka) PetscCall(PetscViewerASCIIPrintf(viewe… in PCView_PATCH()
3134 …else if (patch->patchconstructop == PCPatchConstruct_User) PetscCall(PetscViewerASCIIPrintf(viewer… in PCView_PATCH()
3137 if (patch->denseinverse) { in PCView_PATCH()
3140 if (patch->isNonlinear) { in PCView_PATCH()
3145 if (patch->solver) { in PCView_PATCH()
3149 PetscCall(PetscObjectView(patch->solver[0], sviewer)); in PCView_PATCH()
3181 PC_PATCH *patch; in PCCreate_Patch() local
3185 PetscCall(PetscNew(&patch)); in PCCreate_Patch()
3187 if (patch->subspaces_to_exclude) PetscCall(PetscHSetIDestroy(&patch->subspaces_to_exclude)); in PCCreate_Patch()
3188 PetscCall(PetscHSetICreate(&patch->subspaces_to_exclude)); in PCCreate_Patch()
3190 patch->classname = "pc"; in PCCreate_Patch()
3191 patch->isNonlinear = PETSC_FALSE; in PCCreate_Patch()
3194 patch->combined = PETSC_FALSE; in PCCreate_Patch()
3195 patch->save_operators = PETSC_TRUE; in PCCreate_Patch()
3196 patch->local_composition_type = PC_COMPOSITE_ADDITIVE; in PCCreate_Patch()
3197 patch->precomputeElementTensors = PETSC_FALSE; in PCCreate_Patch()
3198 patch->partition_of_unity = PETSC_FALSE; in PCCreate_Patch()
3199 patch->codim = -1; in PCCreate_Patch()
3200 patch->dim = -1; in PCCreate_Patch()
3201 patch->vankadim = -1; in PCCreate_Patch()
3202 patch->ignoredim = -1; in PCCreate_Patch()
3203 patch->pardecomp_overlap = 0; in PCCreate_Patch()
3204 patch->patchconstructop = PCPatchConstruct_Star; in PCCreate_Patch()
3205 patch->symmetrise_sweep = PETSC_FALSE; in PCCreate_Patch()
3206 patch->npatch = 0; in PCCreate_Patch()
3207 patch->userIS = NULL; in PCCreate_Patch()
3208 patch->optionsSet = PETSC_FALSE; in PCCreate_Patch()
3209 patch->iterationSet = NULL; in PCCreate_Patch()
3210 patch->user_patches = PETSC_FALSE; in PCCreate_Patch()
3211 PetscCall(PetscStrallocpy(MATDENSE, (char **)&patch->sub_mat_type)); in PCCreate_Patch()
3212 patch->viewPatches = PETSC_FALSE; in PCCreate_Patch()
3213 patch->viewCells = PETSC_FALSE; in PCCreate_Patch()
3214 patch->viewPoints = PETSC_FALSE; in PCCreate_Patch()
3215 patch->viewSection = PETSC_FALSE; in PCCreate_Patch()
3216 patch->viewMatrix = PETSC_FALSE; in PCCreate_Patch()
3217 patch->densesolve = NULL; in PCCreate_Patch()
3218 patch->setupsolver = PCSetUp_PATCH_Linear; in PCCreate_Patch()
3219 patch->applysolver = PCApply_PATCH_Linear; in PCCreate_Patch()
3220 patch->resetsolver = PCReset_PATCH_Linear; in PCCreate_Patch()
3221 patch->destroysolver = PCDestroy_PATCH_Linear; in PCCreate_Patch()
3222 patch->updatemultiplicative = PCUpdateMultiplicative_PATCH_Linear; in PCCreate_Patch()
3223 patch->dofMappingWithoutToWithArtificial = NULL; in PCCreate_Patch()
3224 patch->dofMappingWithoutToWithAll = NULL; in PCCreate_Patch()
3226 pc->data = (void *)patch; in PCCreate_Patch()