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"
52 template <
typename T2>
76 template <
typename Scalar1,
typename Scalar2,
typename Scalar3>
79 const Scalar1>::type & x,
82 const Scalar2>::type & y = 0,
85 const Scalar3>::type & z = 0);
94 template <
typename Scalar>
98 const Scalar>::type * sfinae =
nullptr);
104 template <
typename T2>
110 template <
typename T2>
113#ifdef LIBMESH_USE_COMPLEX_NUMBERS
126 template <
typename Scalar>
127 typename std::enable_if<
131 { libmesh_assert_equal_to (p, Scalar(0)); this->
zero();
return *
this; }
168template <
typename Scalar1,
typename Scalar2,
typename Scalar3>
172 const Scalar1>::type & x,
175 const Scalar2>::type & y,
178 const Scalar3>::type & z) :
185template <
typename Scalar>
190 const Scalar>::type * ) :
196template <
typename T2>
206template <
typename T2>
213#ifdef LIBMESH_USE_COMPLEX_NUMBERS
231template <
typename T,
typename T2>
237template <
typename T,
typename T2>
243template <
typename T,
typename T2>
251#ifdef LIBMESH_HAVE_METAPHYSICL
262 for (
unsigned int i = 0; i < LIBMESH_DIM; ++i)
263 ret(i) = raw_value(in(i));
269template <
typename T,
typename U>
270struct ReplaceAlgebraicType<
libMesh::VectorValue<T>, U>
This class defines a vector in LIBMESH_DIM dimensional space of type T.
void zero()
Set all entries of the vector to 0.
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
VectorValue()
Empty constructor.
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(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.
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.
VectorValue(const T &x, const T &y=0, const T &z=0)
Constructor-from-T.
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