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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1293 - (show annotations)
Fri Sep 7 01:10:05 2007 UTC (12 years, 8 months ago) by gross
File MIME type: text/plain
File size: 6148 byte(s)
Finally I managed to add a DOF relabeling algeorithm. It is very simple at this stage. It runs for MPI 
where it is looking at the part of the stiffness matrix with rows and columns (mainBlock) controlled by a processor. 
The local optimization is then distributed and used in the coupleBlock matrix. 



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 /**************************************************************/
14 /* */
15 /* Finley: Mesh : NodeFile */
16 /* */
17 /* allocates and freeates node files */
18 /* */
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "NodeFile.h"
27
28 /**************************************************************/
29
30 /* allocates a node file to hold nodes */
31 /* use Finley_NodeFile_allocTable to allocate the node table (Id,Coordinatess). */
32
33 Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Paso_MPIInfo *MPIInfo)
34 {
35 Finley_NodeFile *out;
36
37 /* allocate the return value */
38
39 out=MEMALLOC(1,Finley_NodeFile);
40 if (Finley_checkPtr(out)) return NULL;
41 out->numNodes=0;
42 out->numDim=numDim;
43 out->Id=NULL;
44 out->globalDegreesOfFreedom=NULL;
45 out->Tag=NULL;
46 out->Coordinates=NULL;
47 out->status=FINLEY_INITIAL_STATUS;
48
49 out->nodesMapping=NULL;
50 out->reducedNodesMapping=NULL;
51 out->degreesOfFreedomMapping=NULL;
52 out->reducedDegreesOfFreedomMapping=NULL;
53
54 out->globalReducedDOFIndex=NULL;
55 out->globalReducedNodesIndex=NULL;
56 out->globalNodesIndex=NULL;
57 out->reducedNodesId=NULL;
58 out->degreesOfFreedomId=NULL;
59 out->reducedDegreesOfFreedomId=NULL;
60 out->nodesDistribution=NULL;
61 out->reducedNodesDistribution=NULL;
62 out->degreesOfFreedomDistribution=NULL;
63 out->reducedDegreesOfFreedomDistribution=NULL;
64 out->degreesOfFreedomCoupler=NULL;
65 out->reducedDegreesOfFreedomCoupler=NULL;
66
67 out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
68 return out;
69 }
70
71 /* frees a node file: */
72
73 void Finley_NodeFile_free(Finley_NodeFile* in) {
74 if (in!=NULL) {
75 Finley_NodeFile_freeTable(in);
76 Paso_MPIInfo_free( in->MPIInfo );
77 MEMFREE(in);
78 }
79 }
80
81 index_t Finley_NodeFile_getFirstReducedNode(Finley_NodeFile* in) {
82 if (in!=NULL) {
83 return Paso_Distribution_getFirstComponent(in->reducedNodesDistribution);
84 } else {
85 return 0;
86 }
87 }
88 index_t Finley_NodeFile_getLastReducedNode(Finley_NodeFile* in){
89 if (in!=NULL) {
90 return Paso_Distribution_getLastComponent(in->reducedNodesDistribution);
91 } else {
92 return 0;
93 }
94
95 }
96
97 dim_t Finley_NodeFile_getGlobalNumReducedNodes(Finley_NodeFile* in){
98 if (in!=NULL) {
99 return Paso_Distribution_getGlobalNumComponents(in->reducedNodesDistribution);
100 } else {
101 return 0;
102 }
103
104 }
105 index_t* Finley_NodeFile_borrowGlobalReducedNodesIndex(Finley_NodeFile* in){
106 if (in!=NULL) {
107 return in->globalReducedNodesIndex;
108 } else {
109 return NULL;
110 }
111 }
112 index_t Finley_NodeFile_getFirstNode(Finley_NodeFile* in) {
113 if (in!=NULL) {
114 return Paso_Distribution_getFirstComponent(in->nodesDistribution);
115 } else {
116 return 0;
117 }
118 }
119 index_t Finley_NodeFile_getLastNode(Finley_NodeFile* in){
120 if (in!=NULL) {
121 return Paso_Distribution_getLastComponent(in->nodesDistribution);
122 } else {
123 return 0;
124 }
125
126 }
127 dim_t Finley_NodeFile_getGlobalNumNodes(Finley_NodeFile* in){
128 if (in!=NULL) {
129 return Paso_Distribution_getGlobalNumComponents(in->nodesDistribution);
130 } else {
131 return 0;
132 }
133
134 }
135 index_t* Finley_NodeFile_borrowGlobalNodesIndex(Finley_NodeFile* in){
136 if (in!=NULL) {
137 return in->globalNodesIndex;
138 } else {
139 return NULL;
140 }
141 }
142
143 dim_t Finley_NodeFile_getNumReducedNodes(Finley_NodeFile* in) {
144 if (in!=NULL) {
145 return in->reducedNodesMapping->numTargets;
146 } else {
147 return 0;
148 }
149
150 }
151 dim_t Finley_NodeFile_getNumDegreesOfFreedom(Finley_NodeFile* in) {
152 if (in!=NULL) {
153 return Paso_Distribution_getMyNumComponents(in->degreesOfFreedomDistribution);
154 } else {
155 return 0;
156 }
157 }
158 dim_t Finley_NodeFile_getNumNodes(Finley_NodeFile* in) {
159 if (in!=NULL) {
160 return in->nodesMapping->numNodes;
161 } else {
162 return 0;
163 }
164 }
165 dim_t Finley_NodeFile_getNumReducedDegreesOfFreedom(Finley_NodeFile* in) {
166 if (in!=NULL) {
167 return Paso_Distribution_getMyNumComponents(in->reducedDegreesOfFreedomDistribution);
168 } else {
169 return 0;
170 }
171 }
172
173
174 index_t* Finley_NodeFile_borrowTargetReducedNodes(Finley_NodeFile* in){
175 if (in!=NULL) {
176 return in->reducedNodesMapping->target;
177 } else {
178 return NULL;
179 }
180 }
181
182 index_t* Finley_NodeFile_borrowTargetDegreesOfFreedom(Finley_NodeFile* in){
183 if (in!=NULL) {
184 return in->degreesOfFreedomMapping->target;
185 } else {
186 return NULL;
187 }
188 }
189
190 index_t* Finley_NodeFile_borrowTargetNodes(Finley_NodeFile* in){
191 if (in!=NULL) {
192 return in->nodesMapping->target;
193 } else {
194 return NULL;
195 }
196 }
197
198 index_t* Finley_NodeFile_borrowTargetReducedDegreesOfFreedom(Finley_NodeFile* in){
199 if (in!=NULL) {
200 return in->reducedDegreesOfFreedomMapping->target;
201 } else {
202 return NULL;
203 }
204 }
205
206 index_t* Finley_NodeFile_borrowReducedNodesTarget(Finley_NodeFile* in){
207 if (in!=NULL) {
208 return in->reducedNodesMapping->map;
209 } else {
210 return NULL;
211 }
212 }
213
214 index_t* Finley_NodeFile_borrowDegreesOfFreedomTarget(Finley_NodeFile* in){
215 if (in!=NULL) {
216 return in->degreesOfFreedomMapping->map;
217 } else {
218 return NULL;
219 }
220 }
221
222 index_t* Finley_NodeFile_borrowNodesTarget(Finley_NodeFile* in){
223 if (in!=NULL) {
224 return in->nodesMapping->map;
225 } else {
226 return NULL;
227 }
228 }
229
230 index_t* Finley_NodeFile_borrowReducedDegreesOfFreedomTarget(Finley_NodeFile* in){
231 if (in!=NULL) {
232 return in->reducedDegreesOfFreedomMapping->map;
233 } else {
234 return NULL;
235 }
236 }
237
238

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26