/[escript]/trunk/dudley/src/ElementFile_setTags.cpp
ViewVC logotype

Annotation of /trunk/dudley/src/ElementFile_setTags.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3206 - (hide annotations)
Fri Sep 24 03:20:22 2010 UTC (9 years ago) by jfenwick
Original Path: branches/domexper/dudley/src/ElementFile_setTags.c
File MIME type: text/plain
File size: 2229 byte(s)
Remove references to reducedShapeFunction

1 gross 767
2 ksteube 1312 /*******************************************************
3 ksteube 1811 *
4 jfenwick 2881 * Copyright (c) 2003-2010 by University of Queensland
5 ksteube 1811 * 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 ksteube 1312
14 ksteube 1811
15 gross 767 /**************************************************************/
16    
17 jfenwick 3086 /* Dudley: Mesh: ElementFile */
18 gross 767
19 gross 2748 /* set tags to newTag where mask>0 */
20 gross 767
21     /**************************************************************/
22    
23     #include "ElementFile.h"
24     #include "Util.h"
25 gross 1062 #include "Assemble.h"
26 gross 767
27     /**************************************************************/
28    
29    
30 jfenwick 3086 void Dudley_ElementFile_setTags(Dudley_ElementFile* self,const int newTag, escriptDataC* mask) {
31 gross 2748 register dim_t n,q;
32     dim_t numElements, numQuad;
33     register __const double *mask_array;
34     register bool_t check;
35 jfenwick 3086 Dudley_resetError();
36 gross 2748 if (self==NULL) return;
37     numElements=self->numElements;
38 gross 767
39 jfenwick 3206 numQuad=Dudley_Assemble_reducedIntegrationOrder(mask)?1:(self->numDim+1);
40     //Dudley_ReferenceElementSet_borrowReferenceElement(self->referenceElementSet,Dudley_Assemble_reducedIntegrationOrder(mask))->BasisFunctions->numQuadNodes;
41 gross 2748
42     if (1!=getDataPointSize(mask)) {
43 jfenwick 3086 Dudley_setError(TYPE_ERROR,"Dudley_ElementFile_setTags: number of components of mask is 1.");
44 gross 2748 } else if (!numSamplesEqual(mask,numQuad,numElements)) {
45 jfenwick 3086 Dudley_setError(TYPE_ERROR,"Dudley_ElementFile_setTags: illegal number of samples of mask Data object");
46 gross 2748 }
47 gross 767
48 gross 2748 /* now we can start */
49 gross 767
50 jfenwick 3086 if (Dudley_noError()) {
51 gross 2748 if (isExpanded(mask)) {
52     #pragma omp parallel private(n,check,mask_array)
53     {
54     #pragma omp for schedule(static)
55     for (n=0;n<numElements;n++) {
56 jfenwick 2770 mask_array=getSampleDataRO(mask,n);
57 gross 2748 if (mask_array[0]>0) self->Tag[n]=newTag;
58     }
59     }
60     } else {
61     #pragma omp parallel private(q,n,check,mask_array)
62     {
63     #pragma omp for schedule(static)
64     for (n=0;n<numElements;n++) {
65 jfenwick 2770 mask_array=getSampleDataRO(mask,n);
66 gross 2748 check=FALSE;
67     for (q=0;q<numQuad;q++) check=check || mask_array[q];
68     if (check) self->Tag[n]=newTag;
69     }
70     }
71     }
72 jfenwick 3086 Dudley_ElementFile_setTagsInUse(self);
73 gross 2748 }
74 gross 767 }
75 gross 2748

  ViewVC Help
Powered by ViewVC 1.1.26