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

Diff of /trunk/finley/src/Mesh_prepare.c

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

revision 1716 by gross, Thu Aug 21 05:03:49 2008 UTC revision 1749 by gross, Wed Sep 3 07:25:01 2008 UTC
# Line 25  Line 25 
25    
26  void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize) {  void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize) {
27       dim_t newGlobalNumDOFs=0, numReducedNodes=0,i;       dim_t newGlobalNumDOFs=0, numReducedNodes=0,i;
28       index_t* distribution=NULL, *maskReducedNodes=NULL, *indexReducedNodes=NULL;       index_t* distribution=NULL, *maskReducedNodes=NULL, *indexReducedNodes=NULL, *node_distribution=NULL;
29       if (in==NULL) return;       if (in==NULL) return;
30       if (in->Nodes == NULL) return;       if (in->Nodes == NULL) return;
31    
32       /* first step is to distribute the elements according to a global distribution of DOF */       /* first step is to distribute the elements according to a global distribution of DOF */
33    
34       distribution=TMPMEMALLOC(in->MPIInfo->size+1,index_t);       distribution=TMPMEMALLOC(in->MPIInfo->size+1,index_t);
35       if (! Finley_checkPtr(distribution)) {       node_distribution=TMPMEMALLOC(in->MPIInfo->size+1,index_t);
36         if (! (Finley_checkPtr(distribution) || Finley_checkPtr(node_distribution))) {
37          /* first we create dense labeling for the DOFs */          /* first we create dense labeling for the DOFs */
38          newGlobalNumDOFs=Finley_NodeFile_createDenseDOFLabeling(in->Nodes);          newGlobalNumDOFs=Finley_NodeFile_createDenseDOFLabeling(in->Nodes);
39    
# Line 76  void Finley_Mesh_prepare(Finley_Mesh* in Line 77  void Finley_Mesh_prepare(Finley_Mesh* in
77        
78            numReducedNodes=Finley_Util_packMask(in->Nodes->numNodes,maskReducedNodes,indexReducedNodes);            numReducedNodes=Finley_Util_packMask(in->Nodes->numNodes,maskReducedNodes,indexReducedNodes);
79    
80            Finley_NodeFile_createDenseNodeLabeling(in->Nodes);            Finley_NodeFile_createDenseNodeLabeling(in->Nodes, node_distribution, distribution);
81            Finley_NodeFile_createDenseReducedNodeLabeling(in->Nodes,maskReducedNodes);  
82            Finley_NodeFile_createDenseReducedDOFLabeling(in->Nodes,maskReducedNodes);            Finley_NodeFile_createDenseReducedDOFLabeling(in->Nodes,maskReducedNodes);
83              Finley_NodeFile_createDenseReducedNodeLabeling(in->Nodes,maskReducedNodes);
84            /* create the missing mappings */            /* create the missing mappings */
85            if (Finley_noError()) Finley_Mesh_createNodeFileMappings(in,numReducedNodes,indexReducedNodes,distribution);            if (Finley_noError()) Finley_Mesh_createNodeFileMappings(in,numReducedNodes,indexReducedNodes,distribution, node_distribution);
86          }          }
87    
88          TMPMEMFREE(maskReducedNodes);          TMPMEMFREE(maskReducedNodes);
# Line 88  void Finley_Mesh_prepare(Finley_Mesh* in Line 90  void Finley_Mesh_prepare(Finley_Mesh* in
90       }       }
91    
92       TMPMEMFREE(distribution);       TMPMEMFREE(distribution);
93         TMPMEMFREE(node_distribution);
94    
95       Finley_Mesh_setTagsInUse(in);       Finley_Mesh_setTagsInUse(in);
96    

Legend:
Removed from v.1716  
changed lines
  Added in v.1749

  ViewVC Help
Powered by ViewVC 1.1.26