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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2548 - (hide annotations)
Mon Jul 20 06:20:06 2009 UTC (10 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 2268 byte(s)
Updating copyright notices
1 jgs 150
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * 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 ksteube 1312
14 ksteube 1811
15 jgs 82 /**************************************************************/
16    
17     /* Finley: Mesh: NodeFile */
18    
19     /* scatters the NodeFile in into NodeFile out using index[0:in->numNodes-1]. */
20     /* index has to be between 0 and out->numNodes-1. */
21     /* coloring is choosen for the worst case */
22    
23     /**************************************************************/
24    
25 ksteube 1312 #include "NodeFile.h"
26 jgs 82
27     /**************************************************************/
28    
29 ksteube 1312 void Finley_NodeFile_scatterEntries(dim_t n, index_t* index, index_t min_index, index_t max_index,
30     index_t* Id_out, index_t* Id_in,
31     index_t* Tag_out, index_t* Tag_in,
32     index_t* globalDegreesOfFreedom_out, index_t* globalDegreesOfFreedom_in,
33     dim_t numDim, double* Coordinates_out, double* Coordinates_in)
34     {
35     dim_t i;
36     register index_t k;
37 gross 1763 const index_t range=max_index-min_index;
38     const size_t numDim_size=(size_t)numDim*sizeof(double);
39 jgs 82
40 ksteube 1312 #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 jgs 82 }
50     }
51 ksteube 1312
52     void Finley_NodeFile_scatter(index_t* index, Finley_NodeFile* in, Finley_NodeFile* out)
53     {
54     Finley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
55     out->Id, in->Id,
56     out->Tag, in->Tag,
57     out->globalDegreesOfFreedom, in->globalDegreesOfFreedom,
58     out->numDim, out->Coordinates, in->Coordinates);
59     }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26