xref: /petsc/include/petscao.h (revision 7b6bb2c608b6fc6714ef38fda02c2dbb91c82665)
1 /*
2   An application ordering is mapping between an application-centric
3   ordering (the ordering that is "natural" for the application) and
4   the parallel ordering that PETSc uses.
5 */
6 #if !defined(__PETSCAO_H)
7 #define __PETSCAO_H
8 #include "petscis.h"
9 #include "petscmat.h"
10 PETSC_EXTERN_CXX_BEGIN
11 
12 /*S
13      AO - Abstract PETSc object that manages mapping between different global numbering
14 
15    Level: intermediate
16 
17   Concepts: global numbering
18 
19 .seealso:  AOCreateBasic(), AOCreateBasicIS(), AOPetscToApplication(), AOView(), AOApplicationToPetsc()
20 S*/
21 typedef struct _p_AO* AO;
22 
23 /*E
24     AOType - String with the name of a PETSc application ordering or the creation function
25        with an optional dynamic library name.
26 
27    Level: beginner
28 
29 .seealso: AOSetType(), AO
30 E*/
31 #define AOType char*
32 #define AOBASIC               "basic"
33 #define AOADVANCED            "advanced"
34 #define AOMAPPING             "mapping"
35 #define AOMEMORYSCALABLE      "memoryscalable"
36 
37 /* Logging support */
38 extern PetscClassId  AO_CLASSID;
39 
40 extern PetscErrorCode  AOInitializePackage(const char[]);
41 
42 extern PetscErrorCode  AOCreate(MPI_Comm,AO*);
43 extern PetscErrorCode  AOSetIS(AO,IS,IS);
44 extern PetscErrorCode  AOSetFromOptions(AO);
45 
46 extern PetscErrorCode  AOCreateBasic(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
47 extern PetscErrorCode  AOCreateBasicIS(IS,IS,AO*);
48 extern PetscErrorCode  AOCreateMemoryScalable(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
49 extern PetscErrorCode  AOCreateMemoryScalableIS(IS,IS,AO*);
50 extern PetscErrorCode  AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
51 extern PetscErrorCode  AOCreateMappingIS(IS,IS,AO*);
52 
53 extern PetscErrorCode  AOView(AO,PetscViewer);
54 extern PetscErrorCode  AODestroy(AO*);
55 
56 /* Dynamic creation and loading functions */
57 extern PetscFList AOList;
58 extern PetscBool  AORegisterAllCalled;
59 extern PetscErrorCode  AOSetType(AO, const AOType);
60 extern PetscErrorCode  AOGetType(AO, const AOType *);
61 
62 extern PetscErrorCode  AORegister(const char [], const char [], const char [], PetscErrorCode (*)(AO));
63 extern PetscErrorCode  AORegisterAll(const char []);
64 extern PetscErrorCode  AORegisterDestroy(void);
65 
66 #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
67 #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,0)
68 #else
69 #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,d)
70 #endif
71 
72 extern PetscErrorCode  AOPetscToApplication(AO,PetscInt,PetscInt[]);
73 extern PetscErrorCode  AOApplicationToPetsc(AO,PetscInt,PetscInt[]);
74 extern PetscErrorCode  AOPetscToApplicationIS(AO,IS);
75 extern PetscErrorCode  AOApplicationToPetscIS(AO,IS);
76 
77 extern PetscErrorCode  AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]);
78 extern PetscErrorCode  AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]);
79 extern PetscErrorCode  AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]);
80 extern PetscErrorCode  AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]);
81 
82 extern PetscErrorCode  AOMappingHasApplicationIndex(AO, PetscInt, PetscBool  *);
83 extern PetscErrorCode  AOMappingHasPetscIndex(AO, PetscInt, PetscBool  *);
84 
85 /* ----------------------------------------------------*/
86 PETSC_EXTERN_CXX_END
87 #endif
88