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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 964 - (show annotations)
Tue Feb 13 05:10:26 2007 UTC (12 years, 4 months ago) by gross
File MIME type: text/plain
File size: 2649 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 /* copies element file in into element file out starting from offset */
18 /* the elements offset to in->numElements+offset-1 in out will be overwritten */
19
20 /**************************************************************/
21
22 /* Author: gross@access.edu.au */
23 /* Version: $Id$ */
24
25 /**************************************************************/
26
27 #include "ElementFile.h"
28
29 /****************************************************************************/
30
31
32 void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
33 dim_t i,n;
34 dim_t NN=out->ReferenceElement->Type->numNodes;
35 if (in==NULL) return;
36 /* check dimension and file size */
37 if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
38 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match");
39 }
40 if (out->numElements<in->numElements+offset) {
41 Finley_setError(MEMORY_ERROR,"Finley_ElementFile_copyTable: element table is too small.");
42 }
43 if (Finley_noError()) {
44 #pragma omp parallel for private(i,n) schedule(static)
45 for(n=0;n<in->numElements;n++) {
46 #ifdef PASO_MPI
47 out->Dom[offset+n]=in->Dom[n]+idOffset;
48 #endif
49 out->Id[offset+n]=in->Id[n]+idOffset;
50 out->Tag[offset+n]=in->Tag[n];
51 out->Color[offset+n]=in->Color[n]+out->maxColor+1;
52 for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;
53 }
54 out->minColor=MIN(out->minColor,in->minColor+out->maxColor+1);
55 out->maxColor=MAX(out->maxColor,in->maxColor+out->maxColor+1);
56 out->isPrepared=MIN(out->isPrepared,in->isPrepared);
57 }
58 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26