/[escript]/branches/doubleplusgood/finley/src/Mesh_addPoints.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/finley/src/Mesh_addPoints.cpp

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

revision 4326 by jfenwick, Wed Feb 27 06:09:33 2013 UTC revision 4327 by jfenwick, Wed Mar 20 05:09:11 2013 UTC
# Line 62  void Finley_Mesh_addPoints(Finley_Mesh* Line 62  void Finley_Mesh_addPoints(Finley_Mesh*
62    }      }  
63    newPoints=Finley_ElementFile_alloc(refPoints, mpi_info);    newPoints=Finley_ElementFile_alloc(refPoints, mpi_info);
64    /* first we find the node which is the closest on this processor: */    /* first we find the node which is the closest on this processor: */
65    dist_p=TMPMEMALLOC(numPoints, double);    dist_p=new  double[numPoints];
66    point_index_p=TMPMEMALLOC(numPoints,index_t);    point_index_p=new index_t[numPoints];
67    node_id_p=TMPMEMALLOC(numPoints,index_t);    node_id_p=new index_t[numPoints];
68        
69    for (i=0; i< numPoints; ++i) {    for (i=0; i< numPoints; ++i) {
70       dist_p[i]=LARGE_POSITIVE_FLOAT;       dist_p[i]=LARGE_POSITIVE_FLOAT;
# Line 160  void Finley_Mesh_addPoints(Finley_Mesh* Line 160  void Finley_Mesh_addPoints(Finley_Mesh*
160           MPI_Op op;           MPI_Op op;
161           int count = 2* numPoints;           int count = 2* numPoints;
162           double *sendbuf =NULL, *recvbuf=NULL;           double *sendbuf =NULL, *recvbuf=NULL;
163       sendbuf=TMPMEMALLOC(count,double);       sendbuf=new double[count];
164       recvbuf=TMPMEMALLOC(count,double);       recvbuf=new double[count];
165            
166       for (i=0; i< numPoints; ++i) {       for (i=0; i< numPoints; ++i) {
167                sendbuf[2*i  ]= dist_p[i];                sendbuf[2*i  ]= dist_p[i];
# Line 177  void Finley_Mesh_addPoints(Finley_Mesh* Line 177  void Finley_Mesh_addPoints(Finley_Mesh*
177              node_id_p[i] =-1;              node_id_p[i] =-1;
178            }            }
179           }           }
180           TMPMEMFREE(sendbuf);           delete[] sendbuf;
181       TMPMEMFREE(recvbuf);       delete[] recvbuf;
182      }      }
183    #endif    #endif
184    /*  we pick the points to be used on this processor */    /*  we pick the points to be used on this processor */
# Line 246  void Finley_Mesh_addPoints(Finley_Mesh* Line 246  void Finley_Mesh_addPoints(Finley_Mesh*
246     newPoints->maxColor=0;     newPoints->maxColor=0;
247        
248    /* all done */    /* all done */
249    TMPMEMFREE(dist_p);    delete[] dist_p;
250    TMPMEMFREE(node_id_p);    delete[] node_id_p;
251    TMPMEMFREE(point_index_p);    delete[] point_index_p;
252    Finley_ReferenceElementSet_dealloc(refPoints);    Finley_ReferenceElementSet_dealloc(refPoints);
253    Esys_MPIInfo_free(mpi_info);    Esys_MPIInfo_free(mpi_info);
254    if (Finley_noError()) {    if (Finley_noError()) {

Legend:
Removed from v.4326  
changed lines
  Added in v.4327

  ViewVC Help
Powered by ViewVC 1.1.26