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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4257 - (hide annotations)
Wed Feb 27 03:42:40 2013 UTC (6 years, 6 months ago) by jfenwick
Original Path: branches/doubleplusgood/finley/src/NodeFile.c
File MIME type: text/plain
File size: 6129 byte(s)
Some simple experiments for c++ Finley

1 jgs 150
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 4154 * Copyright (c) 2003-2013 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
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 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 ksteube 1312
16 ksteube 1811
17 jfenwick 3981 /************************************************************************************/
18 caltinay 3639 /* */
19     /* Finley: Mesh : NodeFile */
20     /* */
21     /* allocates and frees node files */
22     /* */
23 jfenwick 3981 /************************************************************************************/
24 jgs 82
25     #include "NodeFile.h"
26    
27 jfenwick 3981 /************************************************************************************/
28 jgs 82
29     /* allocates a node file to hold nodes */
30 caltinay 3639 /* use Finley_NodeFile_allocTable to allocate the node table (Id,Coordinates). */
31 ksteube 1312
32 jfenwick 3259 Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Esys_MPIInfo *MPIInfo)
33 ksteube 1312 {
34 jgs 82 Finley_NodeFile *out;
35    
36     /* allocate the return value */
37    
38 jgs 102 out=MEMALLOC(1,Finley_NodeFile);
39 jgs 82 if (Finley_checkPtr(out)) return NULL;
40     out->numNodes=0;
41     out->numDim=numDim;
42 gross 1716 out->numTagsInUse=0;
43 jgs 82 out->Id=NULL;
44 ksteube 1312 out->globalDegreesOfFreedom=NULL;
45 jgs 82 out->Tag=NULL;
46     out->Coordinates=NULL;
47 gross 776 out->status=FINLEY_INITIAL_STATUS;
48 ksteube 1312
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 gross 1552 out->degreesOfFreedomConnector=NULL;
65     out->reducedDegreesOfFreedomConnector=NULL;
66 gross 1716 out->tagsInUse=NULL;
67 ksteube 1312
68 jfenwick 3259 out->MPIInfo = Esys_MPIInfo_getReference( MPIInfo );
69 jgs 82 return out;
70     }
71    
72 ksteube 1312 /* frees a node file: */
73 jgs 82
74 ksteube 1312 void Finley_NodeFile_free(Finley_NodeFile* in) {
75 jgs 82 if (in!=NULL) {
76 ksteube 1312 Finley_NodeFile_freeTable(in);
77 jfenwick 3259 Esys_MPIInfo_free( in->MPIInfo );
78 jgs 82 MEMFREE(in);
79     }
80     }
81 ksteube 1312
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