/[escript]/trunk/finley/src/NodeFile_scatter.c
ViewVC logotype

Diff of /trunk/finley/src/NodeFile_scatter.c

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

trunk/esys2/finley/src/finleyC/NodeFile_scatter.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/finley/src/NodeFile_scatter.c revision 1811 by ksteube, Thu Sep 25 23:11:13 2008 UTC
# Line 1  Line 1 
1  /* $Id$ */  
2    /*******************************************************
3    *
4    * Copyright (c) 2003-2008 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    
17  /*   Finley: Mesh: NodeFile */  /*   Finley: Mesh: NodeFile */
# Line 9  Line 22 
22    
23  /**************************************************************/  /**************************************************************/
24    
 /*   Copyrights by ACcESS Australia 2003/04 */  
 /*   Author: gross@access.edu.au */  
 /*   Version: $Id$ */  
   
 /**************************************************************/  
   
 #include "Common.h"  
25  #include "NodeFile.h"  #include "NodeFile.h"
26    
27  /**************************************************************/  /**************************************************************/
28    
29  void Finley_NodeFile_scatter(maybelong* index, Finley_NodeFile* in, Finley_NodeFile* out) {  void Finley_NodeFile_scatterEntries(dim_t n, index_t* index, index_t min_index, index_t max_index,
30     maybelong i,k,j;                                     index_t* Id_out, index_t* Id_in,
31     if (in->Id!=NULL) {                                     index_t* Tag_out, index_t* Tag_in,
32       #pragma omp parallel for private(i,j,k) schedule(static)                                     index_t* globalDegreesOfFreedom_out, index_t* globalDegreesOfFreedom_in,
33       for (i=0;i<in->numNodes;i++) {                                     dim_t numDim, double* Coordinates_out, double* Coordinates_in)
34          k=index[i];  {
35          out->Id[k]=in->Id[i];     dim_t i;
36          out->Tag[k]=in->Tag[i];     register index_t k;
37          out->degreeOfFreedom[k]=in->degreeOfFreedom[i];     const index_t range=max_index-min_index;
38          out->reducedDegreeOfFreedom[k]=in->reducedDegreeOfFreedom[i];     const size_t numDim_size=(size_t)numDim*sizeof(double);
39          out->toReduced[k]=in->toReduced[i];  
40          for(j=0;j<in->numDim;j++) out->Coordinates[INDEX2(j,k,in->numDim)]=in->Coordinates[INDEX2(j,i,in->numDim)];     #pragma omp parallel for private(i,k) schedule(static)
41       }     for (i=0;i<n;i++) {
42          k=index[i]-min_index;
43          if ((k>=0) && (k <range)) {
44             Id_out[k]=Id_in[i];
45             Tag_out[k]=Tag_in[i];
46             globalDegreesOfFreedom_out[k]=globalDegreesOfFreedom_in[i];
47             memcpy(&(Coordinates_out[INDEX2(0,k,numDim)]), &(Coordinates_in[INDEX2(0,i,numDim)]), numDim_size);
48          }
49     }     }
50  }  }
51  /*  
52  * $Log$  void Finley_NodeFile_scatter(index_t* index, Finley_NodeFile* in, Finley_NodeFile* out)
53  * Revision 1.1  2004/10/26 06:53:57  jgs  {
54  * Initial revision     Finley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
55  *                                    out->Id, in->Id,
56  * Revision 1.1.1.1  2004/06/24 04:00:40  johng                                    out->Tag, in->Tag,
57  * Initial version of eys using boost-python.                                    out->globalDegreesOfFreedom, in->globalDegreesOfFreedom,
58  *                                    out->numDim, out->Coordinates, in->Coordinates);
59  *  }
 */  

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

  ViewVC Help
Powered by ViewVC 1.1.26