/[escript]/branches/domexper/dudley/src/ElementFile_scatter.c
ViewVC logotype

Annotation of /branches/domexper/dudley/src/ElementFile_scatter.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3086 - (hide annotations)
Thu Aug 5 05:07:58 2010 UTC (9 years, 5 months ago) by jfenwick
File MIME type: text/plain
File size: 2031 byte(s)
Another pass at removing finley

1 jgs 150
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 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 gross 2748 /**************************************************************
16     *
17 jfenwick 3086 * Dudley: ElementFile
18 gross 2748 *
19     * scatter the ElementFile in into the ElementFile out using index[0:out->numElements-1].
20     * index has to be between 0 and in->numElements-1.
21     * a conservative assumtion on the coloring is made
22     *
23     **************************************************************/
24 jgs 82
25     #include "ElementFile.h"
26    
27     /**************************************************************/
28    
29 jfenwick 3086 void Dudley_ElementFile_scatter(index_t* index, Dudley_ElementFile* in, Dudley_ElementFile* out) {
30 jgs 123 index_t k;
31     dim_t e,j;
32 jgs 82 if (in!=NULL) {
33 gross 2748 dim_t NN_in=in->numNodes;
34     dim_t NN_out=out->numNodes;
35 jgs 82 /*OMP */
36     #pragma omp parallel for private(e,k,j) schedule(static)
37     for (e=0;e<in->numElements;e++) {
38     k=index[e];
39 ksteube 1312 out->Owner[k]=in->Owner[e];
40 jgs 82 out->Id[k]=in->Id[e];
41     out->Tag[k]=in->Tag[e];
42 jgs 123 out->Color[k]=in->Color[e]+out->maxColor+1;
43 jgs 82 for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,k,NN_out)]=in->Nodes[INDEX2(j,e,NN_in)];
44     }
45 jgs 123 out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);
46     out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);
47 jgs 82 }
48     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26