libMesh::TensorTools Namespace Reference

## Classes

struct  DecrementRank

struct  DecrementRank< TensorValue< T > >

struct  DecrementRank< TypeNTensor< N, T > >

struct  DecrementRank< TypeTensor< T > >

struct  DecrementRank< TypeVector< T > >

struct  DecrementRank< VectorValue< T > >

struct  IncrementRank

struct  IncrementRank< TensorValue< T > >

struct  IncrementRank< TypeNTensor< N, T > >

struct  IncrementRank< TypeTensor< T > >

struct  IncrementRank< TypeVector< T > >

struct  IncrementRank< VectorValue< T > >

struct  MakeNumber

struct  MakeNumber< std::complex< T > >

struct  MakeNumber< TensorValue< T > >

struct  MakeNumber< TypeNTensor< N, T > >

struct  MakeNumber< TypeTensor< T > >

struct  MakeNumber< TypeVector< T > >

struct  MakeNumber< VectorValue< T > >

struct  MakeReal

struct  MakeReal< std::complex< T > >

struct  MakeReal< TensorValue< T > >

struct  MakeReal< TypeNTensor< N, T > >

struct  MakeReal< TypeTensor< T > >

struct  MakeReal< TypeVector< T > >

struct  MakeReal< VectorValue< T > >

## Functions

Number curl_from_grad (const VectorValue< Number > &)

Computes the curl of a vector given the gradient of that vector. More...

TensorValue< Numbercurl_from_grad (const TypeNTensor< 3, Number > &)

Dummy. Divergence of a scalar not defined, but is needed for ExactSolution to compile. More...

Computes the divergence of a vector given the gradient of that vector. More...

VectorValue< Numberdiv_from_grad (const TypeNTensor< 3, Number > &)

template<typename T , typename T2 >
boostcopy::enable_if_c< ScalarTraits< T >::value &&ScalarTraits< T2 >::value, typename CompareTypes< T, T2 >::supertype >::type inner_product (const T &a, const T2 &b)

template<typename T , typename T2 >
CompareTypes< T, T2 >::supertype inner_product (const TypeVector< T > &a, const TypeVector< T2 > &b)

template<typename T , typename T2 >
CompareTypes< T, T2 >::supertype inner_product (const TypeTensor< T > &a, const TypeTensor< T2 > &b)

template<unsigned int N, typename T , typename T2 >
CompareTypes< T, T2 >::supertype inner_product (const TypeNTensor< N, T > &a, const TypeNTensor< N, T2 > &b)

template<typename T >
norm_sq (T a)

template<typename T >
norm_sq (std::complex< T > a)

template<typename T >
Real norm_sq (const TypeVector< T > &a)

template<typename T >
Real norm_sq (const VectorValue< T > &a)

## Function Documentation

 Number libMesh::TensorTools::curl_from_grad ( const VectorValue< Number > & )

Definition at line 28 of file tensor_tools.C.

Referenced by libMesh::ExactSolution::_compute_error().

29 {
30  libmesh_error_msg("Operation not defined for scalar quantities.");
31 }

 VectorValue< Number > libMesh::TensorTools::curl_from_grad ( const TensorValue< Number > & grad )

Computes the curl of a vector given the gradient of that vector.

Definition at line 33 of file tensor_tools.C.

34 {
35  const Number duz_dy = grad(2,1);
36  const Number duy_dz = grad(1,2);
37  const Number dux_dz = grad(0,2);
38  const Number duz_dx = grad(2,0);
39  const Number duy_dx = grad(1,0);
40  const Number dux_dy = grad(0,1);
41
42  return VectorValue<Number>(duz_dy - duy_dz,
43  dux_dz - duz_dx,
44  duy_dx - dux_dy);
45 }

 TensorValue< Number > libMesh::TensorTools::curl_from_grad ( const TypeNTensor< 3, Number > & grad )

Place holder needed for ExactSolution to compile. Will compute the curl of a tensor given the gradient of that tensor.

Definition at line 48 of file tensor_tools.C.

49 {
50  libmesh_not_implemented();
51 }

 Number libMesh::TensorTools::div_from_grad ( const VectorValue< Number > & )

Dummy. Divergence of a scalar not defined, but is needed for ExactSolution to compile.

Definition at line 54 of file tensor_tools.C.

Referenced by libMesh::ExactSolution::_compute_error().

55 {
56  libmesh_error_msg("Operation not defined for scalar quantities.");
57 }

Computes the divergence of a vector given the gradient of that vector.

Definition at line 59 of file tensor_tools.C.

60 {
61  const Number dux_dx = grad(0,0);
62  const Number duy_dy = grad(1,1);
63  const Number duz_dz = grad(2,2);
64
65  return dux_dx + duy_dy + duz_dz;
66 }

 VectorValue< Number > libMesh::TensorTools::div_from_grad ( const TypeNTensor< 3, Number > & grad )

Place holder needed for ExactSolution to compile. Will compute the divergence of a tensor given the gradient of that tensor.

Definition at line 69 of file tensor_tools.C.

70 {
71  libmesh_not_implemented();
72 }

## ◆ inner_product() [1/4]

template<typename T , typename T2 >
 boostcopy::enable_if_c::value && ScalarTraits::value, typename CompareTypes::supertype>::type libMesh::TensorTools::inner_product ( const T & a, const T2 & b )
inline

Definition at line 47 of file tensor_tools.h.

48 { return a * b; }

## ◆ inner_product() [2/4]

template<typename T , typename T2 >
 CompareTypes::supertype libMesh::TensorTools::inner_product ( const TypeVector< T > & a, const TypeVector< T2 > & b )
inline

Definition at line 53 of file tensor_tools.h.

54 { return a * b; }

## ◆ inner_product() [3/4]

template<typename T , typename T2 >
 CompareTypes::supertype libMesh::TensorTools::inner_product ( const TypeTensor< T > & a, const TypeTensor< T2 > & b )
inline

Definition at line 59 of file tensor_tools.h.

References libMesh::TypeTensor< T >::contract().

60 { return a.contract(b); }

## ◆ inner_product() [4/4]

template<unsigned int N, typename T , typename T2 >
 CompareTypes::supertype libMesh::TensorTools::inner_product ( const TypeNTensor< N, T > & a, const TypeNTensor< N, T2 > & b )
inline

Definition at line 65 of file tensor_tools.h.

References libMesh::TypeNTensor< N, T >::contract().

66 { return a.contract(b); }

## ◆ norm_sq() [2/4]

template<typename T >
 T libMesh::TensorTools::norm_sq ( std::complex< T > a )
inline

Definition at line 74 of file tensor_tools.h.

74 { return std::norm(a); }

## ◆ norm_sq() [3/4]

template<typename T >
 Real libMesh::TensorTools::norm_sq ( const TypeVector< T > & a )
inline

Definition at line 78 of file tensor_tools.h.

References libMesh::TypeVector< T >::norm_sq().

79 {return a.norm_sq();}

## ◆ norm_sq() [4/4]

template<typename T >
 Real libMesh::TensorTools::norm_sq ( const VectorValue< T > & a )
inline

Definition at line 83 of file tensor_tools.h.

References libMesh::TypeVector< T >::norm_sq().

84 {return a.norm_sq();}