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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4154 - (show annotations)
Tue Jan 22 09:30:23 2013 UTC (6 years, 6 months ago) by jfenwick
File MIME type: text/plain
File size: 2119 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 /* assemblage routines: copies node coordinates into an expanded Data Object */
19
20 /************************************************************************************/
21
22 #include "Util.h"
23 #include "Assemble.h"
24 #ifdef _OPENMP
25 #include <omp.h>
26 #endif
27
28 /************************************************************************************/
29
30 void Dudley_Assemble_NodeCoordinates(Dudley_NodeFile * nodes, escriptDataC * x)
31 {
32 char error_msg[LenErrorMsg_MAX];
33 dim_t n;
34 size_t dim_size;
35 Dudley_resetError();
36 if (nodes == NULL)
37 return;
38 if (!numSamplesEqual(x, 1, nodes->numNodes))
39 {
40 Dudley_setError(TYPE_ERROR, "Dudley_Assemble_NodeCoordinates: illegal number of samples of Data object");
41 }
42 else if (getFunctionSpaceType(x) != DUDLEY_NODES)
43 {
44 Dudley_setError(TYPE_ERROR, "Dudley_Assemble_NodeCoordinates: Data object is not defined on nodes.");
45 }
46 else if (!isExpanded(x))
47 {
48 Dudley_setError(TYPE_ERROR, "Dudley_Assemble_NodeCoordinates: expanded Data object expected");
49 }
50 else if (!isDataPointShapeEqual(x, 1, &(nodes->numDim)))
51 {
52 sprintf(error_msg, "Dudley_Assemble_NodeCoordinates: Data object of shape (%d,) expected", nodes->numDim);
53 Dudley_setError(TYPE_ERROR, error_msg);
54 }
55 else
56 {
57 dim_size = nodes->numDim * sizeof(double);
58 requireWrite(x);
59 #pragma omp parallel for private(n)
60 for (n = 0; n < nodes->numNodes; n++)
61 memcpy(getSampleDataRWFast(x, n), &(nodes->Coordinates[INDEX2(0, n, nodes->numDim)]), dim_size);
62 }
63 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26