Lines Matching refs:fields
1948 PetscErrorCode DMCreateFieldIS(DM dm, PetscInt *numFields, char ***fieldNames, IS *fields[]) in DMCreateFieldIS() argument
1962 if (fields) { in DMCreateFieldIS()
1963 PetscAssertPointer(fields, 4); in DMCreateFieldIS()
1964 *fields = NULL; in DMCreateFieldIS()
2027 if (fields) { in DMCreateFieldIS()
2028 PetscCall(PetscMalloc1(nF, fields)); in DMCreateFieldIS()
2032 …tscObjectComm((PetscObject)dm), fieldSizes[f], fieldIndices[f], PETSC_OWN_POINTER, &(*fields)[f])); in DMCreateFieldIS()
2037 PetscCall(ISSetBlockSize((*fields)[f], bs)); in DMCreateFieldIS()
2041 } else PetscTryTypeMethod(dm, createfieldis, numFields, fieldNames, fields); in DMCreateFieldIS()
2169 PetscErrorCode DMCreateSubDM(DM dm, PetscInt numFields, const PetscInt fields[], IS *is, DM *subdm) in DMCreateSubDM() argument
2173 PetscAssertPointer(fields, 3); in DMCreateSubDM()
2176 PetscUseTypeMethod(dm, createsubdm, numFields, fields, is, subdm); in DMCreateSubDM()
4927 for (f = 0; f < Nf; ++f) tmpr[f] = dm->fields[f]; in DMFieldEnlarge_Static()
4933 PetscCall(PetscFree(dm->fields)); in DMFieldEnlarge_Static()
4935 dm->fields = tmpr; in DMFieldEnlarge_Static()
4957 if (!dm->fields) PetscFunctionReturn(PETSC_SUCCESS); // DMDA does not use fields field in DM in DMClearFields()
4959 PetscCall(PetscObjectDestroy(&dm->fields[f].disc)); in DMClearFields()
4960 PetscCall(DMLabelDestroy(&dm->fields[f].label)); in DMClearFields()
4962 PetscCall(PetscFree(dm->fields)); in DMClearFields()
4963 dm->fields = NULL; in DMClearFields()
5045 if (!dm->fields) { in DMGetField()
5049 if (label) *label = dm->fields[f].label; in DMGetField()
5050 if (disc) *disc = dm->fields[f].disc; in DMGetField()
5060 PetscCall(DMLabelDestroy(&dm->fields[f].label)); in DMSetField_Internal()
5061 PetscCall(PetscObjectDestroy(&dm->fields[f].disc)); in DMSetField_Internal()
5062 dm->fields[f].label = label; in DMSetField_Internal()
5063 dm->fields[f].disc = disc; in DMSetField_Internal()
5132 dm->fields[Nf].label = label; in DMAddField()
5133 dm->fields[Nf].disc = disc; in DMAddField()
5159 dm->fields[f].avoidTensor = avoidTensor; in DMSetFieldAvoidTensor()
5183 *avoidTensor = dm->fields[f].avoidTensor; in DMGetFieldAvoidTensor()
5279 if (useCone) *useCone = dm->fields[f].adjacency[0]; in DMGetAdjacency()
5280 if (useClosure) *useClosure = dm->fields[f].adjacency[1]; in DMGetAdjacency()
5320 dm->fields[f].adjacency[0] = useCone; in DMSetAdjacency()
5321 dm->fields[f].adjacency[1] = useClosure; in DMSetAdjacency()
5502 tmpd[s].fields = NULL; in DMDSEnlarge_Static()
5556 PetscCall(ISDestroy(&dm->probs[s].fields)); in DMClearDS()
5662 PetscErrorCode DMGetRegionDS(DM dm, DMLabel label, IS *fields, PetscDS *ds, PetscDS *dsIn) in DMGetRegionDS() argument
5669 if (fields) { in DMGetRegionDS()
5670 PetscAssertPointer(fields, 3); in DMGetRegionDS()
5671 *fields = NULL; in DMGetRegionDS()
5683 if (fields) *fields = dm->probs[s].fields; in DMGetRegionDS()
5712 PetscErrorCode DMSetRegionDS(DM dm, DMLabel label, IS fields, PetscDS ds, PetscDS dsIn) in DMSetRegionDS() argument
5719 if (fields) PetscValidHeaderSpecific(fields, IS_CLASSID, 3); in DMSetRegionDS()
5733 PetscCall(PetscObjectReference((PetscObject)fields)); in DMSetRegionDS()
5742 dm->probs[Nds].fields = fields; in DMSetRegionDS()
5767 PetscErrorCode DMGetRegionNumDS(DM dm, PetscInt num, DMLabel *label, IS *fields, PetscDS *ds, Petsc… in DMGetRegionNumDS() argument
5779 if (fields) { in DMGetRegionNumDS()
5780 PetscAssertPointer(fields, 4); in DMGetRegionNumDS()
5781 *fields = dm->probs[num].fields; in DMGetRegionNumDS()
5811 PetscErrorCode DMSetRegionNumDS(DM dm, PetscInt num, DMLabel label, IS fields, PetscDS ds, PetscDS … in DMSetRegionNumDS() argument
5823 if (fields) { in DMSetRegionNumDS()
5824 PetscValidHeaderSpecific(fields, IS_CLASSID, 4); in DMSetRegionNumDS()
5825 PetscCall(PetscObjectReference((PetscObject)fields)); in DMSetRegionNumDS()
5826 PetscCall(ISDestroy(&dm->probs[num].fields)); in DMSetRegionNumDS()
5827 dm->probs[num].fields = fields; in DMSetRegionNumDS()
5943 if (!dm->fields) PetscFunctionReturn(PETSC_SUCCESS); in DMCreateDS()
5954 DMLabel label = dm->fields[f].label; in DMCreateDS()
5962 PetscCall(PetscObjectGetClassId(dm->fields[f].disc, &id)); in DMCreateDS()
5967 PetscCall(PetscFESetCeed((PetscFE)dm->fields[f].disc, ceed)); in DMCreateDS()
5983 IS fields; in DMCreateDS() local
5987 if (!dm->fields[f].label) ++nf; in DMCreateDS()
5991 if (!dm->fields[f].label) fld[nf++] = f; in DMCreateDS()
5992 PetscCall(ISCreate(PETSC_COMM_SELF, &fields)); in DMCreateDS()
5993 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)fields, "dm_fields_")); in DMCreateDS()
5994 PetscCall(ISSetType(fields, ISGENERAL)); in DMCreateDS()
5995 PetscCall(ISGeneralSetIndices(fields, nf, fld, PETSC_OWN_POINTER)); in DMCreateDS()
5998 PetscCall(DMSetRegionDS(dm, NULL, fields, dsDef, NULL)); in DMCreateDS()
6000 PetscCall(ISDestroy(&fields)); in DMCreateDS()
6009 PetscInt *fields; in DMCreateDS() local
6037 PetscCall(PetscMalloc1(Ndef, &fields)); in DMCreateDS()
6039 if (!dm->fields[f].label) fields[nf++] = f; in DMCreateDS()
6043 PetscCall(ISGeneralSetIndices(fieldIS, nf, fields, PETSC_OWN_POINTER)); in DMCreateDS()
6060 IS fields; in DMCreateDS() local
6065 if (label == dm->fields[f].label || !dm->fields[f].label) ++nf; in DMCreateDS()
6068 if (label == dm->fields[f].label || !dm->fields[f].label) fld[nf++] = f; in DMCreateDS()
6069 PetscCall(ISCreate(PETSC_COMM_SELF, &fields)); in DMCreateDS()
6070 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)fields, "dm_fields_")); in DMCreateDS()
6071 PetscCall(ISSetType(fields, ISGENERAL)); in DMCreateDS()
6072 PetscCall(ISGeneralSetIndices(fields, nf, fld, PETSC_OWN_POINTER)); in DMCreateDS()
6099 if (label == dm->fields[f].label || !dm->fields[f].label) { in DMCreateDS()
6100 if (label == dm->fields[f].label) { in DMCreateDS()
6112 PetscCall(DMSetRegionDS(dm, label, fields, ds, dsIn)); in DMCreateDS()
6113 PetscCall(ISDestroy(&fields)); in DMCreateDS()
6122 IS fields = dm->probs[s].fields; in DMCreateDS() local
6129 PetscCall(ISGetLocalSize(fields, &nf)); in DMCreateDS()
6130 PetscCall(ISGetIndices(fields, &fld)); in DMCreateDS()
6132 PetscObject disc = dm->fields[fld[f]].disc; in DMCreateDS()
6157 PetscCall(ISRestoreIndices(fields, &fld)); in DMCreateDS()
6279 const PetscInt *fields, id = 1; in DMComputeExactSolution() local
6284 PetscCall(ISGetIndices(fieldIS, &fields)); in DMComputeExactSolution()
6288 … f < dsNf; ++f) PetscCall(PetscDSGetExactSolution(ds, fields[f], &exacts[fields[f]], &ectxs[fields… in DMComputeExactSolution()
6295 …) PetscCall(PetscDSGetExactSolutionTimeDerivative(ds, fields[f], &exacts[fields[f]], &ectxs[fields… in DMComputeExactSolution()
6299 PetscCall(ISRestoreIndices(fieldIS, &fields)); in DMComputeExactSolution()
6323 static PetscErrorCode DMTransferDS_Internal(DM dm, DMLabel label, IS fields, PetscInt minDegree, Pe… in DMTransferDS_Internal() argument
6334 PetscCall(DMSetRegionDS(dm, label, fields, dsNew, dsInNew)); in DMTransferDS_Internal()
6367 IS fields; in DMCopyDS() local
6371 PetscCall(DMGetRegionNumDS(dm, s, &label, &fields, &ds, &dsIn)); in DMCopyDS()
6373 PetscCall(DMTransferDS_Internal(newdm, label, fields, minDegree, maxDegree, ds, dsIn)); in DMCopyDS()
9176 const PetscInt *fields; in DMComputeError() local
9181 if (fieldIS) PetscCall(ISGetIndices(fieldIS, &fields)); in DMComputeError()
9183 const PetscInt field = fields[f]; in DMComputeError()
9186 if (fieldIS) PetscCall(ISRestoreIndices(fieldIS, &fields)); in DMComputeError()