20#ifndef LIBMESH_VECTOR_VALUE_H
21#define LIBMESH_VECTOR_VALUE_H
24#include "libmesh/type_vector.h"
25#include "libmesh/libmesh_device.h"
26#include "libmesh/compare_types.h"
28#ifdef LIBMESH_HAVE_METAPHYSICL
29#include "metaphysicl/raw_type.h"
30#include "metaphysicl/ct_types.h"
53 template <
typename T2>
77 template <
typename Scalar1,
typename Scalar2,
typename Scalar3>
80 const Scalar1>::type & x,
83 const Scalar2>::type & y = 0,
86 const Scalar3>::type & z = 0);
95 template <
typename Scalar>
99 const Scalar>::type * sfinae =
nullptr);
105 template <
typename T2>
111 template <
typename T2>
114#ifdef LIBMESH_USE_COMPLEX_NUMBERS
127 template <
typename Scalar>
128 LIBMESH_DEVICE_INLINE
129 typename std::enable_if<
133 { libmesh_assert_equal_to (p, Scalar(0)); this->
zero();
return *
this; }
170template <
typename Scalar1,
typename Scalar2,
typename Scalar3>
174 const Scalar1>::type & x,
177 const Scalar2>::type & y,
180 const Scalar3>::type & z) :
187template <
typename Scalar>
192 const Scalar>::type * ) :
198template <
typename T2>
208template <
typename T2>
215#ifdef LIBMESH_USE_COMPLEX_NUMBERS
233template <
typename T,
typename T2>
239template <
typename T,
typename T2>
245template <
typename T,
typename T2>
253#ifdef LIBMESH_HAVE_METAPHYSICL
264 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
265 ret(i) = raw_value(in(i));
271template <
typename T,
typename U>
272struct ReplaceAlgebraicType<
libMesh::VectorValue<T>, U>
This class defines a vector in LIBMESH_DIM dimensional space of type T.
LIBMESH_DEVICE_INLINE void zero()
Set all entries of the vector to 0.
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
VectorValue(const T &x, const T &y=0, const T &z=0)
Constructor-from-T.
VectorValue(typename std::enable_if< ScalarTraits< Scalar1 >::value, const Scalar1 >::type &x, typename std::enable_if< ScalarTraits< Scalar2 >::value, const Scalar2 >::type &y=0, typename std::enable_if< ScalarTraits< Scalar3 >::value, const Scalar3 >::type &z=0)
Constructor-from-scalars.
VectorValue()
Empty constructor.
VectorValue(const Scalar &x, typename std::enable_if< ScalarTraits< Scalar >::value, const Scalar >::type *sfinae=nullptr)
Constructor-from-scalar.
VectorValue(const TypeVector< T2 > &p)
Copy-constructor.
VectorValue(const TypeVector< Real > &p_re, const TypeVector< Real > &p_im)
Constructor that takes two TypeVector<Real> representing the real and imaginary part as arguments.
LIBMESH_DEVICE_INLINE std::enable_if< ScalarTraits< Scalar >::value, VectorValue & >::type operator=(const Scalar &libmesh_dbg_var(p))
Assignment-from-scalar operator.
VectorValue(const VectorValue< T2 > &p)
Copy-constructor.
The libMesh namespace provides an interface to certain functionality in the library.
std::complex< Real > Complex
NumberVectorValue Gradient
VectorValue< Real > RealVectorValue
Useful typedefs to allow transparent switching between Real and Complex data types.
RealVectorValue RealGradient
VectorValue< Number > NumberVectorValue
VectorValue< typename CompareTypes< T, T2 >::supertype > supertype
VectorValue< typename CompareTypes< T, T2 >::supertype > supertype
VectorValue< typename CompareTypes< T, T2 >::supertype > supertype
VectorValue< T > supertype