1a4963045SJacob Faibussowitsch #pragma once 2c58f1c22SToby Isaac #include <petscis.h> 3c58f1c22SToby Isaac 49f6c5813SMatthew G. Knepley PETSC_EXTERN PetscClassId DMLABEL_CLASSID; 59f6c5813SMatthew G. Knepley 69f6c5813SMatthew G. Knepley typedef const char *DMLabelType; 79f6c5813SMatthew G. Knepley #define DMLABELCONCRETE "concrete" 89f6c5813SMatthew G. Knepley #define DMLABELEPHEMERAL "ephemeral" 99f6c5813SMatthew G. Knepley 10ac09b921SBarry Smith /* SUBMANSEC = DMLabel */ 11ac09b921SBarry Smith 12c58f1c22SToby Isaac /*S 1387497f52SBarry Smith DMLabel - Object which encapsulates a subset of the mesh from a `DM` 14c58f1c22SToby Isaac 15c58f1c22SToby Isaac Level: developer 16c58f1c22SToby Isaac 1787497f52SBarry Smith Note: 1887497f52SBarry Smith A label consists of a set of points on a `DM` 1987497f52SBarry Smith 20*af27ebaaSBarry Smith .seealso: [](ch_dmbase), `DM`, `DMPlexCreate()`, `DMLabelCreate()`, `DMLabelView()`, `DMLabelDestroy()`, `DMPlexCreateLabel()`, 2187497f52SBarry Smith `DMLabelGetDefaultValue()`, `DMLabelSetDefaultValue()`, `DMLabelDuplicate()`, `DMLabelGetValue()`, `DMLabelSetValue()`, 2287497f52SBarry Smith `DMLabelAddStratum()`, `DMLabelAddStrata()`, `DMLabelInsertIS()`, `DMLabelGetNumValues()`, `DMLabelGetValueIS()`, 2387497f52SBarry Smith `DMLabelGetStratumSize()`, `DMLabelComputeIndex()`, `DMLabelDestroyIndex()`, `DMLabelDistribute()`, `DMLabelConvertToSection()` 24c58f1c22SToby Isaac S*/ 25ed748876SSatish Balay typedef struct _p_DMLabel *DMLabel; 26a1cc8097SBarry Smith 279f6c5813SMatthew G. Knepley PETSC_EXTERN PetscFunctionList DMLabelList; 28d67d17b1SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelCreate(MPI_Comm, const char[], DMLabel *); 299f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelSetType(DMLabel, DMLabelType); 309f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelGetType(DMLabel, DMLabelType *); 319f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelRegister(const char[], PetscErrorCode (*)(DMLabel)); 329f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelRegisterAll(void); 339f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelRegisterDestroy(void); 349f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelSetUp(DMLabel); 359f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelSetFromOptions(DMLabel); 36c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelView(DMLabel, PetscViewer); 379f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelDuplicate(DMLabel, DMLabel *); 38d67d17b1SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelReset(DMLabel); 39c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelDestroy(DMLabel *); 409f6c5813SMatthew G. Knepley 415aa44df4SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetDefaultValue(DMLabel, PetscInt *); 425aa44df4SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelSetDefaultValue(DMLabel, PetscInt); 43c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetValue(DMLabel, PetscInt, PetscInt *); 44c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelSetValue(DMLabel, PetscInt, PetscInt); 45c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelClearValue(DMLabel, PetscInt, PetscInt); 46c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelAddStratum(DMLabel, PetscInt); 47b9907514SLisandro Dalcin PETSC_EXTERN PetscErrorCode DMLabelAddStrata(DMLabel, PetscInt, const PetscInt[]); 48b9907514SLisandro Dalcin PETSC_EXTERN PetscErrorCode DMLabelAddStrataIS(DMLabel, IS); 49c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelInsertIS(DMLabel, IS, PetscInt); 50c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetNumValues(DMLabel, PetscInt *); 51c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetStratumBounds(DMLabel, PetscInt, PetscInt *, PetscInt *); 52c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetValueIS(DMLabel, IS *); 531d04cbbeSVaclav Hapla PETSC_EXTERN PetscErrorCode DMLabelGetNonEmptyStratumValuesIS(DMLabel, IS *); 54d123abd9SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelGetValueIndex(DMLabel, PetscInt, PetscInt *); 55c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelStratumHasPoint(DMLabel, PetscInt, PetscInt, PetscBool *); 56fada774cSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelHasStratum(DMLabel, PetscInt, PetscBool *); 57c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetStratumSize(DMLabel, PetscInt, PetscInt *); 58c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelGetStratumIS(DMLabel, PetscInt, IS *); 594de306b1SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelSetStratumIS(DMLabel, PetscInt, IS); 60412e9a14SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelSetStratumBounds(DMLabel, PetscInt, PetscInt, PetscInt); 61c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelClearStratum(DMLabel, PetscInt); 62d123abd9SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelGetStratumPointIndex(DMLabel, PetscInt, PetscInt, PetscInt *); 63b9907514SLisandro Dalcin 649f6c5813SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelCompare(MPI_Comm, DMLabel, DMLabel, PetscBool *, char **message); 65c6a43d28SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelComputeIndex(DMLabel); 66c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelCreateIndex(DMLabel, PetscInt, PetscInt); 67c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelDestroyIndex(DMLabel); 68c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelHasValue(DMLabel, PetscInt, PetscBool *); 69c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelHasPoint(DMLabel, PetscInt, PetscBool *); 70c6a43d28SMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelGetBounds(DMLabel, PetscInt *, PetscInt *); 71c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelFilter(DMLabel, PetscInt, PetscInt); 72c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelPermute(DMLabel, IS, DMLabel *); 73c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelDistribute(DMLabel, PetscSF, DMLabel *); 747937d9ceSMichael Lange PETSC_EXTERN PetscErrorCode DMLabelGather(DMLabel, PetscSF, DMLabel *); 75c58f1c22SToby Isaac PETSC_EXTERN PetscErrorCode DMLabelConvertToSection(DMLabel, PetscSection *, IS *); 76c58f1c22SToby Isaac 77d42890abSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelPropagateBegin(DMLabel, PetscSF); 78d42890abSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelPropagatePush(DMLabel, PetscSF, PetscErrorCode (*)(DMLabel, PetscInt, PetscInt, void *), void *); 79d42890abSMatthew G. Knepley PETSC_EXTERN PetscErrorCode DMLabelPropagateEnd(DMLabel, PetscSF); 80d42890abSMatthew G. Knepley 813dec45f3SMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscSectionCreateGlobalSectionLabel(PetscSection, PetscSF, PetscBool, DMLabel, PetscInt, PetscSection *); 823dec45f3SMatthew G. Knepley 835fdea053SToby Isaac #define PETSCSECTIONSYMLABEL "label" 845fdea053SToby Isaac PETSC_EXTERN PetscErrorCode PetscSectionSymCreateLabel(MPI_Comm, DMLabel, PetscSectionSym *); 855fdea053SToby Isaac PETSC_EXTERN PetscErrorCode PetscSectionSymLabelSetLabel(PetscSectionSym, DMLabel); 86b004864fSMatthew G. Knepley PETSC_EXTERN PetscErrorCode PetscSectionSymLabelGetStratum(PetscSectionSym, PetscInt, PetscInt *, PetscInt *, PetscInt *, const PetscInt ***, const PetscScalar ***); 875fdea053SToby Isaac PETSC_EXTERN PetscErrorCode PetscSectionSymLabelSetStratum(PetscSectionSym, PetscInt, PetscInt, PetscInt, PetscInt, PetscCopyMode, const PetscInt **, const PetscScalar **); 88