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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4327 - (show annotations)
Wed Mar 20 05:09:11 2013 UTC (6 years, 6 months ago) by jfenwick
Original Path: branches/doubleplusgood/finley/src/NodeFile.cpp
File size: 6119 byte(s)
some finley memory
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 /* */
19 /* Finley: Mesh : NodeFile */
20 /* */
21 /* allocates and frees node files */
22 /* */
23 /************************************************************************************/
24
25 #include "NodeFile.h"
26
27 /************************************************************************************/
28
29 /* allocates a node file to hold nodes */
30 /* use Finley_NodeFile_allocTable to allocate the node table (Id,Coordinates). */
31
32 Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Esys_MPIInfo *MPIInfo)
33 {
34 Finley_NodeFile *out;
35
36 /* allocate the return value */
37
38 out=new Finley_NodeFile;
39 if (Finley_checkPtr(out)) 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=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->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 Finley_NodeFile_free(Finley_NodeFile* in) {
75 if (in!=NULL) {
76 Finley_NodeFile_freeTable(in);
77 Esys_MPIInfo_free( in->MPIInfo );
78 delete 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