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

Contents of /trunk-mpi-branch/finley/src/Assemble_NodeCoordinates.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: 2184 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 /* assemblage routines: copies node coordinates into an expanded Data Object */
16
17 /**************************************************************/
18
19 /* Copyrights by ACcESS Australia 2003,2004,2005 */
20 /* Version: $Id$ */
21
22 /**************************************************************/
23
24 #include "Util.h"
25 #include "Assemble.h"
26 #ifdef _OPENMP
27 #include <omp.h>
28 #endif
29
30 /**************************************************************/
31
32 void Finley_Assemble_NodeCoordinates(Finley_NodeFile* nodes,escriptDataC* x) {
33 char error_msg[LenErrorMsg_MAX];
34 dim_t n;
35 size_t dim_size;
36 Finley_resetError();
37 if (nodes==NULL) return;
38 if (! numSamplesEqual(x,1,nodes->numNodes)) {
39 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: illegal number of samples of Data object");
40 } else if (getFunctionSpaceType(x)!=FINLEY_NODES) {
41 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: Data object is not defined on nodes.");
42 } else if (! isExpanded(x)) {
43 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: expanded Data object expected");
44 } else if (! isDataPointShapeEqual(x,1, &(nodes->numDim))) {
45 sprintf(error_msg,"Finley_Assemble_NodeCoordinates: Data object of shape (%d,) expected",nodes->numDim);
46 Finley_setError(TYPE_ERROR,error_msg);
47 } else {
48 dim_size=nodes->numDim*sizeof(double);
49 #pragma omp parallel for private(n)
50 for (n=0;n<nodes->numNodes;n++)
51 memcpy(getSampleDataFast(x,n),&(nodes->Coordinates[INDEX2(0,n,nodes->numDim)]),dim_size);
52 }
53 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26