/[escript]/branches/domexper/dudley/src/ElementFile_copyTable.c
ViewVC logotype

Contents of /branches/domexper/dudley/src/ElementFile_copyTable.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3086 - (show annotations)
Thu Aug 5 05:07:58 2010 UTC (8 years, 10 months ago) by jfenwick
File MIME type: text/plain
File size: 1971 byte(s)
Another pass at removing finley

1
2 /*******************************************************
3 *
4 * 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 /* Dudley: 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 Dudley_ElementFile_copyTable(index_t offset,Dudley_ElementFile* out,index_t node_offset, index_t idOffset,Dudley_ElementFile* in) {
30 dim_t i,n;
31 dim_t NN, NN_in;
32 if (in==NULL) return;
33 NN=out->numNodes;
34 NN_in=in->numNodes;
35 if (NN_in > NN) {
36 Dudley_setError(TYPE_ERROR,"Dudley_ElementFile_copyTable: dimensions of element files don't match.");
37 }
38 if (out->MPIInfo->comm!=in->MPIInfo->comm) {
39 Dudley_setError(TYPE_ERROR,"Dudley_ElementFile_copyTable: MPI communicators of element files don't match.");
40 }
41 if (Dudley_noError()) {
42 #pragma omp parallel for private(i,n) schedule(static)
43 for(n=0;n<in->numElements;n++) {
44 out->Owner[offset+n]=out->Owner[n];
45 out->Id[offset+n]=in->Id[n]+idOffset;
46 out->Tag[offset+n]=in->Tag[n];
47 for(i=0;i<NN;i++) out->Nodes[INDEX2(i,offset+n,NN)]=in->Nodes[INDEX2(i,n,NN_in)]+node_offset;
48 }
49 }
50 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26