/[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 1811 - (show annotations)
Thu Sep 25 23:11:13 2008 UTC (10 years, 9 months ago) by ksteube
File MIME type: text/plain
File size: 2028 byte(s)
Copyright updated in all files

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 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 /* copies element file in into element file out starting from offset */
20 /* the elements offset to in->numElements+offset-1 in out will be overwritten */
21
22 /**************************************************************/
23
24 #include "ElementFile.h"
25
26 /****************************************************************************/
27
28
29 void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
30 dim_t i,n;
31 dim_t NN=out->numNodes;
32 if (in==NULL) return;
33 if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
34 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match");
35 }
36 if (out->MPIInfo->comm!=in->MPIInfo->comm) {
37 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: MPI communicators of element files don't match");
38 }
39 if (Finley_noError()) {
40 #pragma omp parallel for private(i,n) schedule(static)
41 for(n=0;n<in->numElements;n++) {
42 out->Owner[offset+n]=out->Owner[n];
43 out->Id[offset+n]=in->Id[n]+idOffset;
44 out->Tag[offset+n]=in->Tag[n];
45 for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;
46 }
47 }
48 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26