20 #ifndef LIBMESH_VECTOR_VALUE_H
21 #define LIBMESH_VECTOR_VALUE_H
24 #include "libmesh/type_vector.h"
25 #include "libmesh/compare_types.h"
27 #ifdef LIBMESH_HAVE_METAPHYSICL
28 #include "metaphysicl/raw_type.h"
29 #include "metaphysicl/ct_types.h"
46 class VectorValue :
public TypeVector<T>
51 template <
typename T2>
82 template <
typename Scalar1,
typename Scalar2,
typename Scalar3>
84 boostcopy::enable_if_c<ScalarTraits<Scalar1>::value,
85 const Scalar1>::type & x,
87 boostcopy::enable_if_c<ScalarTraits<Scalar2>::value,
88 const Scalar2>::type & y = 0,
90 boostcopy::enable_if_c<ScalarTraits<Scalar3>::value,
91 const Scalar3>::type & z = 0);
99 template <
typename Scalar>
102 boostcopy::enable_if_c<ScalarTraits<Scalar>::value,
103 const Scalar>::type * sfinae =
nullptr);
110 template <
typename T2>
118 template <
typename T2>
121 #ifdef LIBMESH_USE_COMPLEX_NUMBERS
137 template <
typename Scalar>
138 typename boostcopy::enable_if_c<
139 ScalarTraits<Scalar>::value,
142 { libmesh_assert_equal_to (p, Scalar(0)); this->
zero();
return *
this; }
158 template <
typename T>
166 template <
typename T>
177 template <
typename T>
178 template <
typename Scalar1,
typename Scalar2,
typename Scalar3>
181 boostcopy::enable_if_c<ScalarTraits<Scalar1>::value,
182 const Scalar1>::type & x,
184 boostcopy::enable_if_c<ScalarTraits<Scalar2>::value,
185 const Scalar2>::type & y,
187 boostcopy::enable_if_c<ScalarTraits<Scalar3>::value,
188 const Scalar3>::type & z) :
194 template <
typename T>
195 template <
typename Scalar>
199 boostcopy::enable_if_c<ScalarTraits<Scalar>::value,
200 const Scalar>::type * ) :
205 template <
typename T>
206 template <
typename T2>
215 template <
typename T>
216 template <
typename T2>
223 #ifdef LIBMESH_USE_COMPLEX_NUMBERS
224 template <
typename T>
235 template <
typename T>
241 template <
typename T,
typename T2>
247 template <
typename T,
typename T2>
253 template <
typename T,
typename T2>
261 #ifdef LIBMESH_HAVE_METAPHYSICL
262 namespace MetaPhysicL
264 template <
typename T>
265 struct RawType<libMesh::VectorValue<T>>
272 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
273 ret(i) = raw_value(in(i));
279 template <
typename T,
typename U>
280 struct ReplaceAlgebraicType<libMesh::VectorValue<T>, U>
287 #endif // LIBMESH_VECTOR_VALUE_H
RealVectorValue RealGradient
VectorValue< typename CompareTypes< T, T2 >::supertype > supertype
VectorValue< Real > RealVectorValue
用于实现实数或复数数据类型之间的透明切换的有用typedef。
boostcopy::enable_if_c< ScalarTraits< Scalar >::value, VectorValue & >::type operator=(const Scalar &p)
赋值运算符,用于将向量置为零。
此类定义了LIBMESH_DIM维的实数或复数空间中的向量。
VectorValue< T > supertype
NumberVectorValue Gradient
VectorValue< typename CompareTypes< T, T2 >::supertype > supertype
该类定义了一个在 LIBMESH_DIM 维度空间中类型为 T 的向量。
VectorValue< typename CompareTypes< T, T2 >::supertype > supertype
std::complex< Real > Complex
VectorValue< Number > NumberVectorValue