/[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 1269 - (show annotations)
Wed Aug 22 08:55:03 2007 UTC (12 years, 9 months ago) by ksteube
File MIME type: text/plain
File size: 3129 byte(s)
Most of the tests pass now when compiled without -DPASO_MPI.
Resolved all compiler warnings except one.

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 "Finley.h"
22 #include "paso/Paso_MPI.h"
23 #include "paso/Distribution.h"
24
25
26 struct Finley_DOFMap {
27 Paso_MPIInfo *MPIInfo;
28 Paso_Distribution* distribution; /* describes the global distribution of the DOFs */
29 dim_t numNodes; /* number of FEM nodes */
30 index_t* ID; /* ID[i] is the local DOF assigned to FEM node i in 0,....,numNodes-1 */
31 dim_t myNumDOFs; /* number of DOFs controled by this process */
32 dim_t numDOFs; /* number pf DOFs used by this process: numDOFs-myNumDOFs=number of nodes controled by other processes */
33 dim_t numRemotes; /* number of DOFs controled by other processes = numDOFs-myNumDOFs */
34 index_t* remoteID; /* remoteID[i] is the id of DOF i on the processor controling it (i=0,...,numRemotes-1) */
35 Paso_MPI_rank* remoteProcessor; /* remoteProcessor[i] is the processor contoling DOF i (i=0,...,numRemotes-1) */
36 index_t* offsetInRemoteID; /* offsetInRemoteID[i] points to the first input value in remoteDOFID
37 used by processor neighbours[i]. Has length numNeighbours+1 */
38 dim_t numNeighbours; /* number of processor controling DOFs used by this process */
39 Paso_MPI_rank* neighbours; /* array of processor controlling DOFs on this process */
40 dim_t reference_counter;
41 };
42 typedef struct Finley_DOFMap Finley_DOFMap;
43
44 /* some short cuts to maps */
45 #define Finley_DOFMap_mapNodeToLocalDOF(_in_,_i_) (_in_)->ID[(_i_)]
46 #define Finley_DOFMap_mapLocalDOFToGlobal(_in_,_i_) ( (_i_) < (_in_)->myNumDOFs \
47 ? (_i_)+(_in_)->distribution->myFirstComponent \
48 : (_in_)->remoteID[(_i_)-(_in_)->myNumDOFs]+(_in_)->distribution->first_component[(_in_)->remoteProcessor[(_i_)-(_in_)->myNumDOFs]])
49 #define Finley_DOFMap_mapNodeToToGlobalDOF(_in_,_i_) Finley_DOFMap_mapLocalDOFToGlobal(_in_,Finley_DOFMap_mapNodeToLocalDOF(_in_,_i_))
50
51
52 Finley_DOFMap* Finley_DOFMap_alloc(dim_t numNodes, index_t* globalID, Paso_Distribution* distribution);
53 void Finley_DOFMap_free(Finley_DOFMap*);
54 Finley_DOFMap* DOFMap_getReference(Finley_DOFMap *in );
55
56 #endif

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26