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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (hide annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 1 month ago) by jfenwick
Original Path: trunk/finley/src/NodeFile.c
File MIME type: text/plain
File size: 5913 byte(s)
Updating copyright notices
1 jgs 150
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 ksteube 1312
14 ksteube 1811
15 jgs 82 /**************************************************************/
16     /* */
17     /* Finley: Mesh : NodeFile */
18     /* */
19 ksteube 1312 /* allocates and freeates node files */
20 jgs 82 /* */
21     /**************************************************************/
22    
23     #include "NodeFile.h"
24    
25     /**************************************************************/
26    
27     /* allocates a node file to hold nodes */
28     /* use Finley_NodeFile_allocTable to allocate the node table (Id,Coordinatess). */
29 ksteube 1312
30     Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Paso_MPIInfo *MPIInfo)
31     {
32 jgs 82 Finley_NodeFile *out;
33    
34     /* allocate the return value */
35    
36 jgs 102 out=MEMALLOC(1,Finley_NodeFile);
37 jgs 82 if (Finley_checkPtr(out)) return NULL;
38     out->numNodes=0;
39     out->numDim=numDim;
40 gross 1716 out->numTagsInUse=0;
41 jgs 82 out->Id=NULL;
42 ksteube 1312 out->globalDegreesOfFreedom=NULL;
43 jgs 82 out->Tag=NULL;
44     out->Coordinates=NULL;
45 gross 776 out->status=FINLEY_INITIAL_STATUS;
46 ksteube 1312
47     out->nodesMapping=NULL;
48     out->reducedNodesMapping=NULL;
49     out->degreesOfFreedomMapping=NULL;
50     out->reducedDegreesOfFreedomMapping=NULL;
51    
52     out->globalReducedDOFIndex=NULL;
53     out->globalReducedNodesIndex=NULL;
54     out->globalNodesIndex=NULL;
55     out->reducedNodesId=NULL;
56     out->degreesOfFreedomId=NULL;
57     out->reducedDegreesOfFreedomId=NULL;
58     out->nodesDistribution=NULL;
59     out->reducedNodesDistribution=NULL;
60     out->degreesOfFreedomDistribution=NULL;
61     out->reducedDegreesOfFreedomDistribution=NULL;
62 gross 1552 out->degreesOfFreedomConnector=NULL;
63     out->reducedDegreesOfFreedomConnector=NULL;
64 gross 1716 out->tagsInUse=NULL;
65 ksteube 1312
66 bcumming 730 out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
67 jgs 82 return out;
68     }
69    
70 ksteube 1312 /* frees a node file: */
71 jgs 82
72 ksteube 1312 void Finley_NodeFile_free(Finley_NodeFile* in) {
73 jgs 82 if (in!=NULL) {
74 ksteube 1312 Finley_NodeFile_freeTable(in);
75     Paso_MPIInfo_free( in->MPIInfo );
76 jgs 82 MEMFREE(in);
77     }
78     }
79 ksteube 1312
80     index_t Finley_NodeFile_getFirstReducedNode(Finley_NodeFile* in) {
81     if (in!=NULL) {
82     return Paso_Distribution_getFirstComponent(in->reducedNodesDistribution);
83     } else {
84     return 0;
85     }
86     }
87     index_t Finley_NodeFile_getLastReducedNode(Finley_NodeFile* in){
88     if (in!=NULL) {
89     return Paso_Distribution_getLastComponent(in->reducedNodesDistribution);
90     } else {
91     return 0;
92     }
93    
94     }
95    
96     dim_t Finley_NodeFile_getGlobalNumReducedNodes(Finley_NodeFile* in){
97     if (in!=NULL) {
98     return Paso_Distribution_getGlobalNumComponents(in->reducedNodesDistribution);
99     } else {
100     return 0;
101     }
102    
103     }
104     index_t* Finley_NodeFile_borrowGlobalReducedNodesIndex(Finley_NodeFile* in){
105     if (in!=NULL) {
106     return in->globalReducedNodesIndex;
107     } else {
108     return NULL;
109     }
110     }
111     index_t Finley_NodeFile_getFirstNode(Finley_NodeFile* in) {
112     if (in!=NULL) {
113     return Paso_Distribution_getFirstComponent(in->nodesDistribution);
114     } else {
115     return 0;
116     }
117     }
118     index_t Finley_NodeFile_getLastNode(Finley_NodeFile* in){
119     if (in!=NULL) {
120     return Paso_Distribution_getLastComponent(in->nodesDistribution);
121     } else {
122     return 0;
123     }
124    
125     }
126     dim_t Finley_NodeFile_getGlobalNumNodes(Finley_NodeFile* in){
127     if (in!=NULL) {
128     return Paso_Distribution_getGlobalNumComponents(in->nodesDistribution);
129     } else {
130     return 0;
131     }
132    
133     }
134     index_t* Finley_NodeFile_borrowGlobalNodesIndex(Finley_NodeFile* in){
135     if (in!=NULL) {
136     return in->globalNodesIndex;
137     } else {
138     return NULL;
139     }
140     }
141    
142     dim_t Finley_NodeFile_getNumReducedNodes(Finley_NodeFile* in) {
143     if (in!=NULL) {
144     return in->reducedNodesMapping->numTargets;
145     } else {
146     return 0;
147     }
148    
149     }
150     dim_t Finley_NodeFile_getNumDegreesOfFreedom(Finley_NodeFile* in) {
151     if (in!=NULL) {
152     return Paso_Distribution_getMyNumComponents(in->degreesOfFreedomDistribution);
153     } else {
154     return 0;
155     }
156     }
157     dim_t Finley_NodeFile_getNumNodes(Finley_NodeFile* in) {
158     if (in!=NULL) {
159     return in->nodesMapping->numNodes;
160     } else {
161     return 0;
162     }
163     }
164     dim_t Finley_NodeFile_getNumReducedDegreesOfFreedom(Finley_NodeFile* in) {
165     if (in!=NULL) {
166     return Paso_Distribution_getMyNumComponents(in->reducedDegreesOfFreedomDistribution);
167     } else {
168     return 0;
169     }
170     }
171    
172    
173     index_t* Finley_NodeFile_borrowTargetReducedNodes(Finley_NodeFile* in){
174     if (in!=NULL) {
175     return in->reducedNodesMapping->target;
176     } else {
177     return NULL;
178     }
179     }
180    
181     index_t* Finley_NodeFile_borrowTargetDegreesOfFreedom(Finley_NodeFile* in){
182     if (in!=NULL) {
183     return in->degreesOfFreedomMapping->target;
184     } else {
185     return NULL;
186     }
187     }
188    
189     index_t* Finley_NodeFile_borrowTargetNodes(Finley_NodeFile* in){
190     if (in!=NULL) {
191     return in->nodesMapping->target;
192     } else {
193     return NULL;
194     }
195     }
196    
197     index_t* Finley_NodeFile_borrowTargetReducedDegreesOfFreedom(Finley_NodeFile* in){
198     if (in!=NULL) {
199     return in->reducedDegreesOfFreedomMapping->target;
200     } else {
201     return NULL;
202     }
203     }
204    
205     index_t* Finley_NodeFile_borrowReducedNodesTarget(Finley_NodeFile* in){
206     if (in!=NULL) {
207     return in->reducedNodesMapping->map;
208     } else {
209     return NULL;
210     }
211     }
212    
213     index_t* Finley_NodeFile_borrowDegreesOfFreedomTarget(Finley_NodeFile* in){
214     if (in!=NULL) {
215     return in->degreesOfFreedomMapping->map;
216     } else {
217     return NULL;
218     }
219     }
220    
221     index_t* Finley_NodeFile_borrowNodesTarget(Finley_NodeFile* in){
222     if (in!=NULL) {
223     return in->nodesMapping->map;
224     } else {
225     return NULL;
226     }
227     }
228    
229     index_t* Finley_NodeFile_borrowReducedDegreesOfFreedomTarget(Finley_NodeFile* in){
230     if (in!=NULL) {
231     return in->reducedDegreesOfFreedomMapping->map;
232     } else {
233     return NULL;
234     }
235     }
236    
237    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26