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

Contents of /trunk/finley/src/NodeFile_setTags.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1811 - (show annotations)
Thu Sep 25 23:11:13 2008 UTC (10 years, 9 months ago) by ksteube
File MIME type: text/plain
File size: 1636 byte(s)
Copyright updated in all files

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

  ViewVC Help
Powered by ViewVC 1.1.26