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

Contents of /trunk/finley/src/ElementFile_scatter.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 9 months ago) by trankine
File MIME type: text/plain
File size: 2137 byte(s)
And get the *(&(*&(* name right
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
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 /* */
18 /* Finley: ElementFile */
19 /* */
20 /* scatter the ElementFile in into the ElementFile out 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 /**************************************************************/
25
26 #include "ElementFile.h"
27
28 /**************************************************************/
29
30 void Finley_ElementFile_scatter(index_t* index, Finley_ElementFile* in, Finley_ElementFile* out) {
31 index_t k;
32 dim_t e,j;
33 if (in!=NULL) {
34 dim_t NN_in=in->ReferenceElement->Type->numNodes;
35 dim_t NN_out=out->ReferenceElement->Type->numNodes;
36 /*OMP */
37 #pragma omp parallel for private(e,k,j) schedule(static)
38 for (e=0;e<in->numElements;e++) {
39 k=index[e];
40 out->Owner[k]=in->Owner[e];
41 out->Id[k]=in->Id[e];
42 out->Tag[k]=in->Tag[e];
43 out->Color[k]=in->Color[e]+out->maxColor+1;
44 for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,k,NN_out)]=in->Nodes[INDEX2(j,e,NN_in)];
45 }
46 out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);
47 out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);
48 }
49 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26