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

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

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

trunk/esys2/finley/src/finleyC/ElementFile_gather.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC branches/domexper/dudley/src/ElementFile_gather.c revision 3224 by jfenwick, Wed Sep 29 05:19:37 2010 UTC
# Line 1  Line 1 
1  /* $Id$ */  
2    /*******************************************************
3    *
4    * Copyright (c) 2003-2010 by University of Queensland
5    * Earth Systems Science Computational Center (ESSCC)
6    * http://www.uq.edu.au/esscc
7    *
8    * Primary Business: Queensland, Australia
9    * Licensed under the Open Software License version 3.0
10    * http://www.opensource.org/licenses/osl-3.0.php
11    *
12    *******************************************************/
13    
14  /**************************************************************/  /**************************************************************/
15    
16  /*   Finley: ElementFile */  /*   Dudley: ElementFile */
17    
18  /*   gathers the ElementFile out from the  ElementFile in using index[0:out->numElements-1].  */  /*   gathers the ElementFile out from the  ElementFile in using index[0:out->numElements-1].  */
19  /*   index has to be between 0 and in->numElements-1. */  /*   index has to be between 0 and in->numElements-1. */
# Line 9  Line 21 
21    
22  /**************************************************************/  /**************************************************************/
23    
 /*   Copyrights by ACcESS Australia 2003/04 */  
 /*   Author: gross@access.edu.au */  
 /*   Version: $Id$ */  
   
 /**************************************************************/  
   
 #include "Finley.h"  
24  #include "ElementFile.h"  #include "ElementFile.h"
25    
26  /**************************************************************/  /**************************************************************/
27    
28  void Finley_ElementFile_gather(int* index, Finley_ElementFile* in, Finley_ElementFile* out) {  void Dudley_ElementFile_gather(index_t * index, Dudley_ElementFile * in, Dudley_ElementFile * out)
29     maybelong e,k,j;  {
30     maybelong NN_in=in->ReferenceElement->Type->numNodes;      index_t k;
31     maybelong NN_out=out->ReferenceElement->Type->numNodes;      dim_t e, j;
32     if (in!=NULL) {      dim_t NN_in = in->numNodes;
33       /*OMP */      dim_t NN_out = out->numNodes;
34       #pragma omp parallel for private(e,k,j) schedule(static)      if (in != NULL)
35       for (e=0;e<out->numElements;e++) {      {
36          k=index[e];      /*OMP */
37          out->Id[e]=in->Id[k];  #pragma omp parallel for private(e,k,j) schedule(static)
38          out->Tag[e]=in->Tag[k];      for (e = 0; e < out->numElements; e++)
39          out->Color[e]=in->Color[k]+out->numColors;      {
40          for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,e,NN_out)]=in->Nodes[INDEX2(j,k,NN_in)];          k = index[e];
41       }          out->Id[e] = in->Id[k];
42       out->numColors+=in->numColors;          out->Tag[e] = in->Tag[k];
43     }          out->Owner[e] = in->Owner[k];
44            out->Color[e] = in->Color[k] + out->maxColor + 1;
45            for (j = 0; j < MIN(NN_out, NN_in); j++)
46            out->Nodes[INDEX2(j, e, NN_out)] = in->Nodes[INDEX2(j, k, NN_in)];
47        }
48        out->minColor = MIN(out->minColor, in->minColor + out->maxColor + 1);
49        out->maxColor = MAX(out->maxColor, in->maxColor + out->maxColor + 1);
50        }
51  }  }
 /*  
 * $Log$  
 * Revision 1.1  2004/10/26 06:53:57  jgs  
 * Initial revision  
 *  
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
 *  
 *  
 */  

Legend:
Removed from v.82  
changed lines
  Added in v.3224

  ViewVC Help
Powered by ViewVC 1.1.26