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

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

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

revision 4491 by caltinay, Fri Jun 7 02:23:49 2013 UTC revision 4492 by caltinay, Tue Jul 2 01:44:11 2013 UTC
# Line 26  using namespace finley; Line 26  using namespace finley;
26    
27  void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize) {  void Finley_Mesh_prepare(Finley_Mesh* in, bool_t optimize) {
28       dim_t newGlobalNumDOFs=0, numReducedNodes=0,i;       dim_t newGlobalNumDOFs=0, numReducedNodes=0,i;
29       index_t* distribution=NULL, *maskReducedNodes=NULL, *indexReducedNodes=NULL, *node_distribution=NULL;       index_t* distribution=NULL, *maskReducedNodes=NULL, *node_distribution=NULL;
30       if (in==NULL) return;       if (in==NULL) return;
31       if (in->Nodes == NULL) return;       if (in->Nodes == NULL) return;
32    
# Line 70  void Finley_Mesh_prepare(Finley_Mesh* in Line 70  void Finley_Mesh_prepare(Finley_Mesh* in
70    
71    
72          maskReducedNodes=new index_t[in->Nodes->numNodes];          maskReducedNodes=new index_t[in->Nodes->numNodes];
73          indexReducedNodes=new index_t[in->Nodes->numNodes];          std::vector<int> indexReducedNodes(in->Nodes->numNodes);
74          if (! ( Finley_checkPtr(maskReducedNodes) ||  Finley_checkPtr(indexReducedNodes) ) ) {          if (!Finley_checkPtr(maskReducedNodes)) {
75    
76  /* useful DEBUG:  /* useful DEBUG:
77  {index_t MIN_id,MAX_id;  {index_t MIN_id,MAX_id;
# Line 87  printf("Mesh_prepare: local node id rang Line 87  printf("Mesh_prepare: local node id rang
87    
88            Finley_Mesh_markNodes(maskReducedNodes,0,in,TRUE);            Finley_Mesh_markNodes(maskReducedNodes,0,in,TRUE);
89        
90            numReducedNodes=util::packMask(in->Nodes->numNodes,maskReducedNodes,indexReducedNodes);            numReducedNodes=util::packMask(in->Nodes->numNodes,maskReducedNodes,&indexReducedNodes[0]);
91    
92            in->Nodes->createDenseNodeLabeling(node_distribution, distribution);            in->Nodes->createDenseNodeLabeling(node_distribution, distribution);
93            // created reduced DOF labeling            // created reduced DOF labeling
# Line 96  printf("Mesh_prepare: local node id rang Line 96  printf("Mesh_prepare: local node id rang
96            in->Nodes->createDenseReducedLabeling(maskReducedNodes, true);            in->Nodes->createDenseReducedLabeling(maskReducedNodes, true);
97    
98            /* create the missing mappings */            /* create the missing mappings */
99            if (Finley_noError()) Finley_Mesh_createNodeFileMappings(in,numReducedNodes,indexReducedNodes,distribution, node_distribution);            if (Finley_noError())
100                    in->Nodes->createNodeMappings(numReducedNodes,indexReducedNodes,distribution, node_distribution);
101          }          }
102    
103          delete[] maskReducedNodes;          delete[] maskReducedNodes;
         delete[] indexReducedNodes;  
104       }       }
105    
106       delete[] distribution;       delete[] distribution;

Legend:
Removed from v.4491  
changed lines
  Added in v.4492

  ViewVC Help
Powered by ViewVC 1.1.26