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

Contents of /trunk/finley/src/NodeFile.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1716 - (show annotations)
Thu Aug 21 05:03:49 2008 UTC (11 years ago) by gross
File MIME type: text/plain
File size: 5948 byte(s)
getListOfTags method added to FunctionSpace class
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17 /* */
18 /* Finley: Mesh : NodeFile */
19 /* */
20 /* allocates and freeates node files */
21 /* */
22 /**************************************************************/
23
24 #include "NodeFile.h"
25
26 /**************************************************************/
27
28 /* allocates a node file to hold nodes */
29 /* use Finley_NodeFile_allocTable to allocate the node table (Id,Coordinatess). */
30
31 Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Paso_MPIInfo *MPIInfo)
32 {
33 Finley_NodeFile *out;
34
35 /* allocate the return value */
36
37 out=MEMALLOC(1,Finley_NodeFile);
38 if (Finley_checkPtr(out)) return NULL;
39 out->numNodes=0;
40 out->numDim=numDim;
41 out->numTagsInUse=0;
42 out->Id=NULL;
43 out->globalDegreesOfFreedom=NULL;
44 out->Tag=NULL;
45 out->Coordinates=NULL;
46 out->status=FINLEY_INITIAL_STATUS;
47
48 out->nodesMapping=NULL;
49 out->reducedNodesMapping=NULL;
50 out->degreesOfFreedomMapping=NULL;
51 out->reducedDegreesOfFreedomMapping=NULL;
52
53 out->globalReducedDOFIndex=NULL;
54 out->globalReducedNodesIndex=NULL;
55 out->globalNodesIndex=NULL;
56 out->reducedNodesId=NULL;
57 out->degreesOfFreedomId=NULL;
58 out->reducedDegreesOfFreedomId=NULL;
59 out->nodesDistribution=NULL;
60 out->reducedNodesDistribution=NULL;
61 out->degreesOfFreedomDistribution=NULL;
62 out->reducedDegreesOfFreedomDistribution=NULL;
63 out->degreesOfFreedomConnector=NULL;
64 out->reducedDegreesOfFreedomConnector=NULL;
65 out->tagsInUse=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