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 typedef enum {AO_BASIC=0, AO_ADVANCED=1, AO_MAPPING=2} AOType; 13 14 /*S 15 AO - Abstract PETSc object that manages mapping between different global numbering 16 17 Level: intermediate 18 19 Concepts: global numbering 20 21 .seealso: AOCreateBasic(), AOCreateBasicIS(), AOPetscToApplication(), AOView(), AOApplicationToPetsc() 22 S*/ 23 typedef struct _p_AO* AO; 24 25 /* Logging support */ 26 extern PetscClassId AO_CLASSID; 27 28 extern PetscErrorCode AOInitializePackage(const char[]); 29 30 extern PetscErrorCode AOCreateBasic(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*); 31 extern PetscErrorCode AOCreateBasicIS(IS,IS,AO*); 32 33 extern PetscErrorCode AOCreateBasicMemoryScalable(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*); 34 extern PetscErrorCode AOCreateBasicMemoryScalableIS(IS,IS,AO*); 35 36 extern PetscErrorCode AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*); 37 extern PetscErrorCode AOCreateMappingIS(IS,IS,AO*); 38 39 extern PetscErrorCode AOView(AO,PetscViewer); 40 extern PetscErrorCode AODestroy(AO); 41 42 extern PetscErrorCode AORegister(const char [], const char [], const char [], PetscErrorCode (*)(AO)); 43 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 44 #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,0) 45 #else 46 #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,d) 47 #endif 48 49 extern PetscErrorCode AOPetscToApplication(AO,PetscInt,PetscInt[]); 50 extern PetscErrorCode AOApplicationToPetsc(AO,PetscInt,PetscInt[]); 51 extern PetscErrorCode AOPetscToApplicationIS(AO,IS); 52 extern PetscErrorCode AOApplicationToPetscIS(AO,IS); 53 54 extern PetscErrorCode AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]); 55 extern PetscErrorCode AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]); 56 extern PetscErrorCode AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]); 57 extern PetscErrorCode AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]); 58 59 extern PetscErrorCode AOMappingHasApplicationIndex(AO, PetscInt, PetscBool *); 60 extern PetscErrorCode AOMappingHasPetscIndex(AO, PetscInt, PetscBool *); 61 62 /* ----------------------------------------------------*/ 63 PETSC_EXTERN_CXX_END 64 #endif 65