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

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

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

revision 6008 by caltinay, Fri Feb 5 03:37:49 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: Element File */  /*   Dudley: Element File */
20    
# Line 22  Line 22 
22  /*   index has to be between 0 and in->elements-1. */  /*   index has to be between 0 and in->elements-1. */
23  /*   a conservative assumption on the coloring is made */  /*   a conservative assumption on the coloring is made */
24    
25  /************************************************************************************/  /****************************************************************************/
   
 #define ESNEEDPYTHON  
 #include "esysUtils/first.h"  
26    
27  #include "ElementFile.h"  #include "ElementFile.h"
28    
29  /************************************************************************************/  namespace dudley {
30    
31  void Dudley_ElementFile_gather(index_t * index, Dudley_ElementFile * in, Dudley_ElementFile * out)  void Dudley_ElementFile_gather(index_t* index, Dudley_ElementFile* in, Dudley_ElementFile* out)
32  {  {
33      index_t k;      index_t k;
34      dim_t e, j;      dim_t e, j;
# Line 39  void Dudley_ElementFile_gather(index_t * Line 36  void Dudley_ElementFile_gather(index_t *
36      dim_t NN_out = out->numNodes;      dim_t NN_out = out->numNodes;
37      if (in != NULL)      if (in != NULL)
38      {      {
     /*OMP */  
39  #pragma omp parallel for private(e,k,j) schedule(static)  #pragma omp parallel for private(e,k,j) schedule(static)
40      for (e = 0; e < out->numElements; e++)          for (e = 0; e < out->numElements; e++)
41      {          {
42          k = index[e];              k = index[e];
43          out->Id[e] = in->Id[k];              out->Id[e] = in->Id[k];
44          out->Tag[e] = in->Tag[k];              out->Tag[e] = in->Tag[k];
45          out->Owner[e] = in->Owner[k];              out->Owner[e] = in->Owner[k];
46          out->Color[e] = in->Color[k] + out->maxColor + 1;              out->Color[e] = in->Color[k] + out->maxColor + 1;
47          for (j = 0; j < MIN(NN_out, NN_in); j++)              for (j = 0; j < std::min(NN_out, NN_in); j++)
48          out->Nodes[INDEX2(j, e, NN_out)] = in->Nodes[INDEX2(j, k, NN_in)];                  out->Nodes[INDEX2(j, e, NN_out)] = in->Nodes[INDEX2(j, k, NN_in)];
49      }          }
50      out->minColor = MIN(out->minColor, in->minColor + out->maxColor + 1);          out->minColor = std::min(out->minColor, in->minColor + out->maxColor + 1);
51      out->maxColor = MAX(out->maxColor, in->maxColor + out->maxColor + 1);          out->maxColor = std::max(out->maxColor, in->maxColor + out->maxColor + 1);
52      }      }
53  }  }
54    
55    } // namespace dudley
56    

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

  ViewVC Help
Powered by ViewVC 1.1.26