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

Contents of /trunk-mpi-branch/finley/src/NodeFile_setCoordinates.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1223 - (show annotations)
Fri Aug 3 02:40:39 2007 UTC (11 years, 8 months ago) by gross
File MIME type: text/plain
File size: 1912 byte(s)
first attemt towards an improved MPI version.  

1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14
15 /* Finley: Mesh: NodeFile */
16
17 /* copies the array newX into self->coordinates */
18
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "NodeFile.h"
27 #include "Util.h"
28
29 /**************************************************************/
30
31
32 void Finley_NodeFile_setCoordinates(Finley_NodeFile* self,escriptDataC* newX) {
33 char error_msg[LenErrorMsg_MAX];
34 size_t numDim_size;
35 int n;
36 if (getDataPointSize(newX)!=self->numDim) {
37 sprintf(error_msg,"Finley_NodeFile_setCoordinates: dimension of new coordinates has to be %d.",self->numDim);
38 Finley_setError(VALUE_ERROR,error_msg);
39 } else if (! numSamplesEqual(newX,1,self->numNodes)) {
40 sprintf(error_msg,"Finley_NodeFile_setCoordinates: number of give nodes must to be %d.",self->numNodes);
41 Finley_setError(VALUE_ERROR,error_msg);
42 } else {
43 numDim_size=self->numDim*sizeof(double);
44 Finley_increaseStatus(self);
45 #pragma omp parallel for private(n) schedule(static)
46 for (n=0;n<self->numNodes;n++)
47 memcpy(&(self->Coordinates[INDEX2(0,n,self->numDim)]), getSampleDataFast(newX,n), numDim_size);
48 }
49 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26