xref: /petsc/include/petscao.h (revision 6d8694c4fbab79f9439f1ad13c0386ba7ee1ca4b)
1a4963045SJacob Faibussowitsch #pragma once
2ac09b921SBarry Smith 
32c8e378dSBarry Smith #include <petscis.h>
47588ac45SBarry Smith 
5*ce78bad3SBarry Smith /* MANSEC = Vec */
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 
13af27ebaaSBarry Smith    Note:
1495bd0b28SBarry Smith    An application ordering is usually a mapping between an application-centric
1516a05f60SBarry Smith    numbering (the ordering that is "natural" for the application) and
16af27ebaaSBarry Smith    the parallel numbering ($0$ to $n_0-1$ on the first MPI process, $n_0$ to $n_1 - 1$ on the second MPI process, etc)
17af27ebaaSBarry Smith    that PETSc uses.
1887497f52SBarry Smith 
1987497f52SBarry Smith .seealso: `AOCreateBasic()`, `AOCreateBasicIS()`, `AOPetscToApplication()`, `AOView()`, `AOApplicationToPetsc()`, `AOType`, `AOSetType()`
20b9617806SBarry Smith S*/
211ac94ccfSSatish Balay typedef struct _p_AO *AO;
227588ac45SBarry Smith 
2376bdecfbSBarry Smith /*J
2416a05f60SBarry Smith     AOType - String with the name of a PETSc application ordering type
25b439297aSHong Zhang 
26b439297aSHong Zhang    Level: beginner
27b439297aSHong Zhang 
28af27ebaaSBarry Smith .seealso: `AOSetType()`, `AO`, `AOApplicationToPetsc()`, `AOCreateBasic()`, `AOCreate()`
2976bdecfbSBarry Smith J*/
3019fd82e9SBarry Smith typedef const char *AOType;
31b439297aSHong Zhang #define AOBASIC          "basic"
32b439297aSHong Zhang #define AOADVANCED       "advanced"
33b439297aSHong Zhang #define AOMAPPING        "mapping"
340392740eSHong Zhang #define AOMEMORYSCALABLE "memoryscalable"
35b439297aSHong Zhang 
368ba1e511SMatthew Knepley /* Logging support */
37014dd563SJed Brown PETSC_EXTERN PetscClassId AO_CLASSID;
388ba1e511SMatthew Knepley 
39607a6623SBarry Smith PETSC_EXTERN PetscErrorCode AOInitializePackage(void);
404bf303faSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode AOFinalizePackage(void);
418ba1e511SMatthew Knepley 
42014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreate(MPI_Comm, AO *);
43014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOSetIS(AO, IS, IS);
44014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOSetFromOptions(AO);
45b439297aSHong Zhang 
46014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateBasic(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
47014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateBasicIS(IS, IS, AO *);
48014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMemoryScalable(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
49014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMemoryScalableIS(IS, IS, AO *);
50014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMapping(MPI_Comm, PetscInt, const PetscInt[], const PetscInt[], AO *);
51014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOCreateMappingIS(IS, IS, AO *);
524ebda54eSMatthew Knepley 
53014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOView(AO, PetscViewer);
54fe2efc57SMark PETSC_EXTERN PetscErrorCode AOViewFromOptions(AO, PetscObject, const char[]);
55014dd563SJed Brown PETSC_EXTERN PetscErrorCode AODestroy(AO *);
56b439297aSHong Zhang 
57b439297aSHong Zhang /* Dynamic creation and loading functions */
5819fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode AOSetType(AO, AOType);
5919fd82e9SBarry Smith PETSC_EXTERN PetscErrorCode AOGetType(AO, AOType *);
604ebda54eSMatthew Knepley 
61bdf89e91SBarry Smith PETSC_EXTERN PetscErrorCode AORegister(const char[], PetscErrorCode (*)(AO));
62da8c939bSJacob Faibussowitsch PETSC_EXTERN PetscErrorCode AORegisterAll(void);
63b439297aSHong Zhang 
64014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplication(AO, PetscInt, PetscInt[]);
65014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetsc(AO, PetscInt, PetscInt[]);
66014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplicationIS(AO, IS);
67014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetscIS(AO, IS);
687588ac45SBarry Smith 
69014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]);
70014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]);
71014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]);
72014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]);
734ebda54eSMatthew Knepley 
74014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOMappingHasApplicationIndex(AO, PetscInt, PetscBool *);
75014dd563SJed Brown PETSC_EXTERN PetscErrorCode AOMappingHasPetscIndex(AO, PetscInt, PetscBool *);
76