libMesh
Classes | Functions
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  MakeBaseNumber
 
struct  MakeBaseNumber< T, typename std::enable_if< ScalarTraits< T >::value >::type >
 
struct  MakeBaseNumber< Wrapper< T >, typename std::enable_if< MathWrapperTraits< Wrapper< T > >::value >::type >
 
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 > >
 
struct  MathWrapperTraits
 This helper structure is used to determine whether a template class is one of our mathematical structures, like TypeVector, TypeTensor and their descendents. More...
 
struct  MathWrapperTraits< TensorValue< T > >
 
struct  MathWrapperTraits< TypeNTensor< N, T > >
 
struct  MathWrapperTraits< TypeTensor< T > >
 
struct  MathWrapperTraits< TypeVector< T > >
 
struct  MathWrapperTraits< VectorValue< T > >
 
struct  TensorTraits
 
struct  TensorTraits< T, typename std::enable_if< ScalarTraits< T >::value >::type >
 
struct  TensorTraits< TensorValue< T > >
 
struct  TensorTraits< TypeNTensor< N, T > >
 
struct  TensorTraits< TypeTensor< T > >
 
struct  TensorTraits< TypeVector< T > >
 
struct  TensorTraits< VectorValue< T > >
 

Functions

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 >
auto norm (const T &a) -> decltype(std::abs(a))
 
template<typename T >
norm (std::complex< T > a)
 
template<typename T >
auto norm (const TypeVector< T > &a) -> decltype(TensorTools::norm(T()))
 
template<typename T >
auto norm (const VectorValue< T > &a) -> decltype(TensorTools::norm(T()))
 
template<typename T >
auto norm (const TypeTensor< T > &a) -> decltype(TensorTools::norm(T()))
 
template<typename T >
auto norm (const TensorValue< T > &a) -> decltype(TensorTools::norm(T()))
 
template<typename T >
auto norm_sq (const T &a) -> decltype(std::norm(a))
 
template<typename T >
norm_sq (std::complex< T > a)
 
template<typename T >
auto norm_sq (const TypeVector< T > &a) -> decltype(std::norm(T()))
 
template<typename T >
auto norm_sq (const VectorValue< T > &a) -> decltype(std::norm(T()))
 
template<typename T >
auto norm_sq (const TypeTensor< T > &a) -> decltype(std::norm(T()))
 
template<typename T >
auto norm_sq (const TensorValue< T > &a) -> decltype(std::norm(T()))
 
template<typename T >
bool is_zero (const T &a)
 
Number curl_from_grad (const VectorValue< Number > &)
 
VectorValue< Numbercurl_from_grad (const TensorValue< Number > &grad)
 Computes the curl of a vector given the gradient of that vector. More...
 
TensorValue< Numbercurl_from_grad (const TypeNTensor< 3, Number > &grad)
 
Number div_from_grad (const VectorValue< Number > &grad)
 Dummy. Divergence of a scalar not defined, but is needed for ExactSolution to compile. More...
 
Number div_from_grad (const TensorValue< Number > &grad)
 Computes the divergence of a vector given the gradient of that vector. More...
 
VectorValue< Numberdiv_from_grad (const TypeNTensor< 3, Number > &grad)
 

Function Documentation

◆ curl_from_grad() [1/3]

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 }

◆ curl_from_grad() [2/3]

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 }

◆ curl_from_grad() [3/3]

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 }

◆ div_from_grad() [1/3]

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

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 }

◆ div_from_grad() [2/3]

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

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 }

◆ div_from_grad() [3/3]

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<ScalarTraits<T>::value && ScalarTraits<T2>::value, typename CompareTypes<T, T2>::supertype>::type libMesh::TensorTools::inner_product ( const T &  a,
const T2 &  b 
)
inline

◆ inner_product() [2/4]

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

Definition at line 57 of file tensor_tools.h.

58 { return a * b; }

◆ inner_product() [3/4]

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

Definition at line 63 of file tensor_tools.h.

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

64 { return a.contract(b); }

◆ inner_product() [4/4]

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

Definition at line 69 of file tensor_tools.h.

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

70 { return a.contract(b); }

◆ is_zero()

template<typename T >
bool libMesh::TensorTools::is_zero ( const T &  a)
inline

Definition at line 134 of file tensor_tools.h.

134 { return a.is_zero();}

◆ norm() [1/6]

template<typename T >
auto libMesh::TensorTools::norm ( const T &  a) -> decltype(std::abs(a))
inline

Definition at line 74 of file tensor_tools.h.

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::MeshTools::Subdivision::add_boundary_ghosts(), libMesh::MeshTools::Modification::all_tri(), assemble_SchroedingerEquation(), libMesh::MeshTools::bounding_sphere(), libMesh::TreeNode< N >::bounds_point(), libMesh::System::calculate_norm(), libMesh::InfFE< Dim, T_radial, T_map >::compute_data(), libMesh::InfFE< Dim, T_radial, T_map >::compute_shape_functions(), distance(), libMesh::Sphere::distance(), libMesh::UnsteadySolver::du(), libMesh::ExactSolution::error_norm(), libMesh::BoundaryInfo::get_side_and_node_maps(), LinearElasticityWithContact::initialize_contact_load_paths(), libMesh::RadialBasisInterpolation< KDDim, RBF >::interpolate_field_data(), libMesh::NumericVector< Number >::l1_norm_diff(), libMesh::DenseVector< Output >::l2_norm(), libMesh::NumericVector< Number >::l2_norm_diff(), AugmentSparsityOnInterface::mesh_reinit(), libMesh::Tet4::min_and_max_angle(), libMesh::Elem::point_test(), libMesh::RadialBasisInterpolation< KDDim, RBF >::prepare_for_use(), libMesh::MeshTools::processor_bounding_sphere(), libMesh::Elem::quality(), libMesh::C0Polyhedron::retriangulate(), libMesh::Sphere::Sphere(), libMesh::UnstructuredMesh::stitching_helper(), libMesh::MeshTools::subdomain_bounding_sphere(), libMesh::NumericVector< Number >::subset_l1_norm(), libMesh::NumericVector< Number >::subset_l2_norm(), libMesh::NumericVector< Number >::subset_linfty_norm(), InfFERadialTest::testInfQuants_numericDeriv(), MeshInputTest::testMasterCenters(), and libMesh::RBConstruction::train_reduced_basis_with_POD().

