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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1230 - (show annotations)
Thu Aug 9 06:19:35 2007 UTC (12 years, 9 months ago) by gross
File MIME type: text/plain
File size: 7458 byte(s)
the mappings of nodes of local and global DOFs added but program still crashes.

1 /*
2 ************************************************************
3 * Copyright 2006 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 /* Version: $Id$ */
14
15 #ifndef INC_FINLEY_NODEFILE
16 #define INC_FINLEY_NODEFILE
17
18 #define MAX_numDim 3
19
20 #include "Finley.h"
21 #include "NodeMapping.h"
22 #include "escript/DataC.h"
23 #include "paso/Distribution.h"
24 #include "paso/Coupler.h"
25
26 struct Finley_NodeFile {
27 Paso_MPIInfo *MPIInfo; /* MPI information */
28
29 index_t isPrepared; /* UNKNOWN, UNPREPARED, PREPAED to indicate that the Nodes are ready for calculation */
30 dim_t numNodes; /* number of nodes */
31 dim_t numDim; /* spatial dimension */
32 index_t *Id; /* Id[i] is the id number of node i. It need to be unique. */
33 index_t *Tag; /* Tag[i] is the tag of node i. */
34
35 index_t* globalDegreesOfFreedom; /* globalDegreesOfFreedom[i] is the global degree of freedom assigned to node i */
36 /* this index is used to consider periodic boundary conditions by assigning */
37 /* the same degreesOfFreedom to the same node */
38 double *Coordinates; /* Coordinates[INDEX2(k,i,numDim)] is the k-th coordinate of the */
39 /* node i. */
40 index_t *globalReducedDOFIndex; /* assigns each local node a global unique Id in a dens labeling of reduced DOF*/
41 /* value <0 indicates that the DOF is not used */
42 index_t *globalReducedNodesIndex; /* assigns each local node a global unique Id in a dens labeling */
43 /* value <0 indicates that the DOF is not used */
44 index_t *globalNodesIndex; /* assigns each local reduced node a global unique Id in a dens labeling */
45
46
47 Finley_NodeMapping *nodesMapping;
48 Finley_NodeMapping *reducedNodesMapping;
49 Finley_NodeMapping *degreesOfFreedomMapping;
50 Finley_NodeMapping *reducedDegreesOfFreedomMapping;
51
52 Paso_Distribution *nodesDistribution;
53 Paso_Distribution *reducedNodesDistribution;
54 Paso_Distribution *degreesOfFreedomDistribution;
55 Paso_Distribution *reducedDegreesOfFreedomDistribution;
56
57 Paso_Coupler* degreesOfFreedomCoupler;
58 Paso_Coupler *reducedDegreesOfFreedomCoupler;
59
60 /* these a the packed versions of Id */
61 index_t *reducedNodesId;
62 index_t *degreesOfFreedomId;
63 index_t *reducedDegreesOfFreedomId;
64
65
66 int status; /* the status counts the updates done on the node coordinates */
67 /* the value of status is increased by when the node coordinates are updated.*/
68
69
70 };
71
72 typedef struct Finley_NodeFile Finley_NodeFile;
73
74
75
76 Finley_NodeFile* Finley_NodeFile_alloc(dim_t, Paso_MPIInfo *MPIInfo);
77 index_t Finley_NodeFile_getFirstReducedNode(Finley_NodeFile* in);
78 index_t Finley_NodeFile_getLastReducedNode(Finley_NodeFile* in);
79 dim_t Finley_NodeFile_getGlobalNumReducedNodes(Finley_NodeFile* in);
80 index_t* Finley_NodeFile_borrowGlobalReducedNodesIndex(Finley_NodeFile* in);
81 index_t Finley_NodeFile_maxGlobalNodeIDIndex(Finley_NodeFile* in);
82 index_t Finley_NodeFile_maxGlobalReducedNodeIDIndex(Finley_NodeFile* in);
83 index_t Finley_NodeFile_GlobalDegreeOfFreedomIndex(Finley_NodeFile* in);
84 index_t Finley_NodeFile_GlobalReducedDegreeOfFreedomIndex(Finley_NodeFile* in);
85
86 index_t Finley_NodeFile_getFirstNode(Finley_NodeFile* in);
87 index_t Finley_NodeFile_getLastNode(Finley_NodeFile* in);
88 dim_t Finley_NodeFile_getGlobalNumNodes(Finley_NodeFile* in);
89 index_t* Finley_NodeFile_borrowGlobalNodesIndex(Finley_NodeFile* in);
90
91 /* returns the number of target */
92 dim_t Finley_NodeFile_getNumReducedNodes(Finley_NodeFile* in);
93 dim_t Finley_NodeFile_getNumDegreesOfFreedom(Finley_NodeFile* in);
94 dim_t Finley_NodeFile_getNumNodes(Finley_NodeFile* in);
95 dim_t Finley_NodeFile_getNumReducedDegreesOfFreedom(Finley_NodeFile* in);
96
97 /* returns the mapping from local nodes to a target */
98 index_t* Finley_NodeFile_borrowTargetReducedNodes(Finley_NodeFile* in);
99 index_t* Finley_NodeFile_borrowTargetDegreesOfFreedom(Finley_NodeFile* in);
100 index_t* Finley_NodeFile_borrowTargetNodes(Finley_NodeFile* in);
101 index_t* Finley_NodeFile_borrowTargetReducedDegreesOfFreedom(Finley_NodeFile* in);
102 /* returns the mapping from target to the local nodes */
103 index_t* Finley_NodeFile_borrowReducedNodesTarget(Finley_NodeFile* in);
104 index_t* Finley_NodeFile_borrowDegreesOfFreedomTarget(Finley_NodeFile* in);
105 index_t* Finley_NodeFile_borrowNodesTarget(Finley_NodeFile* in);
106 index_t* Finley_NodeFile_borrowReducedDegreesOfFreedomTarget(Finley_NodeFile* in);
107
108 void Finley_NodeFile_allocTable(Finley_NodeFile*,dim_t);
109 void Finley_NodeFile_free(Finley_NodeFile*);
110 void Finley_NodeFile_freeTable(Finley_NodeFile*);
111 void Finley_NodeFile_setIdGlobalRange(index_t*,index_t*,Finley_NodeFile*);
112 void Finley_NodeFile_setIdRange(index_t*,index_t*,Finley_NodeFile*);
113 void Finley_NodeFile_setDOFGlobalRange(index_t*,index_t*,Finley_NodeFile*);
114 void Finley_NodeFile_setDOFRange(index_t*,index_t*,Finley_NodeFile*);
115 void Finley_NodeFile_setReducedDOFRange(index_t*,index_t*,Finley_NodeFile*);
116 dim_t Finley_NodeFile_createDenseDOFLabeling(Finley_NodeFile*);
117 dim_t Finley_NodeFile_createDenseNodeLabeling(Finley_NodeFile* in);
118 dim_t Finley_NodeFile_createDenseReducedNodeLabeling(Finley_NodeFile* in, index_t* reducedNodeMask);
119 dim_t Finley_NodeFile_createDenseReducedDOFLabeling(Finley_NodeFile* in, index_t* reducedNodeMask);
120 void Finley_NodeFile_assignMPIRankToDOFs(Finley_NodeFile* in,Paso_MPI_rank* mpiRankOfDOF, index_t *distribution);
121 void Finley_NodeFile_gather(index_t*,Finley_NodeFile*,Finley_NodeFile*);
122 void Finley_NodeFile_gather_global(index_t*,Finley_NodeFile*,Finley_NodeFile*);
123 void Finley_NodeFile_gatherEntries(dim_t, index_t*, index_t, index_t, index_t*, index_t*, index_t*, index_t*, index_t*, index_t*, dim_t numDim, double*, double*);
124 void Finley_NodeFile_copyTable(dim_t,Finley_NodeFile*,dim_t,dim_t,Finley_NodeFile*);
125 void Finley_NodeFile_scatter(index_t*,Finley_NodeFile*,Finley_NodeFile*);
126 void Finley_NodeFile_scatterEntries(dim_t, index_t*, index_t, index_t, index_t*, index_t*, index_t*, index_t*, index_t*, index_t*, dim_t numDim, double*, double*);
127 void Finley_NodeFile_copyTable(dim_t,Finley_NodeFile*,dim_t,dim_t,Finley_NodeFile*);
128 void Finley_NodeFile_createMappings(Finley_NodeFile* in, dim_t numReducedNodes, index_t* indexReducedNodes, index_t* dof_first_component);
129
130 /* ===================== */
131 void Finley_NodeFile_setCoordinates(Finley_NodeFile*,escriptDataC*);
132 void Finley_NodeFile_setTags(Finley_NodeFile*,const int,escriptDataC*);
133
134 #endif
135

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26