$extrastylesheet
libMesh::TypeNTensor< N, T > Class Template Reference

#include <type_n_tensor.h>

List of all members.

Public Member Functions

 TypeNTensor ()
 TypeNTensor (const T &)
 TypeNTensor (const TypeVector< T > &)
 TypeNTensor (const TypeTensor< T > &)
 operator TypeVector< T > () const
 operator VectorValue< T > () const
 operator TypeTensor< T > () const
 operator TensorValue< T > () const
 ~TypeNTensor ()
const TypeNTensor< N-1, T > slice (const unsigned int) const
TypeNTensor< N-1, T > slice (const unsigned int)
template<typename T2 >
TypeNTensor< N, typename
CompareTypes< T, T2 >
::supertype > 
operator+ (const TypeNTensor< N, T2 > &) const
template<typename T2 >
const TypeNTensor< N, T > & operator+= (const TypeNTensor< N, T2 > &)
template<typename T2 >
TypeNTensor< N, typename
CompareTypes< T, T2 >
::supertype > 
operator- (const TypeNTensor< N, T2 > &) const
template<typename T2 >
const TypeNTensor< N, T > & operator-= (const TypeNTensor< N, T2 > &)
TypeNTensor< N, T > operator- () const
template<typename Scalar >
boostcopy::enable_if_c
< ScalarTraits< Scalar >
::value, TypeNTensor< N,
typename CompareTypes< T,
Scalar >::supertype > >::type 
operator* (const Scalar) const
template<typename Scalar >
const TypeNTensor< N, T > & operator*= (const Scalar)
template<typename Scalar >
boostcopy::enable_if_c
< ScalarTraits< Scalar >
::value, TypeNTensor< N,
typename CompareTypes< T,
Scalar >::supertype > >::type 
operator/ (const Scalar) const
const TypeNTensor< N, T > & operator/= (const T)
template<typename T2 >
CompareTypes< T, T2 >::supertype contract (const TypeNTensor< N, T2 > &) const
Real size_sq () const
bool operator== (const TypeNTensor< N, T > &) const
bool operator< (const TypeNTensor< N, T > &) const
bool operator> (const TypeNTensor< N, T > &) const
void print (std::ostream &) const

Friends

std::ostream & operator<< (std::ostream &os, const TypeNTensor< N, T > &t)

Detailed Description

template<unsigned int N, typename T>
class libMesh::TypeNTensor< N, T >

This class will eventually define a rank-N tensor in LIBMESH_DIM dimensional space of type T. Right now it defines a shim to allow for rank-independent code to compile (but not give correct results) in the case of vector-valued elements and second derivatives.

Author:
Roy Stogner, 2012.

Definition at line 46 of file type_n_tensor.h.


Constructor & Destructor Documentation

template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::TypeNTensor ( ) [inline]

Definition at line 49 of file type_n_tensor.h.

{}
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::TypeNTensor ( const T &  ) [inline]

Definition at line 51 of file type_n_tensor.h.

{}
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::TypeNTensor ( const TypeVector< T > &  ) [inline]

Definition at line 53 of file type_n_tensor.h.

{}
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::TypeNTensor ( const TypeTensor< T > &  ) [inline]

Definition at line 55 of file type_n_tensor.h.

{}
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::~TypeNTensor ( ) [inline]

Destructor.

Definition at line 66 of file type_n_tensor.h.

{}

Member Function Documentation

template<unsigned int N, typename T>
template<typename T2 >
CompareTypes<T,T2>::supertype libMesh::TypeNTensor< N, T >::contract ( const TypeNTensor< N, T2 > &  ) const [inline]

Multiply 2 tensors together, i.e. dyadic product sum_ij Aij*Bij. The tensors may be of different types.

Definition at line 153 of file type_n_tensor.h.

Referenced by libMesh::TensorTools::inner_product().

{ return 0; }
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::operator TensorValue< T > ( ) const [inline]

Definition at line 61 of file type_n_tensor.h.

{ libmesh_not_implemented(); return 0; }
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::operator TypeTensor< T > ( ) const [inline]

Definition at line 60 of file type_n_tensor.h.

{ libmesh_not_implemented(); return 0; }
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::operator TypeVector< T > ( ) const [inline]

Definition at line 57 of file type_n_tensor.h.

{ libmesh_not_implemented(); return 0; }
template<unsigned int N, typename T>
libMesh::TypeNTensor< N, T >::operator VectorValue< T > ( ) const [inline]

Definition at line 58 of file type_n_tensor.h.

{ libmesh_not_implemented(); return 0; }
template<unsigned int N, typename T>
template<typename Scalar >
boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeNTensor<N,typename CompareTypes<T, Scalar>::supertype> >::type libMesh::TypeNTensor< N, T >::operator* ( const Scalar  ) const [inline]

Multiply a tensor by a number, i.e. scale.

Definition at line 123 of file type_n_tensor.h.

  { return TypeNTensor<N,typename CompareTypes<T, Scalar>::supertype>(); }
