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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2271 - (hide annotations)
Mon Feb 16 05:08:29 2009 UTC (10 years, 5 months ago) by jfenwick
File MIME type: text/plain
File size: 1909 byte(s)
Merging version 2269 to trunk

1 jgs 82
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
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 jgs 82
14 ksteube 1811
15 jgs 82 /**************************************************************/
16    
17 ksteube 1312 /* assemblage routines: copies node coordinates into an expanded Data Object */
18 jgs 82
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 jgs 150 char error_msg[LenErrorMsg_MAX];
31 jgs 123 dim_t n;
32 ksteube 1312 size_t dim_size;
33 jgs 150 Finley_resetError();
34 jgs 82 if (nodes==NULL) return;
35     if (! numSamplesEqual(x,1,nodes->numNodes)) {
36 gross 584 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: illegal number of samples of Data object");
37 jgs 82 } else if (getFunctionSpaceType(x)!=FINLEY_NODES) {
38 gross 584 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: Data object is not defined on nodes.");
39 jgs 82 } else if (! isExpanded(x)) {
40 gross 584 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: expanded Data object expected");
41 jgs 82 } else if (! isDataPointShapeEqual(x,1, &(nodes->numDim))) {
42 gross 584 sprintf(error_msg,"Finley_Assemble_NodeCoordinates: Data object of shape (%d,) expected",nodes->numDim);
43 jgs 150 Finley_setError(TYPE_ERROR,error_msg);
44 jgs 82 } else {
45 ksteube 1312 dim_size=nodes->numDim*sizeof(double);
46 jfenwick 2271 requireWrite(x);
47 jgs 82 #pragma omp parallel for private(n)
48     for (n=0;n<nodes->numNodes;n++)
49 jfenwick 2271 memcpy(getSampleDataRWFast(x,n),&(nodes->Coordinates[INDEX2(0,n,nodes->numDim)]),dim_size);
50 jgs 82 }
51     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26