BEM++  2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ahmed_aux_fwd.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 
22 #ifndef bempp_ahmed_aux_fwd_hpp
23 #define bempp_ahmed_aux_fwd_hpp
24 
25 #include "../common/common.hpp"
26 
27 #include "bempp/common/config_ahmed.hpp"
28 
30 template <class T1, class T2> class bbxbemblcluster;
31 template <class T> class mblock;
32 class blcluster;
35 namespace std
36 {
37 
39 template <typename _Tp> class complex;
42 } // namespace std
43 
44 #ifdef AHMED_USES_STD_COMPLEX
45 typedef std::complex<float> scomp;
46 typedef std::complex<double> dcomp;
47 #else
48 template <typename T> class comp;
49 typedef comp<float> scomp;
50 typedef comp<double> dcomp;
51 #endif
52 
53 namespace Bempp
54 {
55 
57 template <typename CoordinateType> struct AhmedDofWrapper;
58 template <typename T> class ExtendedBemCluster;
61 // Casts.
62 
63 // If Ahmed is compiled with STD_CMPLX undefined, it uses a
64 // nonstandard complex type. To all probability, its binary
65 // representation is the same as that of the complex type provided by
66 // STL.
67 
68 template <typename T>
70 {
71  typedef T Type;
72 };
73 
74 template <>
75 struct AhmedTypeTraits<std::complex<float> >
76 {
77  typedef scomp Type;
78 };
79 
80 template <>
81 struct AhmedTypeTraits<std::complex<double> >
82 {
83  typedef dcomp Type;
84 };
85 
86 template <typename T>
87 inline typename AhmedTypeTraits<T>::Type* ahmedCast(T* x) {
88 #ifdef AHMED_USES_STD_COMPLEX
89  return x;
90 #else
91  return reinterpret_cast<typename AhmedTypeTraits<T>::Type*>(x);
92 #endif
93 }
94 
95 float ahmedCast(float x);
96 double ahmedCast(double x);
97 scomp ahmedCast(std::complex<float> x);
98 dcomp ahmedCast(std::complex<double> x);
99 
100 } // namespace Bempp
101 
102 #endif
Definition: ahmed_aux_fwd.hpp:69