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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3259 - (show annotations)
Mon Oct 11 01:48:14 2010 UTC (9 years ago) by jfenwick
File MIME type: text/plain
File size: 1726 byte(s)
Merging dudley and scons updates from branches

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 /* Dudley: Mesh: NodeFile */
17
18 /* copies node file in into node file out starting from offset */
19 /* the nodes offset to in->numNodes+offset-1 in out will be overwritten */
20
21 /**************************************************************/
22
23 #include "NodeFile.h"
24
25 /**************************************************************/
26
27 void Dudley_NodeFile_copyTable(int offset, Dudley_NodeFile * out, int idOffset, int dofOffset, Dudley_NodeFile * in)
28 {
29 int i, n;
30 /* check dimension and file size */
31 if (out->numDim != in->numDim)
32 {
33 Dudley_setError(TYPE_ERROR, "Dudley_NodeFile_copyTable: dimensions of node files don't match");
34 }
35 if (out->numNodes < in->numNodes + offset)
36 {
37 Dudley_setError(MEMORY_ERROR, "Dudley_NodeFile_copyTable: node table is too small.");
38 }
39 if (Dudley_noError())
40 {
41 #pragma omp parallel for private(i,n) schedule(static)
42 for (n = 0; n < in->numNodes; n++)
43 {
44 out->Id[offset + n] = in->Id[n] + idOffset;
45 out->Tag[offset + n] = in->Tag[n];
46 out->globalDegreesOfFreedom[offset + n] = in->globalDegreesOfFreedom[n] + dofOffset;
47 for (i = 0; i < out->numDim; i++)
48 out->Coordinates[INDEX2(i, offset + n, out->numDim)] = in->Coordinates[INDEX2(i, n, in->numDim)];
49 }
50 }
51 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26