/[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 1762 - (show annotations)
Mon Sep 8 02:42:39 2008 UTC (11 years, 3 months ago) by gross
File MIME type: text/plain
File size: 1676 byte(s)
some formatting
1
2 /* $Id$ */
3
4 /*******************************************************
5 *
6 * Copyright 2003-2007 by ACceSS MNRF
7 * Copyright 2007 by University of Queensland
8 *
9 * http://esscc.uq.edu.au
10 * Primary Business: Queensland, Australia
11 * Licensed under the Open Software License version 3.0
12 * http://www.opensource.org/licenses/osl-3.0.php
13 *
14 *******************************************************/
15
16 /**************************************************************/
17
18 /* Finley: Mesh: NodeFile */
19
20 /* copies the array newX into self->coordinates */
21
22 /**************************************************************/
23
24 #include "NodeFile.h"
25 #include "Util.h"
26
27 /**************************************************************/
28
29
30 void Finley_NodeFile_setCoordinates(Finley_NodeFile* self,escriptDataC* newX) {
31 char error_msg[LenErrorMsg_MAX];
32 size_t numDim_size;
33 int n;
34 if (getDataPointSize(newX)!=self->numDim) {
35 sprintf(error_msg,"Finley_NodeFile_setCoordinates: dimension of new coordinates has to be %d.",self->numDim);
36 Finley_setError(VALUE_ERROR,error_msg);
37 } else if (! numSamplesEqual(newX,1,self->numNodes)) {
38 sprintf(error_msg,"Finley_NodeFile_setCoordinates: number of give nodes must to be %d.",self->numNodes);
39 Finley_setError(VALUE_ERROR,error_msg);
40 } else {
41 numDim_size=self->numDim*sizeof(double);
42 Finley_increaseStatus(self);
43 #pragma omp parallel for private(n) schedule(static)
44 for (n=0;n<self->numNodes;n++) {
45 memcpy(&(self->Coordinates[INDEX2(0,n,self->numDim)]), getSampleDataFast(newX,n), numDim_size);
46 }
47 }
48 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26