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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 964 - (show annotations)
Tue Feb 13 05:10:26 2007 UTC (12 years, 5 months ago) by gross
File MIME type: text/plain
File size: 3053 byte(s)
The set/getRefVal functions of Data objects have been removed (mainly to avoid later problems with MPI).
Moreover, a faster access to the reference id of samples has been introduced. I don't think that anybody will
profit form this at this stage but it will allow a faster dump of data objects.


1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14 /* */
15 /* Finley: Mesh : NodeFile */
16 /* */
17 /* allocates and deallocates node files */
18 /* */
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "NodeFile.h"
27
28 /**************************************************************/
29
30 /* allocates a node file to hold nodes */
31 /* use Finley_NodeFile_allocTable to allocate the node table (Id,Coordinatess). */
32 #ifdef PASO_MPI
33 Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim, Paso_MPIInfo *MPIInfo){
34 #else
35 Finley_NodeFile* Finley_NodeFile_alloc(dim_t numDim){
36 #endif
37 Finley_NodeFile *out;
38
39 /* allocate the return value */
40
41 out=MEMALLOC(1,Finley_NodeFile);
42 if (Finley_checkPtr(out)) return NULL;
43 out->isPrepared=FINLEY_UNKNOWN;
44 out->numNodes=0;
45 out->numDegreesOfFreedom=0;
46 out->reducedNumDegreesOfFreedom=0;
47 out->reducedNumNodes=0;
48 out->numDim=numDim;
49 out->Id=NULL;
50 out->Tag=NULL;
51 out->Coordinates=NULL;
52 out->degreeOfFreedom=NULL;
53 out->degreeOfFreedomId=NULL;
54 out->reducedDegreeOfFreedom=NULL;
55 out->reducedDegreeOfFreedomId=NULL;
56 out->toReduced=NULL;
57 out->status=FINLEY_INITIAL_STATUS;
58 #ifdef PASO_MPI
59 out->Dom=NULL;
60 out->MPIInfo = Paso_MPIInfo_getReference( MPIInfo );
61 out->degreeOfFreedomDistribution = Finley_NodeDistribution_alloc( MPIInfo );
62 out->reducedDegreeOfFreedomDistribution = Finley_NodeDistribution_alloc( MPIInfo );
63 out->CommBuffer = Paso_CommBuffer_alloc( MPIInfo, __g_nodeTag++ );
64 out->reducedCommBuffer = Paso_CommBuffer_alloc( MPIInfo, __g_nodeTag++ );
65 #endif
66 return out;
67 }
68
69 /* deallocates a node file: */
70
71 void Finley_NodeFile_dealloc(Finley_NodeFile* in) {
72 if (in!=NULL) {
73 #ifdef Finley_TRACE
74 printf("node file is deallocated.\n");
75 #endif
76 Finley_NodeFile_deallocTable(in);
77 #ifdef PASO_MPI
78 Paso_MPIInfo_dealloc( in->MPIInfo );
79 Finley_NodeDistribution_dealloc( in->degreeOfFreedomDistribution );
80 Finley_NodeDistribution_dealloc( in->reducedDegreeOfFreedomDistribution );
81 Paso_CommBuffer_dealloc( in->CommBuffer );
82 Paso_CommBuffer_dealloc( in->reducedCommBuffer );
83 #endif
84 MEMFREE(in);
85 }
86 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26