/[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 3981 - (show annotations)
Fri Sep 21 02:47:54 2012 UTC (7 years, 2 months ago) by jfenwick
File MIME type: text/plain
File size: 2029 byte(s)
First pass of updating copyright notices
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2012 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 /*************************************************************************************/
18 /* Finley: ElementFile */
19 /* copies element file 'in' into element file 'out' starting */
20 /* from 'offset'. The elements offset to */
21 /* in->numElements+offset-1 in out will be overwritten */
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, NN_in;
32 if (in==NULL) return;
33 NN=out->numNodes;
34 NN_in=in->numNodes;
35 if (NN_in > NN) {
36 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: dimensions of element files don't match.");
37 }
38 if (out->MPIInfo->comm!=in->MPIInfo->comm) {
39 Finley_setError(TYPE_ERROR,"Finley_ElementFile_copyTable: MPI communicators of element files don't match.");
40 }
41 if (Finley_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