an efficient C++ finite element environment
|
|
Go to the documentation of this file. 1 #ifndef _RHEOLEF_SPACE_CONSTANT_H
2 #define _RHEOLEF_SPACE_CONSTANT_H
25 #include "rheolef/undeterminated.h"
26 #include "rheolef/field_expr_utilities.h"
27 #include <type_traits>
38 template <
class T1,
class T2>
struct is_equal : std::false_type {};
39 template <
class T>
struct is_equal<
T,
T> : std::true_type {};
42 template<
class T>
struct is_scalar : std::false_type {};
43 template<>
struct is_scalar<int> : std::true_type {};
44 template<>
struct is_scalar<const int> : std::true_type {};
45 template<>
struct is_scalar<size_t> : std::true_type {};
46 template<>
struct is_scalar<double> : std::true_type {};
47 #ifdef _RHEOLEF_HAVE_FLOAT128
48 template<>
struct is_scalar<float128> : std::true_type {};
49 #endif // _RHEOLEF_HAVE_FLOAT128
51 template<
class T>
struct is_point : std::false_type {};
54 template<
class T>
struct is_tensor : std::false_type {};
57 template<
class T>
struct is_tensor3 : std::false_type {};
60 template<
class T>
struct is_tensor4 : std::false_type {};
68 template <
class T1,
class T2,
class Sfinae =
void>
70 template <
class T1,
class T2,
class Sfinae =
void>
73 #define _RHEOLEF_field_promote_argument(tensor) \
74 template<class T1, class T2> \
75 struct field_promote_first_argument<tensor##_basic<T1>, T2, \
76 typename std::enable_if< \
77 is_rheolef_arithmetic<T1>::value \
78 && is_rheolef_arithmetic<T2>::value \
81 using type = tensor##_basic<typename promote<T1,T2>::type>; }; \
82 template <class T1, class T2> \
83 struct field_promote_first_argument<T1,tensor##_basic<T2>, \
84 typename std::enable_if< \
85 is_rheolef_arithmetic<T1>::value \
86 && is_rheolef_arithmetic<T2>::value \
89 using type = typename promote<T1,T2>::type; }; \
90 template <class T1, class T2> \
91 struct field_promote_second_argument<tensor##_basic<T1>, T2, \
92 typename std::enable_if< \
93 is_rheolef_arithmetic<T1>::value \
94 && is_rheolef_arithmetic<T2>::value \
97 using type = typename promote<T1,T2>::type; }; \
98 template <class T1, class T2> \
99 struct field_promote_second_argument<T1,tensor##_basic<T2>, \
100 typename std::enable_if< \
101 is_rheolef_arithmetic<T1>::value \
102 && is_rheolef_arithmetic<T2>::value \
105 using type = tensor##_basic<typename promote<T1,T2>::type>; };
111 #undef _RHEOLEF_field_promote_argument
117 namespace space_constant {
155 const std::string& valued,
214 std::pair<size_type,size_type>
226 std::pair<size_type,size_type>
259 std::pair<std::pair<size_type,size_type>, std::pair<size_type,size_type> >
271 std::pair<std::pair<size_type,size_type>, std::pair<size_type,size_type> >
296 template<
class T1,
class T2>
305 ,is_point<typename F::result_type>
311 template<
class E>
struct is_expr : std::false_type {};
342 template<
class T,
class R>
346 template<
class T,
class R>
350 template<
class Constant>
354 #ifdef _RHEOLEF_HAVE_FLOAT128
356 #endif // _RHEOLEF_HAVE_FLOAT128
359 #endif // _RHEOLEF_SPACE_CONSTITUTION_H
see the tensor3 page for the full documentation
size_type tensor4_index(valued_type valued, coordinate_type sys_coord, size_type i, size_type j, size_type k, size_type l)
std::string coordinate_system_name(coordinate_type i)
function_traits< F >::result_type type
tensor3_basic< Float > tensor3
see the tensor page for the full documentation
undeterminated_basic< T > type
std::string tensor_subscript_name(valued_type valued_tag, coordinate_type sys_coord, size_type i_comp)
tensor4_basic< Float > tensor4
static const valued_type value
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
dot(x,y): see the expression page for the full documentation
size_type n_component(valued_type valued_tag, size_type d, coordinate_type sys_coord)
see the tensor4 page for the full documentation
std::pair< size_type, size_type > tensor_subscript(valued_type valued_tag, coordinate_type sys_coord, size_type i_comp)
valued_type valued_tag(const std::string &name)
helper for generic field value_type: T, point_basic<T> or tensor_basic<T>
undeterminated_basic< typename scalar_traits< T >::type > type
tensor_basic< Float > tensor
T contract_product(const T &a, const T &b)
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
ddot(x,y): see the expression page for the full documentation
std::pair< std::pair< size_type, size_type >, std::pair< size_type, size_type > > tensor4_subscript(valued_type valued, coordinate_type sys_coord, size_type i_comp)
size_type tensor_index(valued_type valued_tag, coordinate_type sys_coord, size_type i, size_type j)
point_basic< typename scalar_traits< T >::type > type
const std::string & valued_name(valued_type valued_tag)
This file is part of Rheolef.
valued_type multiplies_result_tag(space_constant::valued_type tag1, space_constant::valued_type tag2)
T2 operator()(const T1 &x) const
see the Float page for the full documentation
see the point page for the full documentation
valued_type divides_result_tag(space_constant::valued_type tag1, space_constant::valued_type tag2)
undeterminated_basic< typename scalar_traits< T >::type > type
field::size_type size_type
void check_coord_sys_and_dimension(coordinate_type i, size_type d)
#define _RHEOLEF_field_promote_argument(tensor)
coordinate_type coordinate_system(std::string sys_coord)
undeterminated_basic< T > type
std::string tensor4_subscript_name(valued_type valued, coordinate_type sys_coord, size_type i_comp)