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

Contents of /trunk/finley/src/NodeFile_setCoordinates.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (show annotations)
Thu Sep 25 23:11:13 2008 UTC (11 years, 2 months ago) by ksteube
File MIME type: text/plain
File size: 1641 byte(s)
Copyright updated in all files

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 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
17 /* Finley: Mesh: NodeFile */
18
19 /* copies the array newX into self->coordinates */
20
21 /**************************************************************/
22
23 #include "NodeFile.h"
24 #include "Util.h"
25
26 /**************************************************************/
27
28
29 void Finley_NodeFile_setCoordinates(Finley_NodeFile* self,escriptDataC* newX) {
30 char error_msg[LenErrorMsg_MAX];
31 size_t numDim_size;
32 int n;
33 if (getDataPointSize(newX)!=self->numDim) {
34 sprintf(error_msg,"Finley_NodeFile_setCoordinates: dimension of new coordinates has to be %d.",self->numDim);
35 Finley_setError(VALUE_ERROR,error_msg);
36 } else if (! numSamplesEqual(newX,1,self->numNodes)) {
37 sprintf(error_msg,"Finley_NodeFile_setCoordinates: number of give nodes must to be %d.",self->numNodes);
38 Finley_setError(VALUE_ERROR,error_msg);
39 } else {
40 numDim_size=self->numDim*sizeof(double);
41 Finley_increaseStatus(self);
42 #pragma omp parallel for private(n) schedule(static)
43 for (n=0;n<self->numNodes;n++) {
44 memcpy(&(self->Coordinates[INDEX2(0,n,self->numDim)]), getSampleDataFast(newX,n), numDim_size);
45 }
46 }
47 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26