/[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 1267 - (show annotations)
Tue Aug 21 22:01:21 2007 UTC (12 years, 9 months ago) by gross
File MIME type: text/plain
File size: 6208 byte(s)
check for preperation status removed. is not really needed.
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
68 out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
69 return out;
70 }
71
72 /* frees a node file: */
73
74 void Finley_NodeFile_free(Finley_NodeFile* in) {
75 if (in!=NULL) {
76 Finley_NodeFile_freeTable(in);
77 Paso_MPIInfo_free( in->MPIInfo );
78 MEMFREE(in);
79 }
80 }
81
82 index_t Finley_NodeFile_getFirstReducedNode(Finley_NodeFile* in) {
83 if (in!=NULL) {
84 return Paso_Distribution_getFirstComponent(in->reducedNodesDistribution);
85 } else {
86 return 0;
87 }
88 }
89 index_t Finley_NodeFile_getLastReducedNode(Finley_NodeFile* in){
90 if (in!=NULL) {
91 return Paso_Distribution_getLastComponent(in->reducedNodesDistribution);
92 } else {
93 return 0;
94 }
95
96 }
97
98 dim_t Finley_NodeFile_getGlobalNumReducedNodes(Finley_NodeFile* in){
99 if (in!=NULL) {
100 return Paso_Distribution_getGlobalNumComponents(in->reducedNodesDistribution);
101 } else {
102 return 0;
103 }
104
105 }
106 index_t* Finley_NodeFile_borrowGlobalReducedNodesIndex(Finley_NodeFile* in){
107 if (in!=NULL) {
108 return in->globalReducedNodesIndex;
109 } else {
110 return NULL;
111 }
112 }
113 index_t Finley_NodeFile_getFirstNode(Finley_NodeFile* in) {
114 if (in!=NULL) {
115 return Paso_Distribution_getFirstComponent(in->nodesDistribution);
116 } else {
117 return 0;
118 }
119 }
120 index_t Finley_NodeFile_getLastNode(Finley_NodeFile* in){
121 if (in!=NULL) {
122 return Paso_Distribution_getLastComponent(in->nodesDistribution);
123 } else {
124 return 0;
125 }
126
127 }
128 dim_t Finley_NodeFile_getGlobalNumNodes(Finley_NodeFile* in){
129 if (in!=NULL) {
130 return Paso_Distribution_getGlobalNumComponents(in->nodesDistribution);
131 } else {
132 return 0;
133 }
134
135 }
136 index_t* Finley_NodeFile_borrowGlobalNodesIndex(Finley_NodeFile* in){
137 if (in!=NULL) {
138 return in->globalNodesIndex;
139 } else {
140 return NULL;
141 }
142 }
143
144 dim_t Finley_NodeFile_getNumReducedNodes(Finley_NodeFile* in) {
145 if (in!=NULL) {
146 return in->reducedNodesMapping->numTargets;
147 } else {
148 return 0;
149 }
150
151 }
152 dim_t Finley_NodeFile_getNumDegreesOfFreedom(Finley_NodeFile* in) {
153 if (in!=NULL) {
154 return Paso_Distribution_getMyNumComponents(in->degreesOfFreedomDistribution);
155 } else {
156 return 0;
157 }
158 }
159 dim_t Finley_NodeFile_getNumNodes(Finley_NodeFile* in) {
160 if (in!=NULL) {
161 return in->nodesMapping->numNodes;
162 } else {
163 return 0;
164 }
165 }
166 dim_t Finley_NodeFile_getNumReducedDegreesOfFreedom(Finley_NodeFile* in) {
167 if (in!=NULL) {
168 return Paso_Distribution_getMyNumComponents(in->reducedDegreesOfFreedomDistribution);
169 } else {
170 return 0;
171 }
172 }
173
174
175 index_t* Finley_NodeFile_borrowTargetReducedNodes(Finley_NodeFile* in){
176 if (in!=NULL) {
177 return in->reducedNodesMapping->target;
178 } else {
179 return NULL;
180 }
181 }
182
183 index_t* Finley_NodeFile_borrowTargetDegreesOfFreedom(Finley_NodeFile* in){
184 if (in!=NULL) {
185 return in->degreesOfFreedomMapping->target;
186 } else {
187 return NULL;
188 }
189 }
190
191 index_t* Finley_NodeFile_borrowTargetNodes(Finley_NodeFile* in){
192 if (in!=NULL) {
193 return in->nodesMapping->target;
194 } else {
195 return NULL;
196 }
197 }
198
199 index_t* Finley_NodeFile_borrowTargetReducedDegreesOfFreedom(Finley_NodeFile* in){
200 if (in!=NULL) {
201 return in->reducedDegreesOfFreedomMapping->target;
202 } else {
203 return NULL;
204 }
205 }
206
207 index_t* Finley_NodeFile_borrowReducedNodesTarget(Finley_NodeFile* in){
208 if (in!=NULL) {
209 return in->reducedNodesMapping->map;
210 } else {
211 return NULL;
212 }
213 }
214
215 index_t* Finley_NodeFile_borrowDegreesOfFreedomTarget(Finley_NodeFile* in){
216 if (in!=NULL) {
217 return in->degreesOfFreedomMapping->map;
218 } else {
219 return NULL;
220 }
221 }
222
223 index_t* Finley_NodeFile_borrowNodesTarget(Finley_NodeFile* in){
224 if (in!=NULL) {
225 return in->nodesMapping->map;
226 } else {
227 return NULL;
228 }
229 }
230
231 index_t* Finley_NodeFile_borrowReducedDegreesOfFreedomTarget(Finley_NodeFile* in){
232 if (in!=NULL) {
233 return in->reducedDegreesOfFreedomMapping->map;
234 } else {
235 return NULL;
236 }
237 }
238
239

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26