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

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

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

revision 616 by elspeth, Wed Mar 22 02:46:56 2006 UTC revision 730 by bcumming, Mon May 15 04:03:49 2006 UTC
# Line 69  void  Finley_Mesh_resolveNodeIds(Finley_ Line 69  void  Finley_Mesh_resolveNodeIds(Finley_
69    /*  allocate a new node file used to gather existing node file: */    /*  allocate a new node file used to gather existing node file: */
70        
71    len=max_id-min_id+1;    len=max_id-min_id+1;
72    #ifndef PASO_MPI
73    newNodeFile=Finley_NodeFile_alloc(numDim);    newNodeFile=Finley_NodeFile_alloc(numDim);
74    #else
75      newNodeFile=Finley_NodeFile_alloc(numDim,in->MPIInfo);
76    #endif
77    if (! Finley_noError()) goto clean;    if (! Finley_noError()) goto clean;
78    
79    maskNodes=TMPMEMALLOC(len,index_t);    maskNodes=TMPMEMALLOC(len,index_t);
# Line 79  void  Finley_Mesh_resolveNodeIds(Finley_ Line 83  void  Finley_Mesh_resolveNodeIds(Finley_
83    if (Finley_checkPtr(maskElements)) goto clean;    if (Finley_checkPtr(maskElements)) goto clean;
84    
85    index=TMPMEMALLOC(in->Nodes->numNodes,index_t);    index=TMPMEMALLOC(in->Nodes->numNodes,index_t);
   if (Finley_checkPtr(maskElements)) goto clean;  
86    
87    Finley_NodeFile_allocTable(newNodeFile,len);    if (Finley_checkPtr(maskElements)) goto clean;
   if (! Finley_noError()) goto clean;  
88    
89    #pragma omp parallel for private(n) schedule(static)    #pragma omp parallel for private(n) schedule(static)
90    for (n=0;n<in->Nodes->numNodes;n++) index[n]=-1;    for (n=0;n<in->Nodes->numNodes;n++) index[n]=-1;
# Line 111  void  Finley_Mesh_resolveNodeIds(Finley_ Line 113  void  Finley_Mesh_resolveNodeIds(Finley_
113       }       }
114    }    }
115    
116      Finley_NodeFile_allocTable(newNodeFile,len);
117      if (! Finley_noError() ) goto clean;
118    
119    if (Finley_noError()) {    if (Finley_noError()) {
120        
121        /*  scatter the nodefile in->nodes into newNodeFile using index; */        /*  scatter the nodefile in->nodes into newNodeFile using index; */
122        #pragma omp parallel for private(k) schedule(static)        #pragma omp parallel for private(k) schedule(static)
123        for (k=0;k<in->Nodes->numNodes;k++) index[k]=in->Nodes->Id[k]-min_id;        for (k=0;k<in->Nodes->numNodes;k++)
124            index[k]=in->Nodes->Id[k]-min_id;
125        Finley_NodeFile_scatter(index,in->Nodes,newNodeFile);        Finley_NodeFile_scatter(index,in->Nodes,newNodeFile);
126      
127        /*  relable used nodes: */        /*  relable used nodes: */
128        /* index maps the new node labeling onto the old one */        /* index maps the new node labeling onto the old one */
129        newNumNodes=Finley_Util_packMask(len,maskElements,index);        newNumNodes=Finley_Util_packMask(len,maskElements,index);
# Line 127  void  Finley_Mesh_resolveNodeIds(Finley_ Line 133  void  Finley_Mesh_resolveNodeIds(Finley_
133        /*  create a new table of nodes: */        /*  create a new table of nodes: */
134        Finley_NodeFile_deallocTable(in->Nodes);        Finley_NodeFile_deallocTable(in->Nodes);
135        Finley_NodeFile_allocTable(in->Nodes,newNumNodes);        Finley_NodeFile_allocTable(in->Nodes,newNumNodes);
136    
137        if (! Finley_noError()) goto clean;        if (! Finley_noError()) goto clean;
138    
139        /* gather the new nodefile into in->Nodes */        /* gather the new nodefile into in->Nodes */

Legend:
Removed from v.616  
changed lines
  Added in v.730

  ViewVC Help
Powered by ViewVC 1.1.26