/[escript]/branches/arrayview_from_1695_trunk/finley/src/NodeFile_allocTable.c
ViewVC logotype

Diff of /branches/arrayview_from_1695_trunk/finley/src/NodeFile_allocTable.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1780 by jfenwick, Mon Aug 11 03:33:40 2008 UTC revision 1781 by jfenwick, Thu Sep 11 05:03:14 2008 UTC
# Line 20  Line 20 
20  /**************************************************************/  /**************************************************************/
21    
22  #include "NodeFile.h"  #include "NodeFile.h"
23    #include "Util.h"
24    
25  /**************************************************************/  /**************************************************************/
26    
# Line 54  void Finley_NodeFile_allocTable(Finley_N Line 55  void Finley_NodeFile_allocTable(Finley_N
55               || Finley_checkPtr(globalNodesIndex2)               || Finley_checkPtr(globalNodesIndex2)
56               || Finley_checkPtr(reducedNodesId2)               || Finley_checkPtr(reducedNodesId2)
57               || Finley_checkPtr(degreesOfFreedomId2) ) {               || Finley_checkPtr(degreesOfFreedomId2) ) {
   reducedDegreesOfFreedomId2=MEMALLOC(numNodes,index_t);  
58      MEMFREE(Id2);      MEMFREE(Id2);
59      MEMFREE(Coordinates2);      MEMFREE(Coordinates2);
60      MEMFREE(Tag2);      MEMFREE(Tag2);
# Line 81  void Finley_NodeFile_allocTable(Finley_N Line 81  void Finley_NodeFile_allocTable(Finley_N
81      /* this initialization makes sure that data are located on the right processor */      /* this initialization makes sure that data are located on the right processor */
82      #pragma omp parallel for private(n,i) schedule(static)      #pragma omp parallel for private(n,i) schedule(static)
83      for (n=0;n<numNodes;n++) {      for (n=0;n<numNodes;n++) {
        for (i=0;i<in->numDim;i++) in->Coordinates[INDEX2(i,n,in->numDim)]=0.;  
84         in->Id[n]=-1;         in->Id[n]=-1;
85           for (i=0;i<in->numDim;i++) in->Coordinates[INDEX2(i,n,in->numDim)]=0.;
86         in->Tag[n]=-1;         in->Tag[n]=-1;
87         in->globalDegreesOfFreedom[n]=-1;         in->globalDegreesOfFreedom[n]=-1;
88         in->globalReducedDOFIndex[n]=-1;         in->globalReducedDOFIndex[n]=-1;
# Line 110  void Finley_NodeFile_freeTable(Finley_No Line 110  void Finley_NodeFile_freeTable(Finley_No
110      MEMFREE(in->reducedNodesId);      MEMFREE(in->reducedNodesId);
111      MEMFREE(in->degreesOfFreedomId);      MEMFREE(in->degreesOfFreedomId);
112      MEMFREE(in->reducedDegreesOfFreedomId);      MEMFREE(in->reducedDegreesOfFreedomId);
113        MEMFREE(in->tagsInUse);
114        in->numTagsInUse=0;
115      Finley_NodeMapping_free(in->nodesMapping);      Finley_NodeMapping_free(in->nodesMapping);
116      in->nodesMapping=NULL;      in->nodesMapping=NULL;
117      Finley_NodeMapping_free(in->reducedNodesMapping);      Finley_NodeMapping_free(in->reducedNodesMapping);
# Line 131  void Finley_NodeFile_freeTable(Finley_No Line 133  void Finley_NodeFile_freeTable(Finley_No
133      Paso_Connector_free(in->reducedDegreesOfFreedomConnector);      Paso_Connector_free(in->reducedDegreesOfFreedomConnector);
134      in->reducedDegreesOfFreedomConnector=NULL;      in->reducedDegreesOfFreedomConnector=NULL;
135    
136        in->numTagsInUse=0;
137      in->numNodes=0;      in->numNodes=0;
138    }    }
139  }  }
140    
141    void Finley_NodeFile_setTagsInUse(Finley_NodeFile* in)
142    {
143        index_t *tagsInUse=NULL;
144        dim_t numTagsInUse;
145        if (in != NULL) {
146           Finley_Util_setValuesInUse(in->Tag, in->numNodes, &numTagsInUse, &tagsInUse, in->MPIInfo);
147           if (Finley_noError()) {
148              MEMFREE(in->tagsInUse);
149              in->tagsInUse=tagsInUse;
150              in->numTagsInUse=numTagsInUse;
151           }
152       }
153    }
154    

Legend:
Removed from v.1780  
changed lines
  Added in v.1781

  ViewVC Help
Powered by ViewVC 1.1.26