BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
double_quadrature_descriptor.hpp
1 // Copyright (C) 2011-2012 by the BEM++ Authors
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to deal
5 // in the Software without restriction, including without limitation the rights
6 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 // copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19 // THE SOFTWARE.
20 
21 #ifndef fiber_double_quadrature_descriptor_hpp
22 #define fiber_double_quadrature_descriptor_hpp
23 
24 #include "element_pair_topology.hpp"
25 
26 #include "../common/common.hpp"
27 
28 #include <boost/tuple/tuple_comparison.hpp>
29 #include <ostream>
30 
31 namespace Fiber
32 {
33 
37 {
42  int testOrder;
46 
47  bool operator<(const DoubleQuadratureDescriptor& other) const {
48  using boost::tuples::make_tuple;
49  return make_tuple(topology, testOrder, trialOrder) <
50  make_tuple(other.topology, other.testOrder, other.trialOrder);
51  }
52 
53  bool operator==(const DoubleQuadratureDescriptor& other) const {
54  return topology == other.topology &&
55  testOrder == other.testOrder &&
56  trialOrder == other.trialOrder;
57  }
58 
59  bool operator!=(const DoubleQuadratureDescriptor& other) const {
60  return !operator==(other);
61  }
62 
63  friend std::ostream&
64  operator<< (std::ostream& dest, const DoubleQuadratureDescriptor& obj)
65  {
66  dest << obj.topology << " " << obj.testOrder << " " << obj.trialOrder;
67  return dest;
68  }
69 };
70 
71 inline size_t tbb_hasher(const DoubleQuadratureDescriptor& d)
72 {
73  const ElementPairTopology& t = d.topology;
74  return (t.testVertexCount - 3) + 2 *
75  ((t.trialVertexCount - 3) + 2 *
76  (t.testSharedVertex0 + 4 *
77  (t.trialSharedVertex0 + 4 *
78  (t.testSharedVertex1 + 4 *
79  (t.trialSharedVertex1 + 4 *
80  (d.testOrder + 256 *
81  d.trialOrder))))));
82 }
83 
84 } // namespace Fiber
85 
86 #endif
Configuration of a pair of elements.
Definition: element_pair_topology.hpp:35
ElementPairTopology topology
Element pair configuration.
Definition: double_quadrature_descriptor.hpp:39
Parameters of a quadrature rule used in the evaluation of integrals over pairs of elements...
Definition: double_quadrature_descriptor.hpp:36
int testOrder
Degree of accuracy of the quadrature rule used on the test element.
Definition: double_quadrature_descriptor.hpp:42
int trialOrder
Degree of accuracy of the quadrature rule used on the trial element.
Definition: double_quadrature_descriptor.hpp:45