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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (hide annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 5 months ago) by jfenwick
Original Path: trunk/finley/src/NodeFile_scatter.c
File MIME type: text/plain
File size: 2452 byte(s)
Round 1 of copyright fixes
1 jgs 150
2 jfenwick 3981 /*****************************************************************************
3 ksteube 1811 *
4 jfenwick 4154 * Copyright (c) 2003-2013 by University of Queensland
5 jfenwick 3981 * http://www.uq.edu.au
6 ksteube 1811 *
7     * Primary Business: Queensland, Australia
8     * Licensed under the Open Software License version 3.0
9     * http://www.opensource.org/licenses/osl-3.0.php
10     *
11 jfenwick 3981 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12     * Development since 2012 by School of Earth Sciences
13     *
14     *****************************************************************************/
15 ksteube 1312
16 ksteube 1811
17 jfenwick 3981 /************************************************************************************/
18 jgs 82
19     /* Finley: Mesh: NodeFile */
20    
21     /* scatters the NodeFile in into NodeFile out using index[0:in->numNodes-1]. */
22     /* index has to be between 0 and out->numNodes-1. */
23 caltinay 3639 /* coloring is chosen for the worst case */
24 jgs 82
25 jfenwick 3981 /************************************************************************************/
26 jgs 82
27 ksteube 1312 #include "NodeFile.h"
28 jgs 82
29 jfenwick 3981 /************************************************************************************/
30 jgs 82
31 ksteube 1312 void Finley_NodeFile_scatterEntries(dim_t n, index_t* index, index_t min_index, index_t max_index,
32     index_t* Id_out, index_t* Id_in,
33     index_t* Tag_out, index_t* Tag_in,
34     index_t* globalDegreesOfFreedom_out, index_t* globalDegreesOfFreedom_in,
35     dim_t numDim, double* Coordinates_out, double* Coordinates_in)
36     {
37     dim_t i;
38     register index_t k;
39 gross 1763 const index_t range=max_index-min_index;
40     const size_t numDim_size=(size_t)numDim*sizeof(double);
41 jgs 82
42 ksteube 1312 #pragma omp parallel for private(i,k) schedule(static)
43     for (i=0;i<n;i++) {
44     k=index[i]-min_index;
45     if ((k>=0) && (k <range)) {
46     Id_out[k]=Id_in[i];
47     Tag_out[k]=Tag_in[i];
48     globalDegreesOfFreedom_out[k]=globalDegreesOfFreedom_in[i];
49     memcpy(&(Coordinates_out[INDEX2(0,k,numDim)]), &(Coordinates_in[INDEX2(0,i,numDim)]), numDim_size);
50     }
51 jgs 82 }
52     }
53 ksteube 1312
54     void Finley_NodeFile_scatter(index_t* index, Finley_NodeFile* in, Finley_NodeFile* out)
55     {
56     Finley_NodeFile_scatterEntries(out->numNodes, index, 0, in->numNodes,
57     out->Id, in->Id,
58     out->Tag, in->Tag,
59     out->globalDegreesOfFreedom, in->globalDegreesOfFreedom,
60     out->numDim, out->Coordinates, in->Coordinates);
61     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26