Lines Matching defs:fields
715 /* destroy the fields */
1817 PetscCheck(field < dm->Nf, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %" PetscInt_FMT " >= %" PetscInt_FMT " fields", field, dm->Nf);
1850 PetscCheck(field < dm->Nf, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %" PetscInt_FMT " >= %" PetscInt_FMT " fields", field, dm->Nf);
1881 PetscCheck(field < dm->Nf, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %" PetscInt_FMT " >= %" PetscInt_FMT " fields", field, dm->Nf);
1915 PetscCheck(field < dm->Nf, PetscObjectComm((PetscObject)dm), PETSC_ERR_ARG_OUTOFRANGE, "Cannot handle %" PetscInt_FMT " >= %" PetscInt_FMT " fields", field, dm->Nf);
1930 + numFields - The number of fields (or `NULL` if not requested)
1932 - fields - The global indices for each field (or `NULL` if not requested)
1938 `PetscFree()`, every entry of `fields` should be destroyed with `ISDestroy()`, and both arrays should be freed with
1948 PetscErrorCode DMCreateFieldIS(DM dm, PetscInt *numFields, char ***fieldNames, IS *fields[])
1962 if (fields) {
1963 PetscAssertPointer(fields, 4);
1964 *fields = NULL;
2027 if (fields) {
2028 PetscCall(PetscMalloc1(nF, fields));
2032 PetscCall(ISCreateGeneral(PetscObjectComm((PetscObject)dm), fieldSizes[f], fieldIndices[f], PETSC_OWN_POINTER, &(*fields)[f]));
2037 PetscCall(ISSetBlockSize((*fields)[f], bs));
2041 } else PetscTryTypeMethod(dm, createfieldis, numFields, fieldNames, fields);
2047 corresponding to different fields.
2055 + len - The number of fields (or `NULL` if not requested)
2148 DMCreateSubDM - Returns an `IS` and `DM` encapsulating a subproblem defined by the fields passed in.
2149 The fields are defined by `DMCreateFieldIS()`.
2155 . numFields - The number of fields to select
2156 - fields - The field numbers of the selected fields
2169 PetscErrorCode DMCreateSubDM(DM dm, PetscInt numFields, const PetscInt fields[], IS *is, DM *subdm)
2173 PetscAssertPointer(fields, 3);
2176 PetscUseTypeMethod(dm, createsubdm, numFields, fields, is, subdm);
2702 /* We could start to label fields by their transformation properties */
4927 for (f = 0; f < Nf; ++f) tmpr[f] = dm->fields[f];
4933 PetscCall(PetscFree(dm->fields));
4935 dm->fields = tmpr;
4940 DMClearFields - Remove all fields from the `DM`
4957 if (!dm->fields) PetscFunctionReturn(PETSC_SUCCESS); // DMDA does not use fields field in DM
4959 PetscCall(PetscObjectDestroy(&dm->fields[f].disc));
4960 PetscCall(DMLabelDestroy(&dm->fields[f].label));
4962 PetscCall(PetscFree(dm->fields));
4963 dm->fields = NULL;
4969 DMGetNumFields - Get the number of fields in the `DM`
4977 . numFields - The number of fields
4993 DMSetNumFields - Set the number of fields in the `DM`
4999 - numFields - The number of fields
5045 if (!dm->fields) {
5048 } else { // some DM such as DMDA do not have dm->fields
5049 if (label) *label = dm->fields[f].label;
5050 if (disc) *disc = dm->fields[f].disc;
5060 PetscCall(DMLabelDestroy(&dm->fields[f].label));
5061 PetscCall(PetscObjectDestroy(&dm->fields[f].disc));
5062 dm->fields[f].label = label;
5063 dm->fields[f].disc = disc;
5132 dm->fields[Nf].label = label;
5133 dm->fields[Nf].disc = disc;
5159 dm->fields[f].avoidTensor = avoidTensor;
5183 *avoidTensor = dm->fields[f].avoidTensor;
5279 if (useCone) *useCone = dm->fields[f].adjacency[0];
5280 if (useClosure) *useClosure = dm->fields[f].adjacency[1];
5320 dm->fields[f].adjacency[0] = useCone;
5321 dm->fields[f].adjacency[1] = useClosure;
5502 tmpd[s].fields = NULL;
5556 PetscCall(ISDestroy(&dm->probs[s].fields));
5649 + fields - The `IS` containing the `DM` field numbers for the fields in this `PetscDS`, or `NULL`
5658 fields = `NULL` and ds = `NULL` if there is no `PetscDS` for the full domain.
5662 PetscErrorCode DMGetRegionDS(DM dm, DMLabel label, IS *fields, PetscDS *ds, PetscDS *dsIn)
5669 if (fields) {
5670 PetscAssertPointer(fields, 3);
5671 *fields = NULL;
5683 if (fields) *fields = dm->probs[s].fields;
5700 . fields - The `IS` containing the `DM` field numbers for the fields in this `PetscDS`, or `NULL` for all fields
5708 the fields argument is ignored.
5712 PetscErrorCode DMSetRegionDS(DM dm, DMLabel label, IS fields, PetscDS ds, PetscDS dsIn)
5719 if (fields) PetscValidHeaderSpecific(fields, IS_CLASSID, 3);
5733 PetscCall(PetscObjectReference((PetscObject)fields));
5742 dm->probs[Nds].fields = fields;
5759 . fields - The `IS` containing the `DM` field numbers for the fields in this `PetscDS`, or `NULL`
5767 PetscErrorCode DMGetRegionNumDS(DM dm, PetscInt num, DMLabel *label, IS *fields, PetscDS *ds, PetscDS *dsIn)
5779 if (fields) {
5780 PetscAssertPointer(fields, 4);
5781 *fields = dm->probs[num].fields;
5803 . fields - The `IS` containing the `DM` field numbers for the fields in this `PetscDS`, or `NULL` to prevent setting
5811 PetscErrorCode DMSetRegionNumDS(DM dm, PetscInt num, DMLabel label, IS fields, PetscDS ds, PetscDS dsIn)
5823 if (fields) {
5824 PetscValidHeaderSpecific(fields, IS_CLASSID, 4);
5825 PetscCall(PetscObjectReference((PetscObject)fields));
5826 PetscCall(ISDestroy(&dm->probs[num].fields));
5827 dm->probs[num].fields = fields;
5916 DMCreateDS - Create the discrete systems for the `DM` based upon the fields added to the `DM`
5943 if (!dm->fields) PetscFunctionReturn(PETSC_SUCCESS);
5954 DMLabel label = dm->fields[f].label;
5962 PetscCall(PetscObjectGetClassId(dm->fields[f].disc, &id));
5967 PetscCall(PetscFESetCeed((PetscFE)dm->fields[f].disc, ceed));
5983 IS fields;
5987 if (!dm->fields[f].label) ++nf;
5988 PetscCheck(nf, comm, PETSC_ERR_PLIB, "All fields have labels, but we are trying to create a default DS");
5991 if (!dm->fields[f].label) fld[nf++] = f;
5992 PetscCall(ISCreate(PETSC_COMM_SELF, &fields));
5993 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)fields, "dm_fields_"));
5994 PetscCall(ISSetType(fields, ISGENERAL));
5995 PetscCall(ISGeneralSetIndices(fields, nf, fld, PETSC_OWN_POINTER));
5998 PetscCall(DMSetRegionDS(dm, NULL, fields, dsDef, NULL));
6000 PetscCall(ISDestroy(&fields));
6004 /* Intersect labels with default fields */
6009 PetscInt *fields;
6037 PetscCall(PetscMalloc1(Ndef, &fields));
6039 if (!dm->fields[f].label) fields[nf++] = f;
6043 PetscCall(ISGeneralSetIndices(fieldIS, nf, fields, PETSC_OWN_POINTER));
6060 IS fields;
6065 if (label == dm->fields[f].label || !dm->fields[f].label) ++nf;
6068 if (label == dm->fields[f].label || !dm->fields[f].label) fld[nf++] = f;
6069 PetscCall(ISCreate(PETSC_COMM_SELF, &fields));
6070 PetscCall(PetscObjectSetOptionsPrefix((PetscObject)fields, "dm_fields_"));
6071 PetscCall(ISSetType(fields, ISGENERAL));
6072 PetscCall(ISGeneralSetIndices(fields, nf, fld, PETSC_OWN_POINTER));
6099 if (label == dm->fields[f].label || !dm->fields[f].label) {
6100 if (label == dm->fields[f].label) {
6112 PetscCall(DMSetRegionDS(dm, label, fields, ds, dsIn));
6113 PetscCall(ISDestroy(&fields));
6118 /* Set fields in DSes */
6122 IS fields = dm->probs[s].fields;
6129 PetscCall(ISGetLocalSize(fields, &nf));
6130 PetscCall(ISGetIndices(fields, &fld));
6132 PetscObject disc = dm->fields[fld[f]].disc;
6136 /* Handle DS with no fields */
6138 /* If this is a cohesive cell, then regular fields need the lower dimensional discretization */
6153 /* We allow people to have placeholder fields and construct the Section by hand */
6157 PetscCall(ISRestoreIndices(fields, &fld));
6279 const PetscInt *fields, id = 1;
6284 PetscCall(ISGetIndices(fieldIS, &fields));
6288 for (f = 0; f < dsNf; ++f) PetscCall(PetscDSGetExactSolution(ds, fields[f], &exacts[fields[f]], &ectxs[fields[f]]));
6295 for (f = 0; f < dsNf; ++f) PetscCall(PetscDSGetExactSolutionTimeDerivative(ds, fields[f], &exacts[fields[f]], &ectxs[fields[f]]));
6299 PetscCall(ISRestoreIndices(fieldIS, &fields));
6323 static PetscErrorCode DMTransferDS_Internal(DM dm, DMLabel label, IS fields, PetscInt minDegree, PetscInt maxDegree, PetscDS ds, PetscDS dsIn)
6334 PetscCall(DMSetRegionDS(dm, label, fields, dsNew, dsInNew));
6367 IS fields;
6371 PetscCall(DMGetRegionNumDS(dm, s, &label, &fields, &ds, &dsIn));
6373 PetscCall(DMTransferDS_Internal(newdm, label, fields, minDegree, maxDegree, ds, dsIn));
6391 DMCopyDisc - Copy the fields and discrete systems for the `DM` into another `DM`
8061 . Nf - the number of fields
8417 DMProjectFieldLocal - This projects the given function of the input fields into the function space provided by the `DM`, putting the coefficients in a local vector.
8433 . Nf - The number of input fields
8434 . NfAux - The number of input auxiliary fields
8456 a subdomain. You can also output a different number of fields than the input, with different discretizations. Last the auxiliary `DM`, attached to the
8457 auxiliary field vector, which is attached to dm, can also be different. It can have a different topology, number of fields, and discretizations.
8478 DMProjectFieldLabelLocal - This projects the given function of the input fields into the function space provided, putting the coefficients in a local vector, calculating only over the portion of the domain specified by the label.
8499 . Nf - The number of input fields
8500 . NfAux - The number of input auxiliary fields
8522 a subdomain. You can also output a different number of fields than the input, with different discretizations. Last the auxiliary `DM`, attached to the
8523 auxiliary field vector, which is attached to dm, can also be different. It can have a different topology, number of fields, and discretizations.
8543 DMProjectFieldLabel - This projects the given function of the input fields into the function space provided, putting the coefficients in a global vector, calculating only over the portion of the domain specified by the label.
8564 . Nf - The number of input fields
8565 . NfAux - The number of input auxiliary fields
8587 a subdomain. You can also output a different number of fields than the input, with different discretizations. Last the auxiliary `DM`, attached to the
8588 auxiliary field vector, which is attached to dm, can also be different. It can have a different topology, number of fields, and discretizations.
8619 DMProjectBdFieldLabelLocal - This projects the given function of the input fields into the function space provided, putting the coefficients in a local vector, calculating only over the portion of the domain boundary specified by the label.
8640 . Nf - The number of input fields
8641 . NfAux - The number of input auxiliary fields
8664 a subdomain. You can also output a different number of fields than the input, with different discretizations. Last the auxiliary `DM`, attached to the
8665 auxiliary field vector, which is attached to dm, can also be different. It can have a different topology, number of fields, and discretizations.
9148 . errors - An array of length Nf, the number of fields, or `NULL` for no output; on output
9176 const PetscInt *fields;
9181 if (fieldIS) PetscCall(ISGetIndices(fieldIS, &fields));
9183 const PetscInt field = fields[f];
9186 if (fieldIS) PetscCall(ISRestoreIndices(fieldIS, &fields));