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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (show annotations)
Thu Sep 25 23:11:13 2008 UTC (10 years, 11 months ago) by ksteube
File MIME type: text/plain
File size: 1883 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 /* assemblage routines: copies node coordinates into an expanded Data Object */
18
19 /**************************************************************/
20
21 #include "Util.h"
22 #include "Assemble.h"
23 #ifdef _OPENMP
24 #include <omp.h>
25 #endif
26
27 /**************************************************************/
28
29 void Finley_Assemble_NodeCoordinates(Finley_NodeFile* nodes,escriptDataC* x) {
30 char error_msg[LenErrorMsg_MAX];
31 dim_t n;
32 size_t dim_size;
33 Finley_resetError();
34 if (nodes==NULL) return;
35 if (! numSamplesEqual(x,1,nodes->numNodes)) {
36 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: illegal number of samples of Data object");
37 } else if (getFunctionSpaceType(x)!=FINLEY_NODES) {
38 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: Data object is not defined on nodes.");
39 } else if (! isExpanded(x)) {
40 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: expanded Data object expected");
41 } else if (! isDataPointShapeEqual(x,1, &(nodes->numDim))) {
42 sprintf(error_msg,"Finley_Assemble_NodeCoordinates: Data object of shape (%d,) expected",nodes->numDim);
43 Finley_setError(TYPE_ERROR,error_msg);
44 } else {
45 dim_size=nodes->numDim*sizeof(double);
46 #pragma omp parallel for private(n)
47 for (n=0;n<nodes->numNodes;n++)
48 memcpy(getSampleDataFast(x,n),&(nodes->Coordinates[INDEX2(0,n,nodes->numDim)]),dim_size);
49 }
50 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26