Actual source code: dmlabelephplex.c
1: #include <petsc/private/dmlabelimpl.h>
2: #include <petscdmlabelephemeral.h>
4: /*@
5: DMLabelEphemeralGetTransform - Get the transform for this ephemeral label
7: Not Collective
9: Input Parameter:
10: . label - the `DMLabel`
12: Output Parameter:
13: . tr - the transform for this ephemeral label
15: Level: intermediate
17: Note:
18: Ephemeral labels are produced automatically from a base label and a `DMPlexTransform`.
20: .seealso: `DMLabelEphemeralSetTransform()`, `DMLabelEphemeralGetLabel()`, `DMLabelSetType()`
21: @*/
22: PetscErrorCode DMLabelEphemeralGetTransform(DMLabel label, DMPlexTransform *tr)
23: {
24: PetscFunctionBegin;
25: PetscCall(PetscObjectQuery((PetscObject)label, "__transform__", (PetscObject *)tr));
26: PetscFunctionReturn(PETSC_SUCCESS);
27: }
29: /*@
30: DMLabelEphemeralSetTransform - Set the transform for this ephemeral label
32: Not Collective
34: Input Parameters:
35: + label - the `DMLabel`
36: - tr - the transform for this ephemeral label
38: Level: intermediate
40: Note:
41: Ephemeral labels are produced automatically from a base label and a `DMPlexTransform`.
43: .seealso: `DMLabelEphemeralGetTransform()`, `DMLabelEphemeralSetLabel()`, `DMLabelSetType()`
44: @*/
45: PetscErrorCode DMLabelEphemeralSetTransform(DMLabel label, DMPlexTransform tr)
46: {
47: PetscFunctionBegin;
48: PetscCall(PetscObjectCompose((PetscObject)label, "__transform__", (PetscObject)tr));
49: PetscFunctionReturn(PETSC_SUCCESS);
50: }