/[escript]/trunk-mpi-branch/finley/src/DOFMap.h
ViewVC logotype

Contents of /trunk-mpi-branch/finley/src/DOFMap.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (show annotations)
Fri Aug 3 02:40:39 2007 UTC (12 years, 10 months ago) by gross
File MIME type: text/plain
File size: 3109 byte(s)
first attemt towards an improved MPI version.  

1 /*
2 ************************************************************
3 * Copyright 2007 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12 /* */
13 /* DOFMap provides a mapping from the local FEM nodes onto the local as well as global, distributed degrees of freedom */
14 /* */
15
16 /* Version: $Id$ */
17
18 #ifndef INC_FINLEY_DOFMAP
19 #define INC_FINLEY_DOFMAP
20
21 #include "paso/Paso_MPI.h"
22 #include "paso/Distribution.h"
23
24
25 struct Finley_DOFMap {
26 Paso_MPIInfo *MPIInfo;
27 Paso_Distribution* distribution; /* describes the global distribution of the DOFs */
28 dim_t numNodes; /* number of FEM nodes */
29 index_t* ID; /* ID[i] is the local DOF assigned to FEM node i in 0,....,numNodes-1 */
30 dim_t myNumDOFs; /* number of DOFs controled by this process */
31 dim_t numDOFs; /* number pf DOFs used by this process: numDOFs-myNumDOFs=number of nodes controled by other processes */
32 dim_t numRemotes; /* number of DOFs controled by other processes = numDOFs-myNumDOFs */
33 index_t* remoteID; /* remoteID[i] is the id of DOF i on the processor controling it (i=0,...,numRemotes-1) */
34 Paso_MPI_rank* remoteProcessor; /* remoteProcessor[i] is the processor contoling DOF i (i=0,...,numRemotes-1) */
35 index_t* offsetInRemoteID; /* offsetInRemoteID[i] points to the first input value in remoteDOFID
36 used by processor neighbours[i]. Has length numNeighbours+1 */
37 dim_t numNeighbours; /* number of processor controling DOFs used by this process */
38 Paso_MPI_rank* neighbours; /* array of processor controlling DOFs on this process */
39 dim_t reference_counter;
40 };
41 typedef struct Finley_DOFMap Finley_DOFMap;
42
43 /* some short cuts to maps */
44 #define Finley_DOFMap_mapNodeToLocalDOF(_in_,_i_) (_in_)->ID[(_i_)]
45 #define Finley_DOFMap_mapLocalDOFToGlobal(_in_,_i_) ( (_i_) < (_in_)->myNumDOFs \
46 ? (_i_)+(_in_)->distribution->myFirstComponent \
47 : (_in_)->remoteID[(_i_)-(_in_)->myNumDOFs]+(_in_)->distribution->first_component[(_in_)->remoteProcessor[(_i_)-(_in_)->myNumDOFs]])
48 #define Finley_DOFMap_mapNodeToToGlobalDOF(_in_,_i_) Finley_DOFMap_mapLocalDOFToGlobal(_in_,Finley_DOFMap_mapNodeToLocalDOF(_in_,_i_))
49
50
51 Finley_DOFMap* Finley_DOFMap_alloc(dim_t numNodes, index_t* globalID, Paso_Distribution* distribution);
52 void Finley_DOFMap_free(Finley_DOFMap*);
53 Finley_DOFMap* DOFMap_getReference(Finley_DOFMap *in );
54
55 #endif

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26