Actual source code: petscdmlabel.h

  1: #pragma once
  2: #include <petscis.h>

  4: PETSC_EXTERN PetscClassId DMLABEL_CLASSID;

  6: typedef const char *DMLabelType;
  7: #define DMLABELCONCRETE  "concrete"
  8: #define DMLABELEPHEMERAL "ephemeral"

 10: /* SUBMANSEC = DMLabel */

 12: /*S
 13:   DMLabel - Object which encapsulates a subset of the mesh from a `DM`

 15:   Level: developer

 17:   Note:
 18:   A label consists of a set of points on a `DM`

 20: .seealso: [](ch_dmbase), `DM`, `DMPlexCreate()`, `DMLabelCreate()`, `DMLabelView()`, `DMLabelDestroy()`, `DMPlexCreateLabelField()`,
 21:           `DMLabelGetDefaultValue()`, `DMLabelSetDefaultValue()`, `DMLabelDuplicate()`, `DMLabelGetValue()`, `DMLabelSetValue()`,
 22:           `DMLabelAddStratum()`, `DMLabelAddStrata()`, `DMLabelInsertIS()`, `DMLabelGetNumValues()`, `DMLabelGetValueIS()`,
 23:           `DMLabelGetStratumSize()`, `DMLabelComputeIndex()`, `DMLabelDestroyIndex()`, `DMLabelDistribute()`, `DMLabelConvertToSection()`
 24: S*/
 25: typedef struct _p_DMLabel *DMLabel;

 27: PETSC_EXTERN PetscFunctionList DMLabelList;
 28: PETSC_EXTERN PetscErrorCode    DMLabelCreate(MPI_Comm, const char[], DMLabel *);
 29: PETSC_EXTERN PetscErrorCode    DMLabelSetType(DMLabel, DMLabelType);
 30: PETSC_EXTERN PetscErrorCode    DMLabelGetType(DMLabel, DMLabelType *);
 31: PETSC_EXTERN PetscErrorCode    DMLabelRegister(const char[], PetscErrorCode (*)(DMLabel));
 32: PETSC_EXTERN PetscErrorCode    DMLabelRegisterAll(void);
 33: PETSC_EXTERN PetscErrorCode    DMLabelRegisterDestroy(void);
 34: PETSC_EXTERN PetscErrorCode    DMLabelSetUp(DMLabel);
 35: PETSC_EXTERN PetscErrorCode    DMLabelSetFromOptions(DMLabel);
 36: PETSC_EXTERN PetscErrorCode    DMLabelView(DMLabel, PetscViewer);
 37: PETSC_EXTERN PetscErrorCode    DMLabelDuplicate(DMLabel, DMLabel *);
 38: PETSC_EXTERN PetscErrorCode    DMLabelReset(DMLabel);
 39: PETSC_EXTERN PetscErrorCode    DMLabelDestroy(DMLabel *);

 41: PETSC_EXTERN PetscErrorCode DMLabelGetDefaultValue(DMLabel, PetscInt *);
 42: PETSC_EXTERN PetscErrorCode DMLabelSetDefaultValue(DMLabel, PetscInt);
 43: PETSC_EXTERN PetscErrorCode DMLabelGetValue(DMLabel, PetscInt, PetscInt *);
 44: PETSC_EXTERN PetscErrorCode DMLabelSetValue(DMLabel, PetscInt, PetscInt);
 45: PETSC_EXTERN PetscErrorCode DMLabelClearValue(DMLabel, PetscInt, PetscInt);
 46: PETSC_EXTERN PetscErrorCode DMLabelAddStratum(DMLabel, PetscInt);
 47: PETSC_EXTERN PetscErrorCode DMLabelAddStrata(DMLabel, PetscInt, const PetscInt[]);
 48: PETSC_EXTERN PetscErrorCode DMLabelAddStrataIS(DMLabel, IS);
 49: PETSC_EXTERN PetscErrorCode DMLabelInsertIS(DMLabel, IS, PetscInt);
 50: PETSC_EXTERN PetscErrorCode DMLabelGetNumValues(DMLabel, PetscInt *);
 51: PETSC_EXTERN PetscErrorCode DMLabelGetStratumBounds(DMLabel, PetscInt, PetscInt *, PetscInt *);
 52: PETSC_EXTERN PetscErrorCode DMLabelGetValueIS(DMLabel, IS *);
 53: PETSC_EXTERN PetscErrorCode DMLabelGetNonEmptyStratumValuesIS(DMLabel, IS *);
 54: PETSC_EXTERN PetscErrorCode DMLabelGetValueIndex(DMLabel, PetscInt, PetscInt *);
 55: PETSC_EXTERN PetscErrorCode DMLabelStratumHasPoint(DMLabel, PetscInt, PetscInt, PetscBool *);
 56: PETSC_EXTERN PetscErrorCode DMLabelHasStratum(DMLabel, PetscInt, PetscBool *);
 57: PETSC_EXTERN PetscErrorCode DMLabelGetStratumSize(DMLabel, PetscInt, PetscInt *);
 58: PETSC_EXTERN PetscErrorCode DMLabelGetStratumIS(DMLabel, PetscInt, IS *);
 59: PETSC_EXTERN PetscErrorCode DMLabelSetStratumIS(DMLabel, PetscInt, IS);
 60: PETSC_EXTERN PetscErrorCode DMLabelSetStratumBounds(DMLabel, PetscInt, PetscInt, PetscInt);
 61: PETSC_EXTERN PetscErrorCode DMLabelClearStratum(DMLabel, PetscInt);
 62: PETSC_EXTERN PetscErrorCode DMLabelGetStratumPointIndex(DMLabel, PetscInt, PetscInt, PetscInt *);

 64: PETSC_EXTERN PetscErrorCode DMLabelCompare(MPI_Comm, DMLabel, DMLabel, PetscBool *, char **message);
 65: PETSC_EXTERN PetscErrorCode DMLabelComputeIndex(DMLabel);
 66: PETSC_EXTERN PetscErrorCode DMLabelCreateIndex(DMLabel, PetscInt, PetscInt);
 67: PETSC_EXTERN PetscErrorCode DMLabelDestroyIndex(DMLabel);
 68: PETSC_EXTERN PetscErrorCode DMLabelHasValue(DMLabel, PetscInt, PetscBool *);
 69: PETSC_EXTERN PetscErrorCode DMLabelHasPoint(DMLabel, PetscInt, PetscBool *);
 70: PETSC_EXTERN PetscErrorCode DMLabelGetBounds(DMLabel, PetscInt *, PetscInt *);
 71: PETSC_EXTERN PetscErrorCode DMLabelFilter(DMLabel, PetscInt, PetscInt);
 72: PETSC_EXTERN PetscErrorCode DMLabelPermute(DMLabel, IS, DMLabel *);
 73: PETSC_EXTERN PetscErrorCode DMLabelDistribute(DMLabel, PetscSF, DMLabel *);
 74: PETSC_EXTERN PetscErrorCode DMLabelGather(DMLabel, PetscSF, DMLabel *);
 75: PETSC_EXTERN PetscErrorCode DMLabelConvertToSection(DMLabel, PetscSection *, IS *);

 77: PETSC_EXTERN PetscErrorCode DMLabelPropagateBegin(DMLabel, PetscSF);
 78: PETSC_EXTERN PetscErrorCode DMLabelPropagatePush(DMLabel, PetscSF, PetscErrorCode (*)(DMLabel, PetscInt, PetscInt, void *), void *);
 79: PETSC_EXTERN PetscErrorCode DMLabelPropagateEnd(DMLabel, PetscSF);

 81: PETSC_EXTERN PetscErrorCode PetscSectionCreateGlobalSectionLabel(PetscSection, PetscSF, PetscBool, DMLabel, PetscInt, PetscSection *);

 83: #define PETSCSECTIONSYMLABEL "label"
 84: PETSC_EXTERN PetscErrorCode PetscSectionSymCreateLabel(MPI_Comm, DMLabel, PetscSectionSym *);
 85: PETSC_EXTERN PetscErrorCode PetscSectionSymLabelSetLabel(PetscSectionSym, DMLabel);
 86: PETSC_EXTERN PetscErrorCode PetscSectionSymLabelGetStratum(PetscSectionSym, PetscInt, PetscInt *, PetscInt *, PetscInt *, const PetscInt ***, const PetscScalar ***);
 87: PETSC_EXTERN PetscErrorCode PetscSectionSymLabelSetStratum(PetscSectionSym, PetscInt, PetscInt, PetscInt, PetscInt, PetscCopyMode, const PetscInt **, const PetscScalar **);