xref: /petsc/include/petscao.h (revision da8c939b118068a1ceac5e4b3ba271c87cfc5bc7)
16524c165SJacob Faibussowitsch #ifndef PETSCAO_H
226bd1501SBarry Smith #define PETSCAO_H
3ac09b921SBarry Smith 
42c8e378dSBarry Smith #include <petscis.h>
57588ac45SBarry Smith 
6ac09b921SBarry Smith /* SUBMANSEC = AO */
7ac09b921SBarry Smith 
8b9617806SBarry Smith /*S
916a05f60SBarry Smith      AO - Abstract PETSc object that manages mapping between different global numberings
10b9617806SBarry Smith 
11b9617806SBarry Smith    Level: intermediate
12b9617806SBarry Smith 
1387497f52SBarry Smith    Notes:
1416a05f60SBarry Smith    An application ordering is usually mapping between an application-centric
1516a05f60SBarry Smith    numbering (the ordering that is "natural" for the application) and
1616a05f60SBarry Smith    the parallel numbering that PETSc uses.
1787497f52SBarry Smith 
1887497f52SBarry Smith .seealso: `AOCreateBasic()`, `AOCreateBasicIS()`, `AOPetscToApplication()`, `AOView()`, `AOApplicationToPetsc()`, `AOType`, `AOSetType()`
19b9617806SBarry Smith S*/
201ac94ccfSSatish Balay typedef struct _p_AO *AO;
217588ac45SBarry Smith 
2276bdecfbSBarry Smith /*J
2316a05f60SBarry Smith     AOType - String with the name of a PETSc application ordering type
24b439297aSHong Zhang 
25b439297aSHong Zhang    Level: beginner
26b439297aSHong Zhang 
27db781477SPatrick Sanan .seealso: `AOSetType()`, `AO`
2876bdecfbSBarry Smith J*/
2919fd82e9SBarry Smith typedef const char *AOType;
30b439297aSHong Zhang #define AOBASIC          "basic"
31b439297aSHong Zhang #define AOADVANCED       "advanced"
32b439297aSHong Zhang #define AOMAPPING        "mapping"
330392740eSHong Zhang #define AOMEMORYSCALABLE "memoryscalable"
34b439297aSHong Zhang 
358ba1e511SMatthew Knepley /* Logging support */
36014dd563SJed Brown PETSC_EXTERN PetscClassId AO_CLASSID;
378ba1e511SMatthew Knepley 
38607a6623SBarry Smith PETSC_EXTERN PetscErrorCode AOInitializePackage(void);
398ba1e511SMatthew Knepley 
40014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreate(MPI_Comm, AO *);
41014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOSetIS(AO, IS, IS);
42014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOSetFromOptions(AO);
43b439297aSHong Zhang 
44014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateBasic(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
45014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateBasicIS(IS, IS, AO *);
46014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMemoryScalable(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
47014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMemoryScalableIS(IS, IS, AO *);
48014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMapping(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
49014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMappingIS(IS, IS, AO *);
504ebda54eSMatthew Knepley 
51014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOView(AO, PetscViewer);
52fe2efc57SMark PETSC_EXTERN PetscErrorCode AOViewFromOptions(AO, PetscObject, const char[]);
53014dd563SJed Brown PETSC_EXTERN PetscErrorCode AODestroy(AO *);
54b439297aSHong Zhang 
55b439297aSHong Zhang /* Dynamic creation and loading functions */
5619fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode AOSetType(AO, AOType);
5719fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode AOGetType(AO, AOType *);
584ebda54eSMatthew Knepley 
59bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode AORegister(const char[], PetscErrorCode (*)(AO));
60*da8c939bSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode AORegisterAll(void);
61b439297aSHong Zhang 
62014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplication(AO, PetscInt, PetscInt[]);
63014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetsc(AO, PetscInt, PetscInt[]);
64014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplicationIS(AO, IS);
65014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetscIS(AO, IS);
667588ac45SBarry Smith 
67014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]);
68014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]);
69014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]);
70014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]);
714ebda54eSMatthew Knepley 
72014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOMappingHasApplicationIndex(AO, PetscInt, PetscBool *);
73014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOMappingHasPetscIndex(AO, PetscInt, PetscBool *);
747588ac45SBarry Smith 
757588ac45SBarry Smith #endif
76