/[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/finley/src/ElementFile_gather.c revision 964 by gross, Tue Feb 13 05:10:26 2007 UTC trunk/dudley/src/ElementFile_gather.c revision 3911 by jfenwick, Thu Jun 14 01:01:03 2012 UTC
# Line 1  Line 1 
1  /*  
2   ************************************************************  /*******************************************************
3   *          Copyright 2006 by ACcESS MNRF                   *  *
4   *                                                          *  * Copyright (c) 2003-2012 by University of Queensland
5   *              http://www.access.edu.au                    *  * Earth Systems Science Computational Center (ESSCC)
6   *       Primary Business: Queensland, Australia            *  * http://www.uq.edu.au/esscc
7   *  Licensed under the Open Software License version 3.0    *  *
8   *     http://www.opensource.org/licenses/osl-3.0.php       *  * 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 20  Line 21 
21    
22  /**************************************************************/  /**************************************************************/
23    
 /*  Author: gross@access.edu.au */  
 /*  Version: $Id$ */  
   
 /**************************************************************/  
   
24  #include "ElementFile.h"  #include "ElementFile.h"
25    
26  /**************************************************************/  /**************************************************************/
27    
28  void Finley_ElementFile_gather(index_t* index, Finley_ElementFile* in, Finley_ElementFile* out) {  void Dudley_ElementFile_gather(index_t * index, Dudley_ElementFile * in, Dudley_ElementFile * out)
29     index_t k;  {
30     dim_t e,j;      index_t k;
31     dim_t NN_in=in->ReferenceElement->Type->numNodes;      dim_t e, j;
32     dim_t NN_out=out->ReferenceElement->Type->numNodes;      dim_t NN_in = in->numNodes;
33     if (in!=NULL) {      dim_t NN_out = out->numNodes;
34       /*OMP */      if (in != NULL)
35       #pragma omp parallel for private(e,k,j) schedule(static)      {
36       for (e=0;e<out->numElements;e++) {      /*OMP */
37          k=index[e];  #pragma omp parallel for private(e,k,j) schedule(static)
38  #ifdef PASO_MPI      for (e = 0; e < out->numElements; e++)
39          out->Dom[e]=in->Dom[k];      {
40  #endif          k = index[e];
41          out->Id[e]=in->Id[k];          out->Id[e] = in->Id[k];
42          out->Tag[e]=in->Tag[k];          out->Tag[e] = in->Tag[k];
43          out->Color[e]=in->Color[k]+out->maxColor+1;          out->Owner[e] = in->Owner[k];
44          for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,e,NN_out)]=in->Nodes[INDEX2(j,k,NN_in)];          out->Color[e] = in->Color[k] + out->maxColor + 1;
45       }          for (j = 0; j < MIN(NN_out, NN_in); j++)
46       out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);          out->Nodes[INDEX2(j, e, NN_out)] = in->Nodes[INDEX2(j, k, NN_in)];
47       out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);      }
48       out->isPrepared = MIN(out->isPrepared , in->isPrepared);      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.3  2005/09/15 03:44:22  jgs  
 * Merge of development branch dev-02 back to main trunk on 2005-09-15  
 *  
 * Revision 1.2.2.1  2005/09/07 06:26:18  gross  
 * the solver from finley are put into the standalone package paso now  
 *  
 * Revision 1.2  2005/07/08 04:07:49  jgs  
 * Merge of development branch back to main trunk on 2005-07-08  
 *  
 * Revision 1.1.1.1.2.2  2005/06/30 01:53:55  gross  
 * a bug in coloring fixed  
 *  
 * Revision 1.1.1.1.2.1  2005/06/29 02:34:49  gross  
 * some changes towards 64 integers in finley  
 *  
 * Revision 1.1.1.1  2004/10/26 06:53:57  jgs  
 * initial import of project esys2  
 *  
 * Revision 1.1.1.1  2004/06/24 04:00:40  johng  
 * Initial version of eys using boost-python.  
 *  
 *  
 */  

Legend:
Removed from v.964  
changed lines
  Added in v.3911

  ViewVC Help
Powered by ViewVC 1.1.26