Actual source code: aoimpl.h
1: /* $Id: aoimpl.h,v 1.24 2001/01/15 21:48:40 bsmith Exp $ */
2: /*
3: This private file should not be included in users' code.
4: */
6: #ifndef __AOIMPL
8: #include petscao.h
10: /*
11: Defines the abstract AO operations
12: */
13: struct _AOOps {
14: int (*petsctoapplication)(AO,int,int*), /* map a set of integers to application order */
15: (*applicationtopetsc)(AO,int,int*);
16: int (*destroy)(AO);
17: int (*view)(AO,PetscViewer);
18: };
20: struct _p_AO {
21: PETSCHEADER(struct _AOOps)
22: void *data; /* implementation-specific data */
23: int N,n; /* global, local vector size */
24: };
26: /*
27: Defines the abstract AOData operations
28: */
29: struct _AODataOps {
30: int (*segmentadd)(AOData,char *,char *,int,int,int*,void*,PetscDataType);
31: int (*segmentget)(AOData,char *,char*,int,int*,void**);
32: int (*segmentrestore)(AOData,char *,char *,int,int*,void**);
33: int (*segmentgetlocal)(AOData,char *,char*,int,int*,void**);
34: int (*segmentrestorelocal)(AOData,char *,char *,int,int*,void**);
35: int (*segmentgetreduced)(AOData,char *,char*,int,int*,IS *);
36: int (*segmentgetextrema)(AOData,char *,char*,void *,void *);
37: int (*keyremap)(AOData,char *,AO);
38: int (*keygetadjacency)(AOData,char *,Mat*);
39: int (*keygetactive)(AOData,char*,char*,int,int*,int,IS*);
40: int (*keygetactivelocal)(AOData,char*,char*,int,int*,int,IS*);
41: int (*segmentpartition)(AOData,char*,char*);
42: int (*keyremove)(AOData,char*);
43: int (*segmentremove)(AOData,char*,char*);
44: int (*destroy)(AOData);
45: int (*view)(AOData,PetscViewer);
46: };
48: /*
49: A AODate object consists of
51: - key1
52: * name = name of first key
53: * N = number of key entries
54: * nlocal = number of local key entries
55: * nsegments = number of segments in first key
56: * ltog = local to global mapping
57: - segment1
58: * name = name of first segment in first key
59: * bs = blocksize of first segment in first key
60: * datatype = datatype of first segment in first key
62: - segment2
64: ....
66: - key2
68: ....
69: */
70: typedef struct __AODataSegment AODataSegment;
71: struct __AODataSegment {
72: void *data; /* implementation-specific data */
73: char *name;
74: int bs; /* block size of basic chunk */
75: PetscDataType datatype; /* type of data item, int, double etc */
76: AODataSegment *next;
77: };
79: typedef struct __AODataKey AODataKey;
80: struct __AODataKey {
81: void *data; /* implementation-specific data */
82: char *name;
83: int N; /* number of key entries */
84: int nsegments; /* number of segments in key */
85: AODataSegment *segments;
86: ISLocalToGlobalMapping ltog;
88: /* should the following be so public? */
90: int nlocal; /* number of key entries owned locally */
91: int *rowners; /* ownership range of each processor */
92: int rstart,rend; /* first and 1 + last owned locally */
93: AODataKey *next;
94: };
96: typedef struct __AODataAlias AODataAlias; /* allows a field or key to have several names */
97: struct __AODataAlias {
98: char *alias;
99: char *name;
100: AODataAlias *next;
101: };
103: struct _p_AOData {
104: PETSCHEADER(struct _AODataOps)
105: int nkeys; /* current number of keys */
106: AODataKey *keys;
107: void *data;
108: int datacomplete; /* indicates all AOData object is fully set */
109: AODataAlias *aliases;
110: };
112: EXTERN int AODataKeyFind_Private(AOData,char *,PetscTruth *,AODataKey **);
113: EXTERN int AODataSegmentFind_Private(AOData,char *,char *,PetscTruth *,AODataKey **,AODataSegment **);
116: #include petscbt.h
118: struct _p_AOData2dGrid {
119: int cell_n, vertex_n, edge_n;
120: int cell_max, vertex_max, edge_max;
121: int *cell_vertex,*cell_edge,*cell_cell;
122: double *vertex;
123: double xmin,xmax,ymin,ymax;
124: int *edge_vertex,*edge_cell;
125: PetscBT vertex_boundary;
126: };
129: #endif