75 { return std::abs(a); }

◆ norm() [2/6]

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

Definition at line 79 of file tensor_tools.h.

79 { return std::abs(a); }

◆ norm() [3/6]

template<typename T >
auto libMesh::TensorTools::norm ( const TypeVector< T > &  a) -> decltype(TensorTools::norm(T()))
inline

Definition at line 83 of file tensor_tools.h.

84 {return std::sqrt(a.norm_sq());}

◆ norm() [4/6]

template<typename T >
auto libMesh::TensorTools::norm ( const VectorValue< T > &  a) -> decltype(TensorTools::norm(T()))
inline

Definition at line 88 of file tensor_tools.h.

89 {return std::sqrt(a.norm_sq());}

◆ norm() [5/6]

template<typename T >
auto libMesh::TensorTools::norm ( const TypeTensor< T > &  a) -> decltype(TensorTools::norm(T()))
inline

Definition at line 93 of file tensor_tools.h.

94 {return std::sqrt(a.norm_sq());}

◆ norm() [6/6]

template<typename T >
auto libMesh::TensorTools::norm ( const TensorValue< T > &  a) -> decltype(TensorTools::norm(T()))
inline

Definition at line 98 of file tensor_tools.h.

99 {return std::sqrt(a.norm_sq());}

◆ norm_sq() [1/6]

template<typename T >
auto libMesh::TensorTools::norm_sq ( const T &  a) -> decltype(std::norm(a))
inline

Definition at line 104 of file tensor_tools.h.

References std::norm().

Referenced by libMesh::ExactSolution::_compute_error(), libMesh::UniformRefinementEstimator::_estimate_error(), libMesh::DiscontinuityMeasure::boundary_side_integration(), libMesh::KellyErrorEstimator::boundary_side_integration(), libMesh::System::calculate_norm(), libMesh::Tet::choose_diagonal(), libMesh::InfQuad4::contains_point(), libMesh::InfPrism::contains_point(), libMesh::InfHex::contains_point(), libMesh::ExactErrorEstimator::find_squared_element_error(), libMesh::LaplacianErrorEstimator::internal_side_integration(), libMesh::DiscontinuityMeasure::internal_side_integration(), libMesh::KellyErrorEstimator::internal_side_integration(), libMesh::DenseSubVector< T >::l2_norm(), libMesh::DistributedVector< T >::l2_norm(), libMesh::DenseVector< Output >::l2_norm(), libMesh::NumericVector< Number >::l2_norm_diff(), libMesh::DenseSubVector< T >::linfty_norm(), libMesh::DenseVector< Output >::linfty_norm(), libMesh::PointLocatorBase::locate_node(), main(), libMesh::TypeVector< Real >::norm(), libMesh::TypeTensor< T >::norm(), libMesh::TypeVector< Real >::norm_sq(), libMesh::TypeTensor< T >::norm_sq(), libMesh::WeightedPatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::PatchRecoveryErrorEstimator::EstimateError::operator()(), libMesh::HPCoarsenTest::select_refinement(), libMesh::NumericVector< Number >::subset_l2_norm(), and InfFERadialTest::testInfQuants_numericDeriv().

105 { return std::norm(a); }
auto norm(const libMesh::TypeVector< T > &vector) -> decltype(std::norm(T()))
Definition: type_vector.h:1206

◆ norm_sq() [2/6]

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

Definition at line 109 of file tensor_tools.h.

References std::norm().

109 { return std::norm(a); }
auto norm(const libMesh::TypeVector< T > &vector) -> decltype(std::norm(T()))
Definition: type_vector.h:1206

◆ norm_sq() [3/6]

template<typename T >
auto libMesh::TensorTools::norm_sq ( const TypeVector< T > &  a) -> decltype(std::norm(T()))
inline

Definition at line 113 of file tensor_tools.h.

114 {return a.norm_sq();}

◆ norm_sq() [4/6]

template<typename T >
auto libMesh::TensorTools::norm_sq ( const VectorValue< T > &  a) -> decltype(std::norm(T()))
inline

Definition at line 118 of file tensor_tools.h.

119 {return a.norm_sq();}

◆ norm_sq() [5/6]

template<typename T >
auto libMesh::TensorTools::norm_sq ( const TypeTensor< T > &  a) -> decltype(std::norm(T()))
inline

Definition at line 123 of file tensor_tools.h.

124 {return a.norm_sq();}

◆ norm_sq() [6/6]

template<typename T >
auto libMesh::TensorTools::norm_sq ( const TensorValue< T > &  a) -> decltype(std::norm(T()))
inline

Definition at line 128 of file tensor_tools.h.

129 {return a.norm_sq();}