/[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 1387 - (hide annotations)
Fri Jan 11 07:45:26 2008 UTC (11 years, 9 months ago) by trankine
Original Path: temp/finley/src/Assemble_NodeCoordinates.c
File MIME type: text/plain
File size: 1918 byte(s)
Restore the trunk that existed before the windows changes were committed to the (now moved to branches) old trunk.
1 jgs 82
2 ksteube 1312 /* $Id$ */
3 jgs 82
4 ksteube 1312 /*******************************************************
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 jgs 82
16     /**************************************************************/
17    
18 ksteube 1312 /* assemblage routines: copies node coordinates into an expanded Data Object */
19 jgs 82
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 jgs 150 char error_msg[LenErrorMsg_MAX];
32 jgs 123 dim_t n;
33 ksteube 1312 size_t dim_size;
34 jgs 150 Finley_resetError();
35 jgs 82 if (nodes==NULL) return;
36     if (! numSamplesEqual(x,1,nodes->numNodes)) {
37 gross 584 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: illegal number of samples of Data object");
38 jgs 82 } else if (getFunctionSpaceType(x)!=FINLEY_NODES) {
39 gross 584 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: Data object is not defined on nodes.");
40 jgs 82 } else if (! isExpanded(x)) {
41 gross 584 Finley_setError(TYPE_ERROR,"Finley_Assemble_NodeCoordinates: expanded Data object expected");
42 jgs 82 } else if (! isDataPointShapeEqual(x,1, &(nodes->numDim))) {
43 gross 584 sprintf(error_msg,"Finley_Assemble_NodeCoordinates: Data object of shape (%d,) expected",nodes->numDim);
44 jgs 150 Finley_setError(TYPE_ERROR,error_msg);
45 jgs 82 } else {
46 ksteube 1312 dim_size=nodes->numDim*sizeof(double);
47 jgs 82 #pragma omp parallel for private(n)
48     for (n=0;n<nodes->numNodes;n++)
49 ksteube 1312 memcpy(getSampleDataFast(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