1230e2716SBarry Smith /* 230127c82SLois Curfman McInnes An application ordering is mapping between an application-centric 330127c82SLois Curfman McInnes ordering (the ordering that is "natural" for the application) and 47588ac45SBarry Smith the parallel ordering that PETSc uses. 57588ac45SBarry Smith */ 60a835dfdSSatish Balay #if !defined(__PETSCAO_H) 70a835dfdSSatish Balay #define __PETSCAO_H 80a835dfdSSatish Balay #include "petscis.h" 90a835dfdSSatish Balay #include "petscmat.h" 10e9fa29b7SSatish Balay PETSC_EXTERN_CXX_BEGIN 117588ac45SBarry Smith 1290c47b6eSBarry Smith typedef enum {AO_BASIC=0, AO_ADVANCED=1, AO_MAPPING=2} AOType; 137588ac45SBarry Smith 14b9617806SBarry Smith /*S 15b9617806SBarry Smith AO - Abstract PETSc object that manages mapping between different global numbering 16b9617806SBarry Smith 17b9617806SBarry Smith Level: intermediate 18b9617806SBarry Smith 19b9617806SBarry Smith Concepts: global numbering 20b9617806SBarry Smith 210e83c824SBarry Smith .seealso: AOCreateBasic(), AOCreateBasicIS(), AOPetscToApplication(), AOView(), AOApplicationToPetsc() 22b9617806SBarry Smith S*/ 231ac94ccfSSatish Balay typedef struct _p_AO* AO; 247588ac45SBarry Smith 258ba1e511SMatthew Knepley /* Logging support */ 26*7087cfbeSBarry Smith extern PetscClassId AO_CLASSID; 278ba1e511SMatthew Knepley 28*7087cfbeSBarry Smith extern PetscErrorCode AOInitializePackage(const char[]); 298ba1e511SMatthew Knepley 30*7087cfbeSBarry Smith extern PetscErrorCode AOCreateBasic(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*); 31*7087cfbeSBarry Smith extern PetscErrorCode AOCreateBasicIS(IS,IS,AO*); 327588ac45SBarry Smith 33*7087cfbeSBarry Smith extern PetscErrorCode AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*); 34*7087cfbeSBarry Smith extern PetscErrorCode AOCreateMappingIS(IS,IS,AO*); 354ebda54eSMatthew Knepley 36*7087cfbeSBarry Smith extern PetscErrorCode AOView(AO,PetscViewer); 37*7087cfbeSBarry Smith extern PetscErrorCode AODestroy(AO); 384ebda54eSMatthew Knepley 39*7087cfbeSBarry Smith extern PetscErrorCode AORegister(const char [], const char [], const char [], PetscErrorCode (*)(AO)); 404ebda54eSMatthew Knepley #if defined(PETSC_USE_DYNAMIC_LIBRARIES) 41985db425SBarry Smith #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,0) 424ebda54eSMatthew Knepley #else 43985db425SBarry Smith #define AORegisterDynamic(a,b,c,d) AORegister(a,b,c,d) 444ebda54eSMatthew Knepley #endif 454ebda54eSMatthew Knepley 46*7087cfbeSBarry Smith extern PetscErrorCode AOPetscToApplication(AO,PetscInt,PetscInt[]); 47*7087cfbeSBarry Smith extern PetscErrorCode AOApplicationToPetsc(AO,PetscInt,PetscInt[]); 48*7087cfbeSBarry Smith extern PetscErrorCode AOPetscToApplicationIS(AO,IS); 49*7087cfbeSBarry Smith extern PetscErrorCode AOApplicationToPetscIS(AO,IS); 507588ac45SBarry Smith 51*7087cfbeSBarry Smith extern PetscErrorCode AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]); 52*7087cfbeSBarry Smith extern PetscErrorCode AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]); 53*7087cfbeSBarry Smith extern PetscErrorCode AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]); 54*7087cfbeSBarry Smith extern PetscErrorCode AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]); 554ebda54eSMatthew Knepley 56*7087cfbeSBarry Smith extern PetscErrorCode AOMappingHasApplicationIndex(AO, PetscInt, PetscBool *); 57*7087cfbeSBarry Smith extern PetscErrorCode AOMappingHasPetscIndex(AO, PetscInt, PetscBool *); 587588ac45SBarry Smith 59376ee591SBarry Smith /* ----------------------------------------------------*/ 60e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END 617588ac45SBarry Smith #endif 62