/[escript]/branches/trilinos_from_5897/dudley/src/ElementFile_setTags.cpp
ViewVC logotype

Contents of /branches/trilinos_from_5897/dudley/src/ElementFile_setTags.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6009 - (show annotations)
Wed Mar 2 04:13:26 2016 UTC (3 years, 1 month ago) by caltinay
File size: 2172 byte(s)
Much needed sync with trunk...

1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2016 by The University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development 2012-2013 by School of Earth Sciences
13 * Development from 2014 by Centre for Geoscience Computing (GeoComp)
14 *
15 *****************************************************************************/
16
17 /****************************************************************************/
18
19 /* Dudley: Mesh: ElementFile */
20
21 /* set tags to newTag where mask>0 */
22
23 /****************************************************************************/
24
25 #include "ElementFile.h"
26 #include "Assemble.h"
27 #include "Util.h"
28
29 namespace dudley {
30
31 void Dudley_ElementFile_setTags(Dudley_ElementFile* self, int newTag, const escript::Data* mask)
32 {
33 const dim_t numElements = self->numElements;
34 const int numQuad = dudley::Assemble_reducedIntegrationOrder(mask) ? 1 : (self->numDim + 1);
35
36 if (1 != mask->getDataPointSize()) {
37 throw DudleyException("Dudley_ElementFile_setTags: number of components of mask is 1.");
38 } else if (!mask->numSamplesEqual(numQuad, numElements)) {
39 throw DudleyException("Dudley_ElementFile_setTags: illegal number of samples of mask Data object");
40 }
41
42 if (mask->actsExpanded()) {
43 #pragma omp parallel for
44 for (index_t n = 0; n < numElements; n++) {
45 const double* mask_array = mask->getSampleDataRO(n);
46 if (mask_array[0] > 0)
47 self->Tag[n] = newTag;
48 }
49 } else {
50 #pragma omp parallel for
51 for (index_t n = 0; n < numElements; n++) {
52 const double* mask_array = mask->getSampleDataRO(n);
53 bool check = false;
54 for (int q = 0; q < numQuad; q++)
55 check = check || mask_array[q];
56 if (check)
57 self->Tag[n] = newTag;
58 }
59 }
60 Dudley_ElementFile_setTagsInUse(self);
61 }
62
63 } // namespace dudley
64

Properties

Name Value
svn:mergeinfo /branches/4.0fordebian/dudley/src/ElementFile_setTags.cpp:5567-5588 /branches/complex/dudley/src/ElementFile_setTags.cpp:5866-5937 /branches/lapack2681/finley/src/ElementFile_setTags.cpp:2682-2741 /branches/pasowrap/dudley/src/ElementFile_setTags.cpp:3661-3674 /branches/py3_attempt2/dudley/src/ElementFile_setTags.cpp:3871-3891 /branches/restext/finley/src/ElementFile_setTags.cpp:2610-2624 /branches/ripleygmg_from_3668/dudley/src/ElementFile_setTags.cpp:3669-3791 /branches/stage3.0/finley/src/ElementFile_setTags.cpp:2569-2590 /branches/symbolic_from_3470/dudley/src/ElementFile_setTags.cpp:3471-3974 /branches/symbolic_from_3470/ripley/test/python/dudley/src/ElementFile_setTags.cpp:3517-3974 /release/3.0/finley/src/ElementFile_setTags.cpp:2591-2601 /release/4.0/dudley/src/ElementFile_setTags.cpp:5380-5406 /trunk/dudley/src/ElementFile_setTags.cpp:4257-4344,5898-6007 /trunk/ripley/test/python/dudley/src/ElementFile_setTags.cpp:3480-3515

  ViewVC Help
Powered by ViewVC 1.1.26