/[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

temp/finley/src/Mesh_prepare.c revision 1387 by trankine, Fri Jan 11 07:45:26 2008 UTC trunk/finley/src/Mesh_prepare.c 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);
96    
97       return;       return;
98  }  }
# Line 110  void Finley_Mesh_optimizeElementOrdering Line 115  void Finley_Mesh_optimizeElementOrdering
115    if (Finley_noError()) Finley_ElementFile_optimizeOrdering(&(in->Points));    if (Finley_noError()) Finley_ElementFile_optimizeOrdering(&(in->Points));
116    if (Finley_noError()) Finley_ElementFile_optimizeOrdering(&(in->ContactElements));    if (Finley_noError()) Finley_ElementFile_optimizeOrdering(&(in->ContactElements));
117  }  }
118    
119    /*                                                                    */
120    /*  redistribute elements to minimize communication during assemblage */
121    void Finley_Mesh_setTagsInUse(Finley_Mesh* in)
122    {
123        if (Finley_noError()) Finley_NodeFile_setTagsInUse(in->Nodes);
124        if (Finley_noError()) Finley_ElementFile_setTagsInUse(in->Elements);
125        if (Finley_noError()) Finley_ElementFile_setTagsInUse(in->FaceElements);
126        if (Finley_noError()) Finley_ElementFile_setTagsInUse(in->Points);
127        if (Finley_noError()) Finley_ElementFile_setTagsInUse(in->ContactElements);
128    }

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

  ViewVC Help
Powered by ViewVC 1.1.26