xref: /petsc/src/dm/label/impls/ephemeral/plex/dmlabelephplex.c (revision 20f4b53cbb5e9bd9ef12b76a8697d60d197cda17)
19f6c5813SMatthew G. Knepley #include <petsc/private/dmlabelimpl.h> /*I      "petscdmlabelephemeral.h"   I*/
29f6c5813SMatthew G. Knepley #include <petscdmlabelephemeral.h>     /*I      "petscdmplextransform.h"    I*/
39f6c5813SMatthew G. Knepley 
49f6c5813SMatthew G. Knepley /*@
59f6c5813SMatthew G. Knepley   DMLabelEphemeralGetTransform - Get the transform for this ephemeral label
69f6c5813SMatthew G. Knepley 
7*20f4b53cSBarry Smith   Not Collective
89f6c5813SMatthew G. Knepley 
99f6c5813SMatthew G. Knepley   Input Parameter:
10*20f4b53cSBarry Smith . label - the `DMLabel`
119f6c5813SMatthew G. Knepley 
129f6c5813SMatthew G. Knepley   Output Paramater:
139f6c5813SMatthew G. Knepley . tr - the transform for this ephemeral label
149f6c5813SMatthew G. Knepley 
15*20f4b53cSBarry Smith   Level: intermediate
16*20f4b53cSBarry Smith 
179f6c5813SMatthew G. Knepley   Note:
189f6c5813SMatthew G. Knepley   Ephemeral labels are produced automatically from a base label and a `DMPlexTransform`.
199f6c5813SMatthew G. Knepley 
209f6c5813SMatthew G. Knepley .seealso: `DMLabelEphemeralSetTransform()`, `DMLabelEphemeralGetLabel()`, `DMLabelSetType()`
219f6c5813SMatthew G. Knepley @*/
229f6c5813SMatthew G. Knepley PetscErrorCode DMLabelEphemeralGetTransform(DMLabel label, DMPlexTransform *tr)
239f6c5813SMatthew G. Knepley {
249f6c5813SMatthew G. Knepley   PetscFunctionBegin;
259f6c5813SMatthew G. Knepley   PetscCall(PetscObjectQuery((PetscObject)label, "__transform__", (PetscObject *)tr));
263ba16761SJacob Faibussowitsch   PetscFunctionReturn(PETSC_SUCCESS);
279f6c5813SMatthew G. Knepley }
289f6c5813SMatthew G. Knepley 
299f6c5813SMatthew G. Knepley /*@
309f6c5813SMatthew G. Knepley   DMLabelEphemeralSetTransform - Set the transform for this ephemeral label
319f6c5813SMatthew G. Knepley 
32*20f4b53cSBarry Smith   Not Collective
339f6c5813SMatthew G. Knepley 
349f6c5813SMatthew G. Knepley   Input Parameters:
35*20f4b53cSBarry Smith + label - the `DMLabel`
369f6c5813SMatthew G. Knepley - tr    - the transform for this ephemeral label
379f6c5813SMatthew G. Knepley 
38*20f4b53cSBarry Smith   Level: intermediate
39*20f4b53cSBarry Smith 
409f6c5813SMatthew G. Knepley   Note:
419f6c5813SMatthew G. Knepley   Ephemeral labels are produced automatically from a base label and a `DMPlexTransform`.
429f6c5813SMatthew G. Knepley 
439f6c5813SMatthew G. Knepley .seealso: `DMLabelEphemeralGetTransform()`, `DMLabelEphemeralSetLabel()`, `DMLabelSetType()`
449f6c5813SMatthew G. Knepley @*/
459f6c5813SMatthew G. Knepley PetscErrorCode DMLabelEphemeralSetTransform(DMLabel label, DMPlexTransform tr)
469f6c5813SMatthew G. Knepley {
479f6c5813SMatthew G. Knepley   PetscFunctionBegin;
489f6c5813SMatthew G. Knepley   PetscCall(PetscObjectCompose((PetscObject)label, "__transform__", (PetscObject)tr));
493ba16761SJacob Faibussowitsch   PetscFunctionReturn(PETSC_SUCCESS);
509f6c5813SMatthew G. Knepley }
51