|
/* $Id$ */ |
|
|
/**************************************************************/ |
|
|
/* */ |
|
|
/* Finley: ElementFile */ |
|
|
/* */ |
|
|
/* scatter the ElementFile in into the ElementFile out using index[0:out->numElements-1]. */ |
|
|
/* index has to be between 0 and in->numElements-1. */ |
|
|
/* a conservative assumtion on the coloring is made */ |
|
|
/* */ |
|
|
/**************************************************************/ |
|
1 |
|
|
2 |
/* Copyrights by ACcESS Australia 2003/04 */ |
/******************************************************* |
3 |
/* Author: gross@access.edu.au */ |
* |
4 |
/* Version: $Id$ */ |
* Copyright (c) 2003-2010 by University of Queensland |
5 |
|
* 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 |
|
|
14 |
|
|
15 |
/**************************************************************/ |
/************************************************************** |
16 |
|
* |
17 |
|
* Finley: ElementFile |
18 |
|
* |
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 |
|
|
|
#include "Common.h" |
|
25 |
#include "ElementFile.h" |
#include "ElementFile.h" |
26 |
|
|
27 |
/**************************************************************/ |
/**************************************************************/ |
28 |
|
|
29 |
void Finley_ElementFile_scatter(int* index, Finley_ElementFile* in, Finley_ElementFile* out) { |
void Finley_ElementFile_scatter(index_t* index, Finley_ElementFile* in, Finley_ElementFile* out) { |
30 |
maybelong e,k,j; |
index_t k; |
31 |
|
dim_t e,j; |
32 |
if (in!=NULL) { |
if (in!=NULL) { |
33 |
int NN_in=in->ReferenceElement->Type->numNodes; |
dim_t NN_in=in->numNodes; |
34 |
int NN_out=out->ReferenceElement->Type->numNodes; |
dim_t NN_out=out->numNodes; |
35 |
/*OMP */ |
/*OMP */ |
36 |
#pragma omp parallel for private(e,k,j) schedule(static) |
#pragma omp parallel for private(e,k,j) schedule(static) |
37 |
for (e=0;e<in->numElements;e++) { |
for (e=0;e<in->numElements;e++) { |
38 |
k=index[e]; |
k=index[e]; |
39 |
|
out->Owner[k]=in->Owner[e]; |
40 |
out->Id[k]=in->Id[e]; |
out->Id[k]=in->Id[e]; |
41 |
out->Tag[k]=in->Tag[e]; |
out->Tag[k]=in->Tag[e]; |
42 |
out->Color[k]=in->Color[e]+out->numColors; |
out->Color[k]=in->Color[e]+out->maxColor+1; |
43 |
for(j=0;j<MIN(NN_out,NN_in);j++) out->Nodes[INDEX2(j,k,NN_out)]=in->Nodes[INDEX2(j,e,NN_in)]; |
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 |
out->numColors+=in->numColors; |
out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1); |
46 |
|
out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1); |
47 |
} |
} |
48 |
} |
} |
|
/* |
|
|
* $Log$ |
|
|
* Revision 1.1 2004/10/26 06:53:57 jgs |
|
|
* Initial revision |
|
|
* |
|
|
* Revision 1.1.1.1 2004/06/24 04:00:40 johng |
|
|
* Initial version of eys using boost-python. |
|
|
* |
|
|
* |
|
|
*/ |
|