/[escript]/branches/domexper/dudley/src/NodeFile_setTags.c
ViewVC logotype

Contents of /branches/domexper/dudley/src/NodeFile_setTags.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3086 - (show annotations)
Thu Aug 5 05:07:58 2010 UTC (9 years, 5 months ago) by jfenwick
File MIME type: text/plain
File size: 1675 byte(s)
Another pass at removing finley

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2010 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
14
15 /**************************************************************/
16
17 /* Dudley: Mesh: NodeFile */
18
19 /* set tags to newTag where mask>0 */
20
21 /**************************************************************/
22
23 #include "NodeFile.h"
24 #include "Util.h"
25
26 /**************************************************************/
27
28
29 void Dudley_NodeFile_setTags(Dudley_NodeFile* self,const int newTag, escriptDataC* mask) {
30 register dim_t n;
31 dim_t numNodes;
32 register __const double *mask_array;
33 Dudley_resetError();
34
35 if (self==NULL) return;
36 numNodes=self->numNodes;
37 if (1!=getDataPointSize(mask)) {
38 Dudley_setError(TYPE_ERROR,"Dudley_NodeFile_setTags: number of components of mask is 1.");
39 } else if (!numSamplesEqual(mask,1,numNodes)) {
40 Dudley_setError(TYPE_ERROR,"Dudley_NodeFile_setTags: illegal number of samples of mask Data object");
41 }
42
43 /* now we can start */
44
45 if (Dudley_noError()) {
46 #pragma omp parallel private(n,mask_array)
47 {
48 #pragma omp for schedule(static)
49 for (n=0;n<numNodes;n++) {
50 mask_array=getSampleDataRO(mask,n);
51 if (mask_array[0]>0) self->Tag[n]=newTag;
52 }
53 }
54 Dudley_NodeFile_setTagsInUse(self);
55 }
56 }
57 /*
58 * $Log$
59 *
60 */

  ViewVC Help
Powered by ViewVC 1.1.26