template<unsigned int N, typename T>
template<typename Scalar >
const TypeNTensor<N,T>& libMesh::TypeNTensor< N, T >::operator*= ( const Scalar  ) [inline]

Multiply this tensor by a number, i.e. scale.

Definition at line 130 of file type_n_tensor.h.

{ return *this; }
template<unsigned int N, typename T>
template<typename T2 >
TypeNTensor<N,typename CompareTypes<T, T2>::supertype> libMesh::TypeNTensor< N, T >::operator+ ( const TypeNTensor< N, T2 > &  ) const [inline]

Add two tensors.

Definition at line 85 of file type_n_tensor.h.

  { return TypeNTensor<N,typename CompareTypes<T,T2>::supertype>(); }
template<unsigned int N, typename T>
template<typename T2 >
const TypeNTensor<N,T>& libMesh::TypeNTensor< N, T >::operator+= ( const TypeNTensor< N, T2 > &  ) [inline]

Add to this tensor.

Definition at line 92 of file type_n_tensor.h.

  { return *this; }
template<unsigned int N, typename T>
template<typename T2 >
TypeNTensor<N,typename CompareTypes<T, T2>::supertype> libMesh::TypeNTensor< N, T >::operator- ( const TypeNTensor< N, T2 > &  ) const [inline]

Subtract two tensors.

Definition at line 100 of file type_n_tensor.h.

  { return TypeNTensor<N,typename CompareTypes<T,T2>::supertype>(); }
template<unsigned int N, typename T>
TypeNTensor<N,T> libMesh::TypeNTensor< N, T >::operator- ( ) const [inline]

Return the opposite of a tensor

Definition at line 113 of file type_n_tensor.h.

  { return *this; }
template<unsigned int N, typename T>
template<typename T2 >
const TypeNTensor<N,T>& libMesh::TypeNTensor< N, T >::operator-= ( const TypeNTensor< N, T2 > &  ) [inline]

Subtract from this tensor.

Definition at line 107 of file type_n_tensor.h.

  { return *this; }
template<unsigned int N, typename T>
template<typename Scalar >
boostcopy::enable_if_c< ScalarTraits<Scalar>::value, TypeNTensor<N,typename CompareTypes<T, Scalar>::supertype> >::type libMesh::TypeNTensor< N, T >::operator/ ( const Scalar  ) const [inline]

Divide a tensor by a number, i.e. scale.

Definition at line 139 of file type_n_tensor.h.

{ return *this; }
template<unsigned int N, typename T>
const TypeNTensor<N,T>& libMesh::TypeNTensor< N, T >::operator/= ( const T  ) [inline]

Divide this tensor by a number, i.e. scale.

Definition at line 144 of file type_n_tensor.h.

{ return *this; }
template<unsigned int N, typename T>
bool libMesh::TypeNTensor< N, T >::operator< ( const TypeNTensor< N, T > &  ) const [inline]
Returns:
true if this tensor is "less" than another. Useful for sorting.

Definition at line 171 of file type_n_tensor.h.

  { return false; }
template<unsigned int N, typename T>
bool libMesh::TypeNTensor< N, T >::operator== ( const TypeNTensor< N, T > &  ) const [inline]
Returns:
true if two tensors are equal valued.

Definition at line 164 of file type_n_tensor.h.

  { return true; }
template<unsigned int N, typename T>
bool libMesh::TypeNTensor< N, T >::operator> ( const TypeNTensor< N, T > &  ) const [inline]
Returns:
true if this tensor is "greater" than another.

Definition at line 178 of file type_n_tensor.h.

  { return false; }
template<unsigned int N, typename T>
void libMesh::TypeNTensor< N, T >::print ( std::ostream &  ) const [inline]

Formatted print, by default to libMesh::out.

Definition at line 184 of file type_n_tensor.h.

{}
template<unsigned int N, typename T>
Real libMesh::TypeNTensor< N, T >::size_sq ( ) const [inline]

Returns the Frobenius norm of the tensor squared, i.e. sum of the element magnitudes squared.

Definition at line 159 of file type_n_tensor.h.

{ return 0.;}
template<unsigned int N, typename T>
const TypeNTensor<N-1,T> libMesh::TypeNTensor< N, T >::slice ( const unsigned  int) const [inline]

Return a proxy for the $ i^{th} $ slice of the tensor.

Definition at line 71 of file type_n_tensor.h.

  { return TypeNTensor<N-1,T>(); }
template<unsigned int N, typename T>
TypeNTensor<N-1,T> libMesh::TypeNTensor< N, T >::slice ( const unsigned  int) [inline]

Return a writeable proxy for the $ i^{th} $ slice of the tensor.

Definition at line 77 of file type_n_tensor.h.

  { return TypeNTensor<N-1,T>(); }

Friends And Related Function Documentation

template<unsigned int N, typename T>
std::ostream& operator<< ( std::ostream &  os,
const TypeNTensor< N, T > &  t 
) [friend]

Formatted print as above but allows you to do std::cout << t << std::endl;

Definition at line 190 of file type_n_tensor.h.

  {
    t.print(os);
    return os;
  }

The documentation for this class was generated from the following file: