/[escript]/trunk/dataexporter/src/NodeData.cpp
ViewVC logotype

Diff of /trunk/dataexporter/src/NodeData.cpp

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

revision 2834 by caltinay, Thu Jan 7 06:06:56 2010 UTC revision 2846 by caltinay, Fri Jan 15 03:16:08 2010 UTC
# Line 293  StringVec NodeData::getVarNames() const Line 293  StringVec NodeData::getVarNames() const
293  //  //
294  //  //
295  //  //
 void NodeData::removeGhostNodes(int ownIndex)  
 {  
     if (nodeDist.empty() || ownIndex > nodeDist.size()-1)  
         return;  
   
     int firstId = nodeDist[ownIndex];  
     int lastId = nodeDist[ownIndex+1];  
   
     // no ghost nodes  
     if (lastId-firstId == numNodes)  
         return;  
   
     // we have at most lastId-firstId nodes, it could be less however if  
     // nodes were culled already  
     numNodes = lastId-firstId;  
   
     CoordArray newCoords;  
     CoordArray::iterator it;  
     for (int i=0; i<numDims; i++) {  
         float* c = new float[numNodes];  
         newCoords.push_back(c);  
     }  
   
     IntVec newNodeID, newNodeTag;  
     IntVec newNodeGDOF, newNodeGNI, newNodeGRDFI, newNodeGRNI;  
   
     IndexMap nodeID2idx = getIndexMap();  
     int destIdx = 0;  
     for (int i=firstId; i<lastId; i++) {  
         IndexMap::iterator it = nodeID2idx.find(i);  
         if (it == nodeID2idx.end()) {  
             continue;  
         }  
         int idx = it->second;  
         for (int dim=0; dim<numDims; dim++) {  
             newCoords[dim][destIdx] = coords[dim][idx];  
         }  
         destIdx++;  
         newNodeID.push_back(i);  
         newNodeTag.push_back(nodeTag[idx]);  
         newNodeGDOF.push_back(nodeGDOF[idx]);  
         newNodeGNI.push_back(nodeGNI[idx]);  
         newNodeGRDFI.push_back(nodeGRDFI[idx]);  
         newNodeGRNI.push_back(nodeGRNI[idx]);  
     }  
   
     numNodes = destIdx;  
   
     for (it = coords.begin(); it != coords.end(); it++)  
         delete[] *it;  
   
     coords = newCoords;  
     nodeID = newNodeID;  
     nodeTag = newNodeTag;  
     nodeGDOF = newNodeGDOF;  
     nodeGNI = newNodeGNI;  
     nodeGRDFI = newNodeGRDFI;  
     nodeGRNI = newNodeGRNI;  
 }  
   
 //  
 //  
 //  
296  bool NodeData::writeToSilo(DBfile* dbfile)  bool NodeData::writeToSilo(DBfile* dbfile)
297  {  {
298  #if USE_SILO  #if USE_SILO

Legend:
Removed from v.2834  
changed lines
  Added in v.2846

  ViewVC Help
Powered by ViewVC 1.1.26