/[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

revision 1311 by gross, Tue Feb 13 05:10:26 2007 UTC revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1 
1  /*  
2   ************************************************************  /* $Id$ */
3   *          Copyright 2006 by ACcESS MNRF                   *  
4   *                                                          *  /*******************************************************
5   *              http://www.access.edu.au                    *   *
6   *       Primary Business: Queensland, Australia            *   *           Copyright 2003-2007 by ACceSS MNRF
7   *  Licensed under the Open Software License version 3.0    *   *       Copyright 2007 by University of Queensland
8   *     http://www.opensource.org/licenses/osl-3.0.php       *   *
9   *                                                          *   *                http://esscc.uq.edu.au
10   ************************************************************   *        Primary Business: Queensland, Australia
11  */   *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 20  Line 23 
23    
24  /**************************************************************/  /**************************************************************/
25    
 /*   Author: gross@access.edu.au */  
 /*   Version: $Id$ */  
   
 /**************************************************************/  
   
26  #include "NodeFile.h"  #include "NodeFile.h"
27    
28  /**************************************************************/  /**************************************************************/
29    
30  void Finley_NodeFile_scatter(index_t* 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,
31     dim_t i,j;                                     index_t* Id_out, index_t* Id_in,
32     index_t k;                                     index_t* Tag_out, index_t* Tag_in,
33     if (in->Id!=NULL) {                                     index_t* globalDegreesOfFreedom_out, index_t* globalDegreesOfFreedom_in,
34       #pragma omp parallel for private(i,j,k) schedule(static)                                     dim_t numDim, double* Coordinates_out, double* Coordinates_in)
35       for (i=0;i<in->numNodes;i++) {  {
36          k=index[i];     dim_t i;
37  #ifdef PASO_MPI     register index_t k;
38          out->Dom[k]=in->Dom[i];     register const index_t range=max_index-min_index;
39  #endif     const  size_t numDim_size=(size_t)numDim*sizeof(double);
40          out->Id[k]=in->Id[i];  
41          out->Tag[k]=in->Tag[i];     #pragma omp parallel for private(i,k) schedule(static)
42          out->degreeOfFreedom[k]=in->degreeOfFreedom[i];     for (i=0;i<n;i++) {
43          for(j=0;j<in->numDim;j++) out->Coordinates[INDEX2(j,k,in->numDim)]=in->Coordinates[INDEX2(j,i,in->numDim)];        k=index[i]-min_index;
44       }        if ((k>=0) && (k <range)) {
45       out->isPrepared=FINLEY_UNPREPARED;           Id_out[k]=Id_in[i];
46             Tag_out[k]=Tag_in[i];
47             globalDegreesOfFreedom_out[k]=globalDegreesOfFreedom_in[i];
48             memcpy(&(Coordinates_out[INDEX2(0,k,numDim)]), &(Coordinates_in[INDEX2(0,i,numDim)]), numDim_size);
49          }
50     }     }
51  }  }
52    
53    void Finley_NodeFile_scatter(index_t* index, Finley_NodeFile* in, Finley_NodeFile* out)
54    {
55       Finley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
56                                      out->Id, in->Id,
57                                      out->Tag, in->Tag,
58                                      out->globalDegreesOfFreedom, in->globalDegreesOfFreedom,
59                                      out->numDim, out->Coordinates, in->Coordinates);
60    }

Legend:
Removed from v.1311  
changed lines
  Added in v.1312

  ViewVC Help
Powered by ViewVC 1.1.26