/[escript]/branches/domexper/dudley/src/NodeFile.c
ViewVC logotype

Annotation of /branches/domexper/dudley/src/NodeFile.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1716 - (hide annotations)
Thu Aug 21 05:03:49 2008 UTC (10 years, 8 months ago) by gross
Original Path: trunk/finley/src/NodeFile.c
File MIME type: text/plain
File size: 5948 byte(s)
getListOfTags method added to FunctionSpace class
1 jgs 150
2 ksteube 1312 /* $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 jgs 82 /**************************************************************/
17     /* */
18     /* Finley: Mesh : NodeFile */
19     /* */
20 ksteube 1312 /* allocates and freeates node files */
21 jgs 82 /* */
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 ksteube 1312
31     Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Paso_MPIInfo *MPIInfo)
32     {
33 jgs 82 Finley_NodeFile *out;
34    
35     /* allocate the return value */
36    
37 jgs 102 out=MEMALLOC(1,Finley_NodeFile);
38 jgs 82 if (Finley_checkPtr(out)) return NULL;
39     out->numNodes=0;
40     out->numDim=numDim;
41 gross 1716 out->numTagsInUse=0;
42 jgs 82 out->Id=NULL;
43 ksteube 1312 out->globalDegreesOfFreedom=NULL;
44 jgs 82 out->Tag=NULL;
45     out->Coordinates=NULL;
46 gross 776 out->status=FINLEY_INITIAL_STATUS;
47 ksteube 1312
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 gross 1552 out->degreesOfFreedomConnector=NULL;
64     out->reducedDegreesOfFreedomConnector=NULL;
65 gross 1716 out->tagsInUse=NULL;
66 ksteube 1312
67 bcumming 730 out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
68 jgs 82 return out;
69     }
70    
71 ksteube 1312 /* frees a node file: */
72 jgs 82
73 ksteube 1312 void Finley_NodeFile_free(Finley_NodeFile* in) {
74 jgs 82 if (in!=NULL) {
75 ksteube 1312 Finley_NodeFile_freeTable(in);
76     Paso_MPIInfo_free( in->MPIInfo );
77 jgs 82 MEMFREE(in);
78     }
79     }
80 ksteube 1312
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