/[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 1028 - (show annotations)
Wed Mar 14 00:15:24 2007 UTC (12 years, 2 months ago) by gross
Original Path: trunk/finley/src/NodeFile_setTags.c
File MIME type: text/plain
File size: 1909 byte(s)
modifications to be compliant with _WIN32. The substitutes for asinh, acosh, atanh are still missing (erf will through an exception)
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 register dim_t n;
34 dim_t numNodes;
35 register double *mask_array;
36 register bool_t check;
37 Finley_resetError();
38
39 if (self==NULL) return;
40 numNodes=self->numNodes;
41 if (1!=getDataPointSize(mask)) {
42 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: number of components of mask is 1.");
43 } else if (!numSamplesEqual(mask,1,numNodes)) {
44 Finley_setError(TYPE_ERROR,"Finley_NodeFile_setTags: illegal number of samples of mask Data object");
45 }
46
47 /* now we can start */
48
49 if (Finley_noError()) {
50 #pragma omp parallel for private(n,check,mask_array) schedule(static)
51 for (n=0;n<numNodes;n++) {
52 mask_array=getSampleData(mask,n);
53 if (mask_array[0]>0) self->Tag[n]=newTag;
54 }
55 }
56 }
57 /*
58 * $Log$
59 *
60 */

  ViewVC Help
Powered by ViewVC 1.1.26