/[escript]/trunk/dudley/src/NodeFile.cpp
ViewVC logotype

Contents of /trunk/dudley/src/NodeFile.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4348 - (show annotations)
Tue Apr 2 07:15:43 2013 UTC (6 years ago) by caltinay
File size: 6533 byte(s)
Reapply some of the spelling fixes that got lost....

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16 /************************************************************************************/
17 /* */
18 /* Dudley: Mesh : NodeFile */
19 /* */
20 /* allocates and frees node files */
21 /* */
22 /************************************************************************************/
23
24 #include "NodeFile.h"
25
26 /************************************************************************************/
27
28 /* allocates a node file to hold nodes */
29 /* use Dudley_NodeFile_allocTable to allocate the node table (Id,Coordinates). */
30
31 Dudley_NodeFile *Dudley_NodeFile_alloc(dim_t numDim, Esys_MPIInfo * MPIInfo)
32 {
33 Dudley_NodeFile *out;
34
35 /* allocate the return value */
36
37 out = new Dudley_NodeFile;
38 if (Dudley_checkPtr(out))
39 return NULL;
40 out->numNodes = 0;
41 out->numDim = numDim;
42 out->numTagsInUse = 0;
43 out->Id = NULL;
44 out->globalDegreesOfFreedom = NULL;
45 out->Tag = NULL;
46 out->Coordinates = NULL;
47 out->status = DUDLEY_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->degreesOfFreedomConnector = NULL;
65 out->reducedDegreesOfFreedomConnector = NULL;
66 out->tagsInUse = NULL;
67
68 out->MPIInfo = Esys_MPIInfo_getReference(MPIInfo);
69 return out;
70 }
71
72 /* frees a node file: */
73
74 void Dudley_NodeFile_free(Dudley_NodeFile * in)
75 {
76 if (in != NULL)
77 {
78 Dudley_NodeFile_freeTable(in);
79 Esys_MPIInfo_free(in->MPIInfo);
80 delete in;
81 }
82 }
83
84 index_t Dudley_NodeFile_getFirstReducedNode(Dudley_NodeFile * in)
85 {
86 if (in != NULL)
87 {
88 return Paso_Distribution_getFirstComponent(in->reducedNodesDistribution);
89 }
90 else
91 {
92 return 0;
93 }
94 }
95
96 index_t Dudley_NodeFile_getLastReducedNode(Dudley_NodeFile * in)
97 {
98 if (in != NULL)
99 {
100 return Paso_Distribution_getLastComponent(in->reducedNodesDistribution);
101 }
102 else
103 {
104 return 0;
105 }
106
107 }
108
109 dim_t Dudley_NodeFile_getGlobalNumReducedNodes(Dudley_NodeFile * in)
110 {
111 if (in != NULL)
112 {
113 return Paso_Distribution_getGlobalNumComponents(in->reducedNodesDistribution);
114 }
115 else
116 {
117 return 0;
118 }
119
120 }
121
122 index_t *Dudley_NodeFile_borrowGlobalReducedNodesIndex(Dudley_NodeFile * in)
123 {
124 if (in != NULL)
125 {
126 return in->globalReducedNodesIndex;
127 }
128 else
129 {
130 return NULL;
131 }
132 }
133
134 index_t Dudley_NodeFile_getFirstNode(Dudley_NodeFile * in)
135 {
136 if (in != NULL)
137 {
138 return Paso_Distribution_getFirstComponent(in->nodesDistribution);
139 }
140 else
141 {
142 return 0;
143 }
144 }
145
146 index_t Dudley_NodeFile_getLastNode(Dudley_NodeFile * in)
147 {
148 if (in != NULL)
149 {
150 return Paso_Distribution_getLastComponent(in->nodesDistribution);
151 }
152 else
153 {
154 return 0;
155 }
156
157 }
158
159 dim_t Dudley_NodeFile_getGlobalNumNodes(Dudley_NodeFile * in)
160 {
161 if (in != NULL)
162 {
163 return Paso_Distribution_getGlobalNumComponents(in->nodesDistribution);
164 }
165 else
166 {
167 return 0;
168 }
169
170 }
171
172 index_t *Dudley_NodeFile_borrowGlobalNodesIndex(Dudley_NodeFile * in)
173 {
174 if (in != NULL)
175 {
176 return in->globalNodesIndex;
177 }
178 else
179 {
180 return NULL;
181 }
182 }
183
184 dim_t Dudley_NodeFile_getNumReducedNodes(Dudley_NodeFile * in)
185 {
186 if (in != NULL)
187 {
188 return in->reducedNodesMapping->numTargets;
189 }
190 else
191 {
192 return 0;
193 }
194
195 }
196
197 dim_t Dudley_NodeFile_getNumDegreesOfFreedom(Dudley_NodeFile * in)
198 {
199 if (in != NULL)
200 {
201 return Paso_Distribution_getMyNumComponents(in->degreesOfFreedomDistribution);
202 }
203 else
204 {
205 return 0;
206 }
207 }
208
209 dim_t Dudley_NodeFile_getNumNodes(Dudley_NodeFile * in)
210 {
211 if (in != NULL)
212 {
213 return in->nodesMapping->numNodes;
214 }
215 else
216 {
217 return 0;
218 }
219 }
220
221 dim_t Dudley_NodeFile_getNumReducedDegreesOfFreedom(Dudley_NodeFile * in)
222 {
223 if (in != NULL)
224 {
225 return Paso_Distribution_getMyNumComponents(in->reducedDegreesOfFreedomDistribution);
226 }
227 else
228 {
229 return 0;
230 }
231 }
232
233 index_t *Dudley_NodeFile_borrowTargetReducedNodes(Dudley_NodeFile * in)
234 {
235 if (in != NULL)
236 {
237 return in->reducedNodesMapping->target;
238 }
239 else
240 {
241 return NULL;
242 }
243 }
244
245 index_t *Dudley_NodeFile_borrowTargetDegreesOfFreedom(Dudley_NodeFile * in)
246 {
247 if (in != NULL)
248 {
249 return in->degreesOfFreedomMapping->target;
250 }
251 else
252 {
253 return NULL;
254 }
255 }
256
257 index_t *Dudley_NodeFile_borrowTargetNodes(Dudley_NodeFile * in)
258 {
259 if (in != NULL)
260 {
261 return in->nodesMapping->target;
262 }
263 else
264 {
265 return NULL;
266 }
267 }
268
269 index_t *Dudley_NodeFile_borrowTargetReducedDegreesOfFreedom(Dudley_NodeFile * in)
270 {
271 if (in != NULL)
272 {
273 return in->reducedDegreesOfFreedomMapping->target;
274 }
275 else
276 {
277 return NULL;
278 }
279 }
280
281 index_t *Dudley_NodeFile_borrowReducedNodesTarget(Dudley_NodeFile * in)
282 {
283 if (in != NULL)
284 {
285 return in->reducedNodesMapping->map;
286 }
287 else
288 {
289 return NULL;
290 }
291 }
292
293 index_t *Dudley_NodeFile_borrowDegreesOfFreedomTarget(Dudley_NodeFile * in)
294 {
295 if (in != NULL)
296 {
297 return in->degreesOfFreedomMapping->map;
298 }
299 else
300 {
301 return NULL;
302 }
303 }
304
305 index_t *Dudley_NodeFile_borrowNodesTarget(Dudley_NodeFile * in)
306 {
307 if (in != NULL)
308 {
309 return in->nodesMapping->map;
310 }
311 else
312 {
313 return NULL;
314 }
315 }
316
317 index_t *Dudley_NodeFile_borrowReducedDegreesOfFreedomTarget(Dudley_NodeFile * in)
318 {
319 if (in != NULL)
320 {
321 return in->reducedDegreesOfFreedomMapping->map;
322 }
323 else
324 {
325 return NULL;
326 }
327 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision
svn:mergeinfo /branches/lapack2681/finley/src/NodeFile.cpp:2682-2741 /branches/pasowrap/dudley/src/NodeFile.cpp:3661-3674 /branches/py3_attempt2/dudley/src/NodeFile.cpp:3871-3891 /branches/restext/finley/src/NodeFile.cpp:2610-2624 /branches/ripleygmg_from_3668/dudley/src/NodeFile.cpp:3669-3791 /branches/stage3.0/finley/src/NodeFile.cpp:2569-2590 /branches/symbolic_from_3470/dudley/src/NodeFile.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/NodeFile.cpp:3517-3974 /release/3.0/finley/src/NodeFile.cpp:2591-2601 /trunk/dudley/src/NodeFile.cpp:4257-4344 /trunk/ripley/test/python/dudley/src/NodeFile.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26