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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 7 months ago) by jfenwick
File MIME type: text/plain
File size: 2036 byte(s)
Round 1 of copyright fixes
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 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 /* Dudley: 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 void Dudley_ElementFile_copyTable(index_t offset, Dudley_ElementFile * out, index_t node_offset, index_t idOffset,
30 Dudley_ElementFile * in)
31 {
32 dim_t i, n;
33 dim_t NN, NN_in;
34 if (in == NULL)
35 return;
36 NN = out->numNodes;
37 NN_in = in->numNodes;
38 if (NN_in > NN)
39 {
40 Dudley_setError(TYPE_ERROR, "Dudley_ElementFile_copyTable: dimensions of element files don't match.");
41 }
42 if (out->MPIInfo->comm != in->MPIInfo->comm)
43 {
44 Dudley_setError(TYPE_ERROR, "Dudley_ElementFile_copyTable: MPI communicators of element files don't match.");
45 }
46 if (Dudley_noError())
47 {
48 #pragma omp parallel for private(i,n) schedule(static)
49 for (n = 0; n < in->numElements; n++)
50 {
51 out->Owner[offset + n] = out->Owner[n];
52 out->Id[offset + n] = in->Id[n] + idOffset;
53 out->Tag[offset + n] = in->Tag[n];
54 for (i = 0; i < NN; i++)
55 out->Nodes[INDEX2(i, offset + n, NN)] = in->Nodes[INDEX2(i, n, NN_in)] + node_offset;
56 }
57 }
58 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26