/[escript]/branches/trilinos_from_5897/dudley/src/NodeFile_scatter.cpp
ViewVC logotype

Diff of /branches/trilinos_from_5897/dudley/src/NodeFile_scatter.cpp

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

revision 6008 by caltinay, Mon Feb 22 06:59:27 2016 UTC revision 6009 by caltinay, Wed Mar 2 04:13:26 2016 UTC
# Line 14  Line 14 
14  *  *
15  *****************************************************************************/  *****************************************************************************/
16    
17  /************************************************************************************/  /****************************************************************************/
18    
19  /*   Dudley: Mesh: NodeFile */  /*   Dudley: Mesh: NodeFile */
20    
# Line 22  Line 22 
22  /*   index has to be between 0 and out->numNodes-1. */  /*   index has to be between 0 and out->numNodes-1. */
23  /*   coloring is chosen for the worst case */  /*   coloring is chosen for the worst case */
24    
25  /************************************************************************************/  /****************************************************************************/
   
 #define ESNEEDPYTHON  
 #include "esysUtils/first.h"  
26    
27  #include "NodeFile.h"  #include "NodeFile.h"
28    
29  /************************************************************************************/  namespace dudley {
30    
31  void Dudley_NodeFile_scatterEntries(dim_t n, index_t * index, index_t min_index, index_t max_index,  void Dudley_NodeFile_scatterEntries(dim_t n, index_t * index, index_t min_index, index_t max_index,
32                      index_t * Id_out, index_t * Id_in,                                      index_t * Id_out, index_t * Id_in,
33                      index_t * Tag_out, index_t * Tag_in,                                      index_t * Tag_out, index_t * Tag_in,
34                      index_t * globalDegreesOfFreedom_out, index_t * globalDegreesOfFreedom_in,                                      index_t * globalDegreesOfFreedom_out, index_t * globalDegreesOfFreedom_in,
35                      dim_t numDim, double *Coordinates_out, double *Coordinates_in)                                      dim_t numDim, double *Coordinates_out, double *Coordinates_in)
36  {  {
37      dim_t i;      dim_t i;
38      index_t k;      index_t k;
# Line 43  void Dudley_NodeFile_scatterEntries(dim_ Line 40  void Dudley_NodeFile_scatterEntries(dim_
40      const size_t numDim_size = (size_t) numDim * sizeof(double);      const size_t numDim_size = (size_t) numDim * sizeof(double);
41    
42  #pragma omp parallel for private(i,k) schedule(static)  #pragma omp parallel for private(i,k) schedule(static)
43      for (i = 0; i < n; i++)      for (i = 0; i < n; i++) {
44      {          k = index[i] - min_index;
45      k = index[i] - min_index;          if ((k >= 0) && (k < range)) {
46      if ((k >= 0) && (k < range))              Id_out[k] = Id_in[i];
47      {              Tag_out[k] = Tag_in[i];
48          Id_out[k] = Id_in[i];              globalDegreesOfFreedom_out[k] = globalDegreesOfFreedom_in[i];
49          Tag_out[k] = Tag_in[i];              memcpy(&(Coordinates_out[INDEX2(0, k, numDim)]), &(Coordinates_in[INDEX2(0, i, numDim)]), numDim_size);
50          globalDegreesOfFreedom_out[k] = globalDegreesOfFreedom_in[i];          }
         memcpy(&(Coordinates_out[INDEX2(0, k, numDim)]), &(Coordinates_in[INDEX2(0, i, numDim)]), numDim_size);  
     }  
51      }      }
52  }  }
53    
54  void Dudley_NodeFile_scatter(index_t * index, Dudley_NodeFile * in, Dudley_NodeFile * out)  void Dudley_NodeFile_scatter(index_t * index, Dudley_NodeFile * in, Dudley_NodeFile * out)
55  {  {
56      Dudley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,      Dudley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
57                     out->Id, in->Id,              out->Id, in->Id, out->Tag, in->Tag, out->globalDegreesOfFreedom,
58                     out->Tag, in->Tag,              in->globalDegreesOfFreedom, out->numDim, out->Coordinates,
59                     out->globalDegreesOfFreedom, in->globalDegreesOfFreedom,              in->Coordinates);
                    out->numDim, out->Coordinates, in->Coordinates);  
60  }  }
61    
62    } // namespace dudley

Legend:
Removed from v.6008  
changed lines
  Added in v.6009

  ViewVC Help
Powered by ViewVC 1.1.26