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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1387 - (hide annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 6 months ago) by trankine
Original Path: temp/finley/src/NodeFile_setCoordinates.c
File MIME type: text/plain
File size: 1662 byte(s)
Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
1 jgs 150
2 ksteube 1312 /* $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 jgs 82 /**************************************************************/
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 jgs 150 char error_msg[LenErrorMsg_MAX];
32 ksteube 1312 size_t numDim_size;
33     int n;
34 jgs 82 if (getDataPointSize(newX)!=self->numDim) {
35 gross 776 sprintf(error_msg,"Finley_NodeFile_setCoordinates: dimension of new coordinates has to be %d.",self->numDim);
36 jgs 150 Finley_setError(VALUE_ERROR,error_msg);
37 jgs 82 } else if (! numSamplesEqual(newX,1,self->numNodes)) {
38 gross 776 sprintf(error_msg,"Finley_NodeFile_setCoordinates: number of give nodes must to be %d.",self->numNodes);
39 jgs 150 Finley_setError(VALUE_ERROR,error_msg);
40 jgs 82 } else {
41 ksteube 1312 numDim_size=self->numDim*sizeof(double);
42 gross 776 Finley_increaseStatus(self);
43 jgs 82 #pragma omp parallel for private(n) schedule(static)
44     for (n=0;n<self->numNodes;n++)
45 ksteube 1312 memcpy(&(self->Coordinates[INDEX2(0,n,self->numDim)]), getSampleDataFast(newX,n), numDim_size);
46 jgs 82 }
47     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26