/[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 1388 - (show annotations)
Fri Jan 11 07:45:58 2008 UTC (11 years, 10 months ago) by trankine
File MIME type: text/plain
File size: 2063 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 /* copies element file in into element file out starting from offset */
21 /* the elements offset to in->numElements+offset-1 in out will be overwritten */
22
23 /**************************************************************/
24
25 #include "ElementFile.h"
26
27 /****************************************************************************/
28
29
30 void Finley_ElementFile_copyTable(index_t offset,Finley_ElementFile* out,index_t node_offset, index_t idOffset,Finley_ElementFile* in) {
31 dim_t i,n;
32 dim_t NN=out->numNodes;
33 if (in==NULL) return;
34 if (out->ReferenceElement->Type->TypeId!=in->ReferenceElement->Type->TypeId) {
35 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match");
36 }
37 if (out->MPIInfo->comm!=in->MPIInfo->comm) {
38 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: MPI communicators of element files don't match");
39 }
40 if (Finley_noError()) {
41 #pragma omp parallel for private(i,n) schedule(static)
42 for(n=0;n<in->numElements;n++) {
43 out->Owner[offset+n]=out->Owner[n];
44 out->Id[offset+n]=in->Id[n]+idOffset;
45 out->Tag[offset+n]=in->Tag[n];
46 for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,in->ReferenceElement->Type->numNodes)]+node_offset;
47 }
48 }
49 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26