/[escript]/trunk-mpi-branch/finley/src/DOFMap.c
ViewVC logotype

Contents of /trunk-mpi-branch/finley/src/DOFMap.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1269 - (show annotations)
Wed Aug 22 08:55:03 2007 UTC (12 years, 9 months ago) by ksteube
File MIME type: text/plain
File size: 1977 byte(s)
Most of the tests pass now when compiled without -DPASO_MPI.
Resolved all compiler warnings except one.

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 /* Author: gross@access.edu.au */
15 /* Version: $Id$ */
16
17 /**************************************************************/
18
19 #include "DOFMap.h"
20
21 Finley_DOFMap* Finley_DOFMap_alloc(dim_t numNodes, index_t* globalID, Paso_Distribution* distribution)
22 {
23 Finley_DOFMap* out=NULL;
24 /* allocate the return value */
25 out=MEMALLOC(1,Finley_DOFMap);
26 if (Finley_checkPtr(out)) return NULL;
27
28 out->distribution=Paso_Distribution_getReference(distribution);
29 out->MPIInfo=Paso_MPIInfo_getReference(distribution->mpi_info);
30 out->numNodes=0;
31 out->ID=NULL;
32 out->myNumDOFs=0;
33 out->numDOFs=0;
34 out->numRemotes=0;
35 out->remoteID=NULL;
36 out->remoteProcessor=NULL;
37 out->offsetInRemoteID=NULL;
38 out->numNeighbours=0;
39 out->neighbours=NULL;
40 out->reference_counter=1;
41 return(out);
42 }
43
44 void Finley_DOFMap_free(Finley_DOFMap* in) {
45 if ( in ) {
46 in->reference_counter--;
47 if (in->reference_counter<=0) {
48 Paso_Distribution_free(in->distribution);
49 Paso_MPIInfo_free(in->MPIInfo);
50 MEMFREE(in->ID);
51 MEMFREE(in->remoteID);
52 MEMFREE(in->remoteProcessor);
53 MEMFREE(in->offsetInRemoteID);
54 MEMFREE(in->neighbours);
55 MEMFREE(in);
56 }
57 }
58 }
59 Finley_DOFMap* DOFMap_getReference(Finley_DOFMap *in )
60 {
61 if ( in )
62 in->reference_counter++;
63 return in;
64 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26