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 AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*); 34 extern PetscErrorCode AOCreateMappingIS(IS,IS,AO*); 35 36 extern PetscErrorCode AOView(AO,PetscViewer); 37 extern PetscErrorCode AODestroy(AO); 38 39 extern PetscErrorCode AORegister(const char [], const char [], const char [], PetscErrorCode (*)(AO)); 40 #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 41 #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,0) 42 #else 43 #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,d) 44 #endif 45 46 extern PetscErrorCode AOPetscToApplication(AO,PetscInt,PetscInt[]); 47 extern PetscErrorCode AOApplicationToPetsc(AO,PetscInt,PetscInt[]); 48 extern PetscErrorCode AOPetscToApplicationIS(AO,IS); 49 extern PetscErrorCode AOApplicationToPetscIS(AO,IS); 50 51 extern PetscErrorCode AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]); 52 extern PetscErrorCode AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]); 53 extern PetscErrorCode AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]); 54 extern PetscErrorCode AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]); 55 56 extern PetscErrorCode AOMappingHasApplicationIndex(AO, PetscInt, PetscBool *); 57 extern PetscErrorCode AOMappingHasPetscIndex(AO, PetscInt, PetscBool *); 58 59 /* ----------------------------------------------------*/ 60 PETSC_EXTERN_CXX_END 61 #endif 62