xref: /petsc/include/petscao.h (revision 9dbfa63a83c25927f38b6bb7487c6ba5b1ae328b)
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 
21b9617806SBarry Smith .seealso:  AOCreateBasic(), AOCreateBasicIS(), AOPetscToApplication(), AOView()
22b9617806SBarry Smith S*/
231ac94ccfSSatish Balay typedef struct _p_AO* AO;
247588ac45SBarry Smith 
258ba1e511SMatthew Knepley /* Logging support */
26*9dbfa63aSSatish Balay extern PetscCookie PETSCDM_DLLEXPORT AO_COOKIE;
278ba1e511SMatthew Knepley 
282f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT DMInitializePackage(const char[]);
298ba1e511SMatthew Knepley 
302f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateBasic(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
312f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateBasicIS(IS,IS,AO*);
327588ac45SBarry Smith 
332f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
342f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateMappingIS(IS,IS,AO*);
354ebda54eSMatthew Knepley 
362f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOView(AO,PetscViewer);
372f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODestroy(AO);
384ebda54eSMatthew Knepley 
39985db425SBarry Smith EXTERN PetscErrorCode PETSCDM_DLLEXPORT 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 
462f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplication(AO,PetscInt,PetscInt[]);
472f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetsc(AO,PetscInt,PetscInt[]);
482f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplicationIS(AO,IS);
492f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetscIS(AO,IS);
507588ac45SBarry Smith 
512f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]);
522f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]);
532f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]);
542f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]);
554ebda54eSMatthew Knepley 
562f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOMappingHasApplicationIndex(AO, PetscInt, PetscTruth *);
572f2e5d10SKris Buschelman EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOMappingHasPetscIndex(AO, PetscInt, PetscTruth *);
587588ac45SBarry Smith 
59376ee591SBarry Smith /* ----------------------------------------------------*/
60e9fa29b7SSatish Balay PETSC_EXTERN_CXX_END
617588ac45SBarry Smith #endif
62