/[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 1388 - (hide annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 3 months ago) by trankine
Original Path: trunk/finley/src/NodeFile.c
File MIME type: text/plain
File size: 5898 byte(s)
And get the *(&(*&(* name right
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     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     out->degreesOfFreedomCoupler=NULL;
63     out->reducedDegreesOfFreedomCoupler=NULL;
64    
65 bcumming 730 out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
66 jgs 82 return out;
67     }
68    
69 ksteube 1312 /* frees a node file: */
70 jgs 82
71 ksteube 1312 void Finley_NodeFile_free(Finley_NodeFile* in) {
72 jgs 82 if (in!=NULL) {
73 ksteube 1312 Finley_NodeFile_freeTable(in);
74     Paso_MPIInfo_free( in->MPIInfo );
75 jgs 82 MEMFREE(in);
76     }
77     }
78 ksteube 1312
79     index_t Finley_NodeFile_getFirstReducedNode(Finley_NodeFile* in) {
80     if (in!=NULL) {
81     return Paso_Distribution_getFirstComponent(in->reducedNodesDistribution);
82     } else {
83     return 0;
84     }
85     }
86     index_t Finley_NodeFile_getLastReducedNode(Finley_NodeFile* in){
87     if (in!=NULL) {
88     return Paso_Distribution_getLastComponent(in->reducedNodesDistribution);
89     } else {
90     return 0;
91     }
92    
93     }
94    
95     dim_t Finley_NodeFile_getGlobalNumReducedNodes(Finley_NodeFile* in){
96     if (in!=NULL) {
97     return Paso_Distribution_getGlobalNumComponents(in->reducedNodesDistribution);
98     } else {
99     return 0;
100     }
101    
102     }
103     index_t* Finley_NodeFile_borrowGlobalReducedNodesIndex(Finley_NodeFile* in){
104     if (in!=NULL) {
105     return in->globalReducedNodesIndex;
106     } else {
107     return NULL;
108     }
109     }
110     index_t Finley_NodeFile_getFirstNode(Finley_NodeFile* in) {
111     if (in!=NULL) {
112     return Paso_Distribution_getFirstComponent(in->nodesDistribution);
113     } else {
114     return 0;
115     }
116     }
117     index_t Finley_NodeFile_getLastNode(Finley_NodeFile* in){
118     if (in!=NULL) {
119     return Paso_Distribution_getLastComponent(in->nodesDistribution);
120     } else {
121     return 0;
122     }
123    
124     }
125     dim_t Finley_NodeFile_getGlobalNumNodes(Finley_NodeFile* in){
126     if (in!=NULL) {
127     return Paso_Distribution_getGlobalNumComponents(in->nodesDistribution);
128     } else {
129     return 0;
130     }
131    
132     }
133     index_t* Finley_NodeFile_borrowGlobalNodesIndex(Finley_NodeFile* in){
134     if (in!=NULL) {
135     return in->globalNodesIndex;
136     } else {
137     return NULL;
138     }
139     }
140    
141     dim_t Finley_NodeFile_getNumReducedNodes(Finley_NodeFile* in) {
142     if (in!=NULL) {
143     return in->reducedNodesMapping->numTargets;
144     } else {
145     return 0;
146     }
147    
148     }
149     dim_t Finley_NodeFile_getNumDegreesOfFreedom(Finley_NodeFile* in) {
150     if (in!=NULL) {
151     return Paso_Distribution_getMyNumComponents(in->degreesOfFreedomDistribution);
152     } else {
153     return 0;
154     }
155     }
156     dim_t Finley_NodeFile_getNumNodes(Finley_NodeFile* in) {
157     if (in!=NULL) {
158     return in->nodesMapping->numNodes;
159     } else {
160     return 0;
161     }
162     }
163     dim_t Finley_NodeFile_getNumReducedDegreesOfFreedom(Finley_NodeFile* in) {
164     if (in!=NULL) {
165     return Paso_Distribution_getMyNumComponents(in->reducedDegreesOfFreedomDistribution);
166     } else {
167     return 0;
168     }
169     }
170    
171    
172     index_t* Finley_NodeFile_borrowTargetReducedNodes(Finley_NodeFile* in){
173     if (in!=NULL) {
174     return in->reducedNodesMapping->target;
175     } else {
176     return NULL;
177     }
178     }
179    
180     index_t* Finley_NodeFile_borrowTargetDegreesOfFreedom(Finley_NodeFile* in){
181     if (in!=NULL) {
182     return in->degreesOfFreedomMapping->target;
183     } else {
184     return NULL;
185     }
186     }
187    
188     index_t* Finley_NodeFile_borrowTargetNodes(Finley_NodeFile* in){
189     if (in!=NULL) {
190     return in->nodesMapping->target;
191     } else {
192     return NULL;
193     }
194     }
195    
196     index_t* Finley_NodeFile_borrowTargetReducedDegreesOfFreedom(Finley_NodeFile* in){
197     if (in!=NULL) {
198     return in->reducedDegreesOfFreedomMapping->target;
199     } else {
200     return NULL;
201     }
202     }
203    
204     index_t* Finley_NodeFile_borrowReducedNodesTarget(Finley_NodeFile* in){
205     if (in!=NULL) {
206     return in->reducedNodesMapping->map;
207     } else {
208     return NULL;
209     }
210     }
211    
212     index_t* Finley_NodeFile_borrowDegreesOfFreedomTarget(Finley_NodeFile* in){
213     if (in!=NULL) {
214     return in->degreesOfFreedomMapping->map;
215     } else {
216     return NULL;
217     }
218     }
219    
220     index_t* Finley_NodeFile_borrowNodesTarget(Finley_NodeFile* in){
221     if (in!=NULL) {
222     return in->nodesMapping->map;
223     } else {
224     return NULL;
225     }
226     }
227    
228     index_t* Finley_NodeFile_borrowReducedDegreesOfFreedomTarget(Finley_NodeFile* in){
229     if (in!=NULL) {
230     return in->reducedDegreesOfFreedomMapping->map;
231     } else {
232     return NULL;
233     }
234     }
235    
236    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26