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>
33 namespace rheolef {
namespace details {
36 template <
class T1,
class T2>
struct is_equal : std::false_type {};
37 template <
class T>
struct is_equal<
T,
T> : std::true_type {};
40 template<
class T>
struct is_scalar : std::false_type {};
41 template<>
struct is_scalar<int> : std::true_type {};
42 template<>
struct is_scalar<const int> : std::true_type {};
43 template<>
struct is_scalar<size_t> : std::true_type {};
44 template<>
struct is_scalar<double> : std::true_type {};
45 #ifdef _RHEOLEF_HAVE_FLOAT128
46 template<>
struct is_scalar<float128> : std::true_type {};
49 template<
class T>
struct is_point : std::false_type {};
52 template<
class T>
struct is_tensor : std::false_type {};
55 template<
class T>
struct is_tensor3 : std::false_type {};
58 template<
class T>
struct is_tensor4 : std::false_type {};
66 template <
class T1,
class T2,
class Sfinae =
void>
68 template <
class T1,
class T2,
class Sfinae =
void>
71 #define _RHEOLEF_field_promote_argument(tensor) \
72 template<class T1, class T2> \
73 struct field_promote_first_argument<tensor##_basic<T1>, T2, \
74 typename std::enable_if< \
75 is_rheolef_arithmetic<T1>::value \
76 && is_rheolef_arithmetic<T2>::value \
79 using type = tensor##_basic<typename promote<T1,T2>::type>; }; \
80 template <class T1, class T2> \
81 struct field_promote_first_argument<T1,tensor##_basic<T2>, \
82 typename std::enable_if< \
83 is_rheolef_arithmetic<T1>::value \
84 && is_rheolef_arithmetic<T2>::value \
87 using type = typename promote<T1,T2>::type; }; \
88 template <class T1, class T2> \
89 struct field_promote_second_argument<tensor##_basic<T1>, T2, \
90 typename std::enable_if< \
91 is_rheolef_arithmetic<T1>::value \
92 && is_rheolef_arithmetic<T2>::value \
95 using type = typename promote<T1,T2>::type; }; \
96 template <class T1, class T2> \
97 struct field_promote_second_argument<T1,tensor##_basic<T2>, \
98 typename std::enable_if< \
99 is_rheolef_arithmetic<T1>::value \
100 && is_rheolef_arithmetic<T2>::value \
103 using type = tensor##_basic<typename promote<T1,T2>::type>; };
109 #undef _RHEOLEF_field_promote_argument
115 namespace space_constant {
153 const std::string& valued,
212 std::pair<size_type,size_type>
224 std::pair<size_type,size_type>
257 std::pair<std::pair<size_type,size_type>, std::pair<size_type,size_type> >
269 std::pair<std::pair<size_type,size_type>, std::pair<size_type,size_type> >
294 template<
class T1,
class T2>
303 ,is_point<typename F::result_type>
309 template<
class E>
struct is_expr : std::false_type {};
340 template<
class T,
class R>
344 template<
class T,
class R>
348 template<
class Constant>
352 #ifdef _RHEOLEF_HAVE_FLOAT128
357 template <
class Value>
360 is_rheolef_arithmetic<Value>
field::size_type size_type
see the Float page for the full documentation
see the point page for the full documentation
tensor3_basic< Float > tensor3
tensor_basic< Float > tensor
tensor4_basic< Float > tensor4
see the tensor3 page for the full documentation
see the tensor4 page for the full documentation
see the tensor page for the full documentation
void check_coord_sys_and_dimension(coordinate_type i, size_type d)
coordinate_type coordinate_system(std::string sys_coord)
std::string coordinate_system_name(coordinate_type i)
valued_type multiplies_result_tag(space_constant::valued_type tag1, space_constant::valued_type tag2)
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 tensor_subscript_name(valued_type valued_tag, 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)
valued_type divides_result_tag(space_constant::valued_type tag1, space_constant::valued_type tag2)
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)
std::string tensor4_subscript_name(valued_type valued, coordinate_type sys_coord, size_type i_comp)
const std::string & valued_name(valued_type valued_tag)
valued_type valued_tag(const std::string &name)
size_type n_component(valued_type valued_tag, size_type d, coordinate_type sys_coord)
std::pair< size_type, size_type > tensor_subscript(valued_type valued_tag, coordinate_type sys_coord, size_type i_comp)
T contract_product(const T &a, const T &b)
This file is part of Rheolef.
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
T ddot(const tensor_basic< T > &a, const tensor_basic< T > &b)
ddot(x,y): see the expression page for the full documentation
#define _RHEOLEF_field_promote_argument(tensor)
T2 operator()(const T1 &x) const
function_traits< F >::result_type type
undeterminated_basic< typename scalar_traits< T >::type > type
undeterminated_basic< typename scalar_traits< T >::type > type
point_basic< typename scalar_traits< T >::type > type
static const valued_type value
undeterminated_basic< T > type
undeterminated_basic< T > type
helper for generic field value_type: T, point_basic<T> or tensor_basic<T>