Actual source code: petscao.h
1: /* $Id: petscao.h,v 1.27 2001/08/07 21:31:33 bsmith Exp $ */
3: /*
4: An application ordering is mapping between an application-centric
5: ordering (the ordering that is "natural" for the application) and
6: the parallel ordering that PETSc uses.
7: */
10: #include petscis.h
11: #include petscmat.h
13: typedef enum {AO_BASIC=0, AO_ADVANCED, AO_MAPPING, AO_NEW} AOType;
15: /*S
16: AO - Abstract PETSc object that manages mapping between different global numbering
18: Level: intermediate
20: Concepts: global numbering
22: .seealso: AOCreateBasic(), AOCreateBasicIS(), AOPetscToApplication(), AOView()
23: S*/
24: typedef struct _p_AO* AO;
26: #define AO_SER_BASIC_BINARY "basic_binary"
27: #define AO_SER_MAPPING_BINARY "mapping_binary"
28: typedef char *AOSerializeType;
30: /* Logging support */
31: extern int AO_COOKIE;
32: extern int AODATA_COOKIE;
33: enum {AO_PetscToApplication, AO_ApplicationToPetsc, AO_MAX_EVENTS};
34: extern int AOEvents[AO_MAX_EVENTS];
35: #define AOLogEventBegin(e,o1,o2,o3,o4) PetscLogEventBegin(AOEvents[e],o1,o2,o3,o4)
36: #define AOLogEventEnd(e,o1,o2,o3,o4) PetscLogEventEnd(AOEvents[e],o1,o2,o3,o4)
38: EXTERN int DMInitializePackage(char *);
40: EXTERN int AOCreateBasic(MPI_Comm,int,int*,int*,AO*);
41: EXTERN int AOCreateBasicIS(IS,IS,AO*);
43: EXTERN int AOCreateMapping(MPI_Comm,int,int*,int*,AO*);
44: EXTERN int AOCreateMappingIS(IS,IS,AO*);
46: EXTERN int AOView(AO,PetscViewer);
47: EXTERN int AODestroy(AO);
49: EXTERN PetscFList AOSerializeList;
50: EXTERN int AOSerializeRegisterAll(const char []);
51: EXTERN int AOSerializeRegisterDestroy(void);
52: EXTERN int AOSerializeRegisterAllCalled;
53: EXTERN int AOSerialize(MPI_Comm, AO *, PetscViewer, PetscTruth);
54: EXTERN int AOSetSerializeType(AO, AOSerializeType);
56: EXTERN int AORegister_Private(const char [], const char [], const char [], int (*)(AO));
57: EXTERN int AOSerializeRegister_Private(const char [], const char [], const char [], int (*)(MPI_Comm, AO *, PetscViewer, PetscTruth));
58: #if defined(PETSC_USE_DYNAMIC_LIBRARIES)
59: #define AORegister(a,b,c,d) AORegister_Private(a,b,c,0)
60: #define AOSerializeRegister(a,b,c,d) AOSerializeRegister_Private(a,b,c,0)
61: #else
62: #define AORegister(a,b,c,d) AORegister_Private(a,b,c,d)
63: #define AOSerializeRegister(a,b,c,d) AOSerializeRegister_Private(a,b,c,d)
64: #endif
66: EXTERN int AOPetscToApplication(AO,int,int*);
67: EXTERN int AOApplicationToPetsc(AO,int,int*);
68: EXTERN int AOPetscToApplicationIS(AO,IS);
69: EXTERN int AOApplicationToPetscIS(AO,IS);
71: EXTERN int AOPetscToApplicationPermuteInt(AO, int, int *);
72: EXTERN int AOApplicationToPetscPermuteInt(AO, int, int *);
73: EXTERN int AOPetscToApplicationPermuteReal(AO, int, double *);
74: EXTERN int AOApplicationToPetscPermuteReal(AO, int, double *);
76: EXTERN int AOMappingHasApplicationIndex(AO, int, PetscTruth *);
77: EXTERN int AOMappingHasPetscIndex(AO, int, PetscTruth *);
79: /* ----------------------------------------------------*/
81: typedef enum {AODATA_BASIC=0,AODATA_ADVANCED=1} AODataType;
83: /*S
84: AOData - Abstract PETSc object that manages complex parallel data structures intended to
85: hold grid information, etc
87: Level: advanced
89: .seealso: AODataCreateBasic()
90: S*/
91: typedef struct _p_AOData* AOData;
93: EXTERN int AODataCreateBasic(MPI_Comm,AOData *);
94: EXTERN int AODataView(AOData,PetscViewer);
95: EXTERN int AODataDestroy(AOData);
96: EXTERN int AODataLoadBasic(PetscViewer,AOData *);
97: EXTERN int AODataGetInfo(AOData,int*,char ***);
99: EXTERN int AODataKeyAdd(AOData,char*,int,int);
100: EXTERN int AODataKeyRemove(AOData,char*);
102: EXTERN int AODataKeySetLocalToGlobalMapping(AOData,char*,ISLocalToGlobalMapping);
103: EXTERN int AODataKeyGetLocalToGlobalMapping(AOData,char*,ISLocalToGlobalMapping*);
104: EXTERN int AODataKeyRemap(AOData,char *,AO);
106: EXTERN int AODataKeyExists(AOData,char*,PetscTruth*);
107: EXTERN int AODataKeyGetInfo(AOData,char *,int *,int*,int*,char***);
108: EXTERN int AODataKeyGetOwnershipRange(AOData,char *,int *,int*);
110: EXTERN int AODataKeyGetNeighbors(AOData,char *,int,int*,IS *);
111: EXTERN int AODataKeyGetNeighborsIS(AOData,char *,IS,IS *);
112: EXTERN int AODataKeyGetAdjacency(AOData,char *,Mat*);
114: EXTERN int AODataKeyGetActive(AOData,char*,char*,int,int *,int,IS*);
115: EXTERN int AODataKeyGetActiveIS(AOData,char*,char*,IS,int,IS*);
116: EXTERN int AODataKeyGetActiveLocal(AOData,char*,char*,int,int *,int,IS*);
117: EXTERN int AODataKeyGetActiveLocalIS(AOData,char*,char*,IS,int,IS*);
119: EXTERN int AODataKeyPartition(AOData,char *);
121: EXTERN int AODataSegmentAdd(AOData,char*,char *,int,int,int *,void *,PetscDataType);
122: EXTERN int AODataSegmentRemove(AOData,char *,char *);
123: EXTERN int AODataSegmentAddIS(AOData,char*,char *,int,IS,void *,PetscDataType);
125: EXTERN int AODataSegmentExists(AOData,char*,char*,PetscTruth*);
126: EXTERN int AODataSegmentGetInfo(AOData,char *,char *,int *,PetscDataType*);
128: EXTERN int AODataSegmentGet(AOData,char *,char *,int,int*,void **);
129: EXTERN int AODataSegmentRestore(AOData,char *,char *,int,int*,void **);
130: EXTERN int AODataSegmentGetIS(AOData,char *,char *,IS,void **);
131: EXTERN int AODataSegmentRestoreIS(AOData,char *,char *,IS,void **);
133: EXTERN int AODataSegmentGetLocal(AOData,char *,char *,int,int*,void **);
134: EXTERN int AODataSegmentRestoreLocal(AOData,char *,char *,int,int*,void **);
135: EXTERN int AODataSegmentGetLocalIS(AOData,char *,char *,IS,void **);
136: EXTERN int AODataSegmentRestoreLocalIS(AOData,char *,char *,IS,void **);
138: EXTERN int AODataSegmentGetReduced(AOData,char *,char *,int,int*,IS *);
139: EXTERN int AODataSegmentGetReducedIS(AOData,char *,char *,IS,IS *);
140: EXTERN int AODataSegmentGetExtrema(AOData,char*,char*,void *,void *);
142: EXTERN int AODataSegmentPartition(AOData,char *,char *);
144: EXTERN int AODataPartitionAndSetupLocal(AOData,char*,char*,IS*,IS*,ISLocalToGlobalMapping*);
145: EXTERN int AODataAliasAdd(AOData,char *,char *);
147:
148: typedef struct _p_AOData2dGrid *AOData2dGrid;
149: EXTERN int AOData2dGridAddNode(AOData2dGrid, PetscReal, PetscReal, int *);
150: EXTERN int AOData2dGridInput(AOData2dGrid,PetscDraw);
151: EXTERN int AOData2dGridFlipCells(AOData2dGrid);
152: EXTERN int AOData2dGridComputeNeighbors(AOData2dGrid);
153: EXTERN int AOData2dGridComputeVertexBoundary(AOData2dGrid);
154: EXTERN int AOData2dGridDraw(AOData2dGrid,PetscDraw);
155: EXTERN int AOData2dGridDestroy(AOData2dGrid);
156: EXTERN int AOData2dGridCreate(AOData2dGrid*);
157: EXTERN int AOData2dGridToAOData(AOData2dGrid,AOData*);
159: #endif