/[escript]/trunk/finley/src/Distribution.h
ViewVC logotype

Contents of /trunk/finley/src/Distribution.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 731 - (show annotations)
Mon May 15 04:09:52 2006 UTC (15 years, 4 months ago) by bcumming
File MIME type: text/plain
File size: 5280 byte(s)


1 /* created by Ben Cumming on 26/04/2006 */
2
3 #ifndef INC_DISTRIBUTION
4 #define INC_DISTRIBUTION
5
6
7 #include "Finley.h"
8
9 #ifdef PASO_MPI
10
11 /* DATA TYPES */
12
13 /****************************************************
14 describes the set of nodes shared between two
15 neighbouring domains. Each of the domains has
16 a local copy that show where to map information
17 received from/sent to the other neighbour
18 ****************************************************/
19 struct Finley_NodeGhostEdge
20 {
21 dim_t reference_counter;
22 index_t numForward; /* number of local nodes referenced by neighbour */
23 index_t numBackward; /* number of neighbours nodes referenced by this process */
24 /* local indices of the forward and backward referenced nodes */
25 index_t *indexForward;
26 index_t *indexBackward;
27 };
28
29 typedef struct Finley_NodeGhostEdge Finley_NodeGhostEdge;
30
31 /****************************************************
32 describes the distribution of the nodes/DOF stored
33 on the local process, along with their connections
34 with nodes/DOF in neighbouring domains.
35 ****************************************************/
36 struct Finley_NodeDistribution
37 {
38 dim_t reference_counter;
39 Paso_MPIInfo *MPIInfo;
40 index_t numLocal; /* total number of nodes on local domain
41 numLocal = numBoundary + numInternal */
42 index_t numInternal; /* number of local nodes that are internal,
43 that is, not dependent on nodes in other domains*/
44 index_t numBoundary; /* number of local nodes that are dependant on nodes
45 in other domains */
46 index_t numExternal; /* number of nodes belonging to other subdomains that
47 share elements with local boundary nodes */
48 index_t *indexExternal; /* global indices of the external nodes stored on this Pid */
49 index_t *vtxdist; /* process i has nodes with global indices
50 vtxdist[i] to vtxdist[i]-1. */
51 index_t numGlobal; /* total number of nodes in the global domain */
52 index_t numNeighbours; /* number of neighbour domains */
53 index_t *neighbours; /* list of ranks of neighbours */
54 Finley_NodeGhostEdge **edges; /* ghost edges shared with each neighbour */
55 };
56
57 typedef struct Finley_NodeDistribution Finley_NodeDistribution;
58
59 /* not used at the moment, but could be used in the future for more efficient
60 calculation of integrals etc on boundary elements... */
61 struct Finley_ElementGhostEdge
62 {
63 dim_t reference_counter;
64 index_t numShared; /* number of elements shared with neighbour */
65 index_t *shared; /* local indices of the elements shared with the neighbour */
66 index_t *pointers; /* Yale-style description of dependancies on neighbour elements */
67 index_t *index;
68 };
69
70 typedef struct Finley_ElementGhostEdge Finley_ElementGhostEdge;
71
72 struct Finley_ElementDistribution
73 {
74 dim_t reference_counter;
75 Paso_MPIInfo *MPIInfo;
76 index_t numLocal; /* total number of elements on local domain
77 numLocal = numBoundary + numInternal */
78 index_t numInternal; /* number of local elements that are internal,
79 that is, not dependent on elements in other domains*/
80 index_t numBoundary; /* number of local elements that are dependant on elements
81 in other domains */
82 /* there will be further stuff here, as the need for it in domain decomposition arises */
83 /* ... */
84 };
85
86 typedef struct Finley_ElementDistribution Finley_ElementDistribution;
87
88 /***************************************
89 Function prototypes
90 ***************************************/
91
92 /* Finley_NodeDistribution */
93 Finley_NodeDistribution* Finley_NodeDistribution_alloc( Paso_MPIInfo *MPIInfo );
94 void Finley_NodeDistribution_dealloc( Finley_NodeDistribution *in );
95 Finley_NodeDistribution* Finley_NodeDistribution_getReference( Finley_NodeDistribution *in );
96 void Finley_NodeDistibution_allocTable( Finley_NodeDistribution *in, dim_t numLocal, dim_t numExternal, dim_t numNeighbours );
97 void Finley_NodeDistribution_deallocTable( Finley_NodeDistribution *in );
98 void Finley_NodeDistribution_addForward( Finley_NodeDistribution *in, index_t domain, dim_t numForward, index_t* indexLocal );
99 void Finley_NodeDistribution_addBackward( Finley_NodeDistribution *in, index_t domain, dim_t numBackward, index_t* indexLocal );
100
101 /* Finley_NodeGhostEdge */
102 Finley_NodeGhostEdge* Finley_NodeGhostEdge_alloc( void );
103 void Finley_NodeGhostEdge_dealloc( Finley_NodeGhostEdge *in );
104 Finley_NodeGhostEdge* Finley_NodeGhostEdge_getReference( Finley_NodeGhostEdge *in );
105 void Finley_NodeGhostEdge_allocTable( Finley_NodeGhostEdge *in, dim_t numForward, dim_t numBackward );
106 void Finley_NodeGhostEdge_deallocTable( Finley_NodeGhostEdge *in );
107
108 /* Finley_ElementDistribution */
109 Finley_ElementDistribution* Finley_ElementDistribution_alloc( Paso_MPIInfo *MPIInfo );
110 void Finley_ElementDistribution_dealloc( Finley_ElementDistribution* in );
111 Finley_ElementDistribution* Finley_ElementDistribution_getReference( Finley_ElementDistribution* in );
112
113 #endif
114 #endif

  ViewVC Help
Powered by ViewVC 1.1.26