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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26