Actual source code: petscao.h

      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: */
     8:  #include petscis.h
     9:  #include petscmat.h

     12: typedef enum {AO_BASIC=0, AO_ADVANCED, AO_MAPPING, AO_NEW} AOType;

     14: /*S
     15:      AO - Abstract PETSc object that manages mapping between different global numbering

     17:    Level: intermediate

     19:   Concepts: global numbering

     21: .seealso:  AOCreateBasic(), AOCreateBasicIS(), AOPetscToApplication(), AOView()
     22: S*/
     23: typedef struct _p_AO* AO;

     25: /* Logging support */

     29: EXTERN PetscErrorCode PETSCDM_DLLEXPORT DMInitializePackage(const char[]);

     31: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateBasic(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
     32: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateBasicIS(IS,IS,AO*);

     34: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateMapping(MPI_Comm,PetscInt,const PetscInt[],const PetscInt[],AO*);
     35: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOCreateMappingIS(IS,IS,AO*);

     37: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOView(AO,PetscViewer);
     38: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODestroy(AO);

     40: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AORegister_Private(const char [], const char [], const char [], PetscErrorCode (*)(AO));
     41: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
     42: #define AORegister(a,b,c,d) AORegister_Private(a,b,c,0)
     43: #else
     44: #define AORegister(a,b,c,d) AORegister_Private(a,b,c,d)
     45: #endif

     47: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplication(AO,PetscInt,PetscInt[]);
     48: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetsc(AO,PetscInt,PetscInt[]);
     49: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplicationIS(AO,IS);
     50: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetscIS(AO,IS);

     52: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplicationPermuteInt(AO, PetscInt, PetscInt[]);
     53: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetscPermuteInt(AO, PetscInt, PetscInt[]);
     54: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOPetscToApplicationPermuteReal(AO, PetscInt, PetscReal[]);
     55: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOApplicationToPetscPermuteReal(AO, PetscInt, PetscReal[]);

     57: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOMappingHasApplicationIndex(AO, PetscInt, PetscTruth *);
     58: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOMappingHasPetscIndex(AO, PetscInt, PetscTruth *);

     60: /* ----------------------------------------------------*/

     62: typedef enum {AODATA_BASIC=0,AODATA_ADVANCED=1} AODataType;

     64: /*S
     65:      AOData - Abstract PETSc object that manages complex parallel data structures intended to
     66:          hold grid information, etc

     68:    Level: advanced

     70: .seealso:  AODataCreateBasic()
     71: S*/
     72: typedef struct _p_AOData* AOData;

     74: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataCreateBasic(MPI_Comm,AOData *);
     75: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataView(AOData,PetscViewer);
     76: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataDestroy(AOData);
     77: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataLoadBasic(PetscViewer,AOData *);
     78: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataGetInfo(AOData,PetscInt*,char ***);

     80: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyAdd(AOData,const char[],PetscInt,PetscInt);
     81: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyRemove(AOData,const char[]);

     83: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeySetLocalToGlobalMapping(AOData,const char[],ISLocalToGlobalMapping);
     84: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetLocalToGlobalMapping(AOData,const char[],ISLocalToGlobalMapping*);
     85: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyRemap(AOData,const char[],AO);

     87: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyExists(AOData,const char[],PetscTruth*);
     88: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetInfo(AOData,const char[],PetscInt *,PetscInt*,PetscInt*,char***);
     89: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetOwnershipRange(AOData,const char[],PetscInt *,PetscInt*);

     91: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetNeighbors(AOData,const char[],PetscInt,PetscInt*,IS *);
     92: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetNeighborsIS(AOData,const char[],IS,IS *);
     93: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetAdjacency(AOData,const char[],Mat*);

     95: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetActive(AOData,const char[],const char[],PetscInt,PetscInt *,PetscInt,IS*);
     96: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetActiveIS(AOData,const char[],const char[],IS,PetscInt,IS*);
     97: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetActiveLocal(AOData,const char[],const char[],PetscInt,PetscInt *,PetscInt,IS*);
     98: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyGetActiveLocalIS(AOData,const char[],const char[],IS,PetscInt,IS*);

    100: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataKeyPartition(AOData,const char[]);

    102: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentAdd(AOData,const char[],const char[],PetscInt,PetscInt,PetscInt *,void *,PetscDataType);
    103: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentRemove(AOData,const char[],const char[]);
    104: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentAddIS(AOData,const char[],const char[],PetscInt,IS,void *,PetscDataType);

    106: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentExists(AOData,const char[],const char[],PetscTruth*);
    107: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetInfo(AOData,const char[],const char[],PetscInt *,PetscDataType*);

    109: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGet(AOData,const char[],const char[],PetscInt,PetscInt*,void **);
    110: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentRestore(AOData,const char[],const char[],PetscInt,PetscInt*,void **);
    111: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetIS(AOData,const char[],const char[],IS,void **);
    112: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentRestoreIS(AOData,const char[],const char[],IS,void **);

    114: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetLocal(AOData,const char[],const char[],PetscInt,PetscInt*,void **);
    115: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentRestoreLocal(AOData,const char[],const char[],PetscInt,PetscInt*,void **);
    116: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetLocalIS(AOData,const char[],const char[],IS,void **);
    117: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentRestoreLocalIS(AOData,const char[],const char[],IS,void **);

    119: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetReduced(AOData,const char[],const char[],PetscInt,PetscInt*,IS *);
    120: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetReducedIS(AOData,const char[],const char[],IS,IS *);
    121: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentGetExtrema(AOData,const char[],const char[],void *,void *);

    123: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataSegmentPartition(AOData,const char[],const char[]);

    125: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataPartitionAndSetupLocal(AOData,const char[],const char[],IS*,IS*,ISLocalToGlobalMapping*);
    126: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AODataAliasAdd(AOData,const char[],const char[]);

    128:
    129: typedef struct _p_AOData2dGrid *AOData2dGrid;
    130: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridAddNode(AOData2dGrid, PetscReal, PetscReal, PetscInt *);
    131: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridInput(AOData2dGrid,PetscDraw);
    132: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridFlipCells(AOData2dGrid);
    133: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridComputeNeighbors(AOData2dGrid);
    134: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridComputeVertexBoundary(AOData2dGrid);
    135: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridDraw(AOData2dGrid,PetscDraw);
    136: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridDestroy(AOData2dGrid);
    137: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridCreate(AOData2dGrid*);
    138: EXTERN PetscErrorCode PETSCDM_DLLEXPORT AOData2dGridToAOData(AOData2dGrid,AOData*);

    141: #endif