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

Contents of /trunk/dudley/src/NodeFile_setCoordinates.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: 1646 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 the array newX into self->coordinates */
19
20 /**************************************************************/
21
22 #include "NodeFile.h"
23 #include "Util.h"
24
25 /**************************************************************/
26
27 void Dudley_NodeFile_setCoordinates(Dudley_NodeFile * self, escriptDataC * newX)
28 {
29 char error_msg[LenErrorMsg_MAX];
30 size_t numDim_size;
31 int n;
32 if (getDataPointSize(newX) != self->numDim)
33 {
34 sprintf(error_msg, "Dudley_NodeFile_setCoordinates: dimension of new coordinates has to be %d.", self->numDim);
35 Dudley_setError(VALUE_ERROR, error_msg);
36 }
37 else if (!numSamplesEqual(newX, 1, self->numNodes))
38 {
39 sprintf(error_msg, "Dudley_NodeFile_setCoordinates: number of given nodes must to be %d.", self->numNodes);
40 Dudley_setError(VALUE_ERROR, error_msg);
41 }
42 else
43 {
44 numDim_size = self->numDim * sizeof(double);
45 Dudley_increaseStatus(self);
46 #pragma omp parallel private(n)
47 {
48
49 #pragma omp for schedule(static)
50 for (n = 0; n < self->numNodes; n++)
51 {
52 memcpy(&(self->Coordinates[INDEX2(0, n, self->numDim)]), getSampleDataROFast(newX, n), numDim_size);
53 }
54 }
55 }
56 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26