/[escript]/branches/arrayview_from_1695_trunk/finley/src/NodeFile_setTags.c
ViewVC logotype

Contents of /branches/arrayview_from_1695_trunk/finley/src/NodeFile_setTags.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1312 - (show annotations)
Mon Sep 24 06:18:44 2007 UTC (11 years, 8 months ago) by ksteube
Original Path: trunk/finley/src/NodeFile_setTags.c
File MIME type: text/plain
File size: 1659 byte(s)
The MPI branch is hereby closed. All future work should be in trunk.

Previously in revision 1295 I merged the latest changes to trunk into trunk-mpi-branch.
In this revision I copied all files from trunk-mpi-branch over the corresponding
trunk files. I did not use 'svn merge', it was a copy.

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 /* Finley: Mesh: NodeFile */
19
20 /* set tags to newTag where mask>0 */
21
22 /**************************************************************/
23
24 #include "NodeFile.h"
25 #include "Util.h"
26
27 /**************************************************************/
28
29
30 void Finley_NodeFile_setTags(Finley_NodeFile* self,const int newTag, escriptDataC* mask) {
31 register dim_t n;
32 dim_t numNodes;
33 register double *mask_array;
34 register bool_t check;
35 Finley_resetError();
36
37 if (self==NULL) return;
38 numNodes=self->numNodes;
39 if (1!=getDataPointSize(mask)) {
40 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: number of components of mask is 1.");
41 } else if (!numSamplesEqual(mask,1,numNodes)) {
42 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: illegal number of samples of mask Data object");
43 }
44
45 /* now we can start */
46
47 if (Finley_noError()) {
48 #pragma omp parallel for private(n,check,mask_array) schedule(static)
49 for (n=0;n<numNodes;n++) {
50 mask_array=getSampleData(mask,n);
51 if (mask_array[0]>0) self->Tag[n]=newTag;
52 }
53 }
54 }
55 /*
56 * $Log$
57 *
58 */

  ViewVC Help
Powered by ViewVC 1.1.26