/[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 964 - (show annotations)
Tue Feb 13 05:10:26 2007 UTC (12 years, 8 months ago) by gross
File MIME type: text/plain
File size: 3174 byte(s)
The set/getRefVal functions of Data objects have been removed (mainly to avoid later problems with MPI).
Moreover, a faster access to the reference id of samples has been introduced. I don't think that anybody will
profit form this at this stage but it will allow a faster dump of data objects.


1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14 /* */
15 /* Finley: ElementFile */
16 /* */
17 /* scatter the ElementFile in into the ElementFile out using index[0:out->numElements-1]. */
18 /* index has to be between 0 and in->numElements-1. */
19 /* a conservative assumtion on the coloring is made */
20 /* */
21 /**************************************************************/
22
23 /* Author: gross@access.edu.au */
24 /* Version: $Id$ */
25
26 /**************************************************************/
27
28 #include "ElementFile.h"
29
30 /**************************************************************/
31
32 void Finley_ElementFile_scatter(index_t* index, Finley_ElementFile* in, Finley_ElementFile* out) {
33 index_t k;
34 dim_t e,j;
35 if (in!=NULL) {
36 dim_t NN_in=in->ReferenceElement->Type->numNodes;
37 dim_t NN_out=out->ReferenceElement->Type->numNodes;
38 /*OMP */
39 #pragma omp parallel for private(e,k,j) schedule(static)
40 for (e=0;e<in->numElements;e++) {
41 k=index[e];
42 #ifdef PASO_MPI
43 out->Dom[k]=in->Dom[e];
44 #endif
45 out->Id[k]=in->Id[e];
46 out->Tag[k]=in->Tag[e];
47 out->Color[k]=in->Color[e]+out->maxColor+1;
48 for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,k,NN_out)]=in->Nodes[INDEX2(j,e,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 out->isPrepared = MIN(in-> isPrepared, out->isPrepared);
53 }
54 }
55 /*
56 * $Log$
57 * Revision 1.3 2005/09/15 03:44:22 jgs
58 * Merge of development branch dev-02 back to main trunk on 2005-09-15
59 *
60 * Revision 1.2.2.1 2005/09/07 06:26:18 gross
61 * the solver from finley are put into the standalone package paso now
62 *
63 * Revision 1.2 2005/07/08 04:07:50 jgs
64 * Merge of development branch back to main trunk on 2005-07-08
65 *
66 * Revision 1.1.1.1.2.2 2005/06/30 01:53:55 gross
67 * a bug in coloring fixed
68 *
69 * Revision 1.1.1.1.2.1 2005/06/29 02:34:50 gross
70 * some changes towards 64 integers in finley
71 *
72 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
73 * initial import of project esys2
74 *
75 * Revision 1.1.1.1 2004/06/24 04:00:40 johng
76 * Initial version of eys using boost-python.
77 *
78 *
79 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26