/[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 767 - (show annotations)
Fri Jun 30 07:29:08 2006 UTC (13 years, 3 months ago) by gross
File MIME type: text/plain
File size: 1895 byte(s)
new FunctionSpace method setTags added
1 /*
2 ************************************************************
3 * Copyright 2006 by ACcESS MNRF *
4 * *
5 * http://www.access.edu.au *
6 * Primary Business: Queensland, Australia *
7 * Licensed under the Open Software License version 3.0 *
8 * http://www.opensource.org/licenses/osl-3.0.php *
9 * *
10 ************************************************************
11 */
12
13 /**************************************************************/
14
15 /* Finley: Mesh: NodeFile */
16
17 /* set tags to newTag where mask>0 */
18
19 /**************************************************************/
20
21 /* Author: gross@access.edu.au */
22 /* Version: $Id$ */
23
24 /**************************************************************/
25
26 #include "NodeFile.h"
27 #include "Util.h"
28
29 /**************************************************************/
30
31
32 void Finley_NodeFile_setTags(Finley_NodeFile* self,const int newTag, escriptDataC* mask) {
33 if (self==NULL) return;
34 register dim_t n;
35 dim_t numNodes=self->numNodes;
36 register double *mask_array;
37 register bool_t check;
38 Finley_resetError();
39
40 if (1!=getDataPointSize(mask)) {
41 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: number of components of mask is 1.");
42 } else if (!numSamplesEqual(mask,1,numNodes)) {
43 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: illegal number of samples of mask Data object");
44 }
45
46 /* now we can start */
47
48 if (Finley_noError()) {
49 #pragma omp parallel for private(n,check,mask_array) schedule(static)
50 for (n=0;n<numNodes;n++) {
51 mask_array=getSampleData(mask,n);
52 if (mask_array[0]>0) self->Tag[n]=newTag;
53 }
54 }
55 }
56 /*
57 * $Log$
58 *
59 */

  ViewVC Help
Powered by ViewVC 1.1.26