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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26