/[escript]/branches/doubleplusgood/dudley/src/ElementFile_gather.cpp
ViewVC logotype

Annotation of /branches/doubleplusgood/dudley/src/ElementFile_gather.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (hide annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 2 months ago) by jfenwick
Original Path: trunk/dudley/src/ElementFile_gather.c
File MIME type: text/plain
File size: 1825 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 jfenwick 3981 /************************************************************************************/
17 jgs 82
18 jfenwick 3086 /* Dudley: ElementFile */
19 jgs 82
20     /* gathers the ElementFile out from the ElementFile in using index[0:out->numElements-1]. */
21     /* index has to be between 0 and in->numElements-1. */
22     /* a conservative assumtion on the coloring is made */
23    
24 jfenwick 3981 /************************************************************************************/
25 jgs 82
26     #include "ElementFile.h"
27    
28 jfenwick 3981 /************************************************************************************/
29 jgs 82
30 jfenwick 3224 void Dudley_ElementFile_gather(index_t * index, Dudley_ElementFile * in, Dudley_ElementFile * out)
31     {
32     index_t k;
33     dim_t e, j;
34     dim_t NN_in = in->numNodes;
35     dim_t NN_out = out->numNodes;
36     if (in != NULL)
37     {
38     /*OMP */
39     #pragma omp parallel for private(e,k,j) schedule(static)
40     for (e = 0; e < out->numElements; e++)
41     {
42     k = index[e];
43     out->Id[e] = in->Id[k];
44     out->Tag[e] = in->Tag[k];
45     out->Owner[e] = in->Owner[k];
46     out->Color[e] = in->Color[k] + out->maxColor + 1;
47     for (j = 0; j < MIN(NN_out, NN_in); j++)
48     out->Nodes[INDEX2(j, e, NN_out)] = in->Nodes[INDEX2(j, k, NN_in)];
49     }
50     out->minColor = MIN(out->minColor, in->minColor + out->maxColor + 1);
51     out->maxColor = MAX(out->maxColor, in->maxColor + out->maxColor + 1);
52     }
53 jgs 82 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26