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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1781 - (hide annotations)
Thu Sep 11 05:03:14 2008 UTC (10 years, 8 months ago) by jfenwick
File MIME type: text/plain
File size: 1671 byte(s)
Branch commit

Merged changes from trunk version 1695 up to and including version 1779.


1 gross 767
2 ksteube 1312 /* $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 gross 767 /**************************************************************/
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 gross 1028 dim_t numNodes;
33 gross 767 register double *mask_array;
34     Finley_resetError();
35    
36 gross 1028 if (self==NULL) return;
37     numNodes=self->numNodes;
38 gross 767 if (1!=getDataPointSize(mask)) {
39     Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: number of components of mask is 1.");
40     } else if (!numSamplesEqual(mask,1,numNodes)) {
41     Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: illegal number of samples of mask Data object");
42     }
43    
44     /* now we can start */
45    
46     if (Finley_noError()) {
47 jfenwick 1781 #pragma omp parallel for private(n,mask_array) schedule(static)
48     for (n=0;n<numNodes;n++) {
49 gross 767 mask_array=getSampleData(mask,n);
50     if (mask_array[0]>0) self->Tag[n]=newTag;
51 jfenwick 1781 }
52     Finley_NodeFile_setTagsInUse(self);
53 gross 767 }
54     }
55     /*
56     * $Log$
57     *
58     */

  ViewVC Help
Powered by ViewVC 1.1.26