This class defines a tensor in LIBMESH_DIM
dimensional space of type T.
更多...
#include <tensor_tools.h>
Public 成员函数 | |
TypeTensor () | |
Empty constructor. 更多... | |
Protected 类型 | |
typedef T | value_type |
Helper typedef 用于 C++98 泛型编程。 更多... | |
typedef std::tuple< unsigned int, unsigned int > | index_type |
Helper typedef 用于泛型索引编程。 更多... | |
Protected 成员函数 | |
TypeTensor (const T &xx, const T &xy=0, const T &xz=0, const T &yx=0, const T &yy=0, const T &yz=0, const T &zx=0, const T &zy=0, const T &zz=0) | |
Constructor-from-T。默认情况下将高维项设置为0。 这是一个糟糕的二维张量构造函数-如果要覆盖默认参数,则需要显式给出“xz = 0”等参数。 更多... | |
template<typename Scalar > | |
TypeTensor (const Scalar &xx, const Scalar &xy=0, const Scalar &xz=0, const Scalar &yx=0, const Scalar &yy=0, const Scalar &yz=0, const Scalar &zx=0, const Scalar &zy=0, typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, const Scalar >::type &zz=0) | |
Constructor-from-Scalar. 更多... | |
template<typename T2 > | |
TypeTensor (const TypeVector< T2 > &vx) | |
构造函数。将每个向量赋给张量的不同行。 我们在LIBMESH_DIM空间维度中,因此LIBMESH_DIM需要许多向量。 更多... | |
template<typename T2 > | |
TypeTensor (const TypeVector< T2 > &vx, const TypeVector< T2 > &vy) | |
template<typename T2 > | |
TypeTensor (const TypeVector< T2 > &vx, const TypeVector< T2 > &vy, const TypeVector< T2 > &vz) | |
template<typename T2 > | |
TypeTensor (const TypeTensor< T2 > &p) | |
复制构造函数。 更多... | |
~TypeTensor () | |
析构函数。 更多... | |
template<typename Scalar > | |
boostcopy::enable_if_c < ScalarTraits< Scalar > ::value, TypeTensor & >::type | operator= (const Scalar &libmesh_dbg_var(p)) |
在不创建临时 Tensor 的情况下对该 Tensor 进行赋值。 更多... | |
const T & | operator() (const unsigned int i, const unsigned int j) const |
返回 (i,j) 元素的常量引用。 更多... | |
T & | operator() (const unsigned int i, const unsigned int j) |
返回 (i,j) 元素的可写引用。 更多... | |
ConstTypeTensorColumn< T > | slice (const unsigned int i) const |
返回 Tensor 的第 i 列的代理。 更多... | |
TypeTensorColumn< T > | slice (const unsigned int i) |
返回 Tensor 的第 i 列的可写代理。 更多... | |
TypeVector< T > | row (const unsigned int r) const |
返回 Tensor 的一行作为 TypeVector 的副本。 更多... | |
template<typename T2 > | |
TypeTensor< typename CompareTypes< T, T2 > ::supertype > | operator+ (const TypeTensor< T2 > &) const |
将另一个 Tensor 加到该 Tensor 上。 更多... | |
template<typename T2 > | |
const TypeTensor< T > & | operator+= (const TypeTensor< T2 > &) |
在该 Tensor 上加上另一个 Tensor。 更多... | |
template<typename T2 > | |
void | add (const TypeTensor< T2 > &) |
在不创建临时 Tensor 的情况下将另一个 Tensor 加到该 Tensor 上。 更多... | |
template<typename T2 > | |
void | add_scaled (const TypeTensor< T2 > &, const T &scale) |
在不创建临时 Tensor 的情况下将一个缩放的 Tensor 加到该 Tensor 上。 更多... | |
template<typename T2 > | |
TypeTensor< typename CompareTypes< T, T2 > ::supertype > | operator- (const TypeTensor< T2 > &) const |
从该 Tensor 减去另一个 Tensor。 更多... | |
template<typename T2 > | |
const TypeTensor< T > & | operator-= (const TypeTensor< T2 > &) |
从该 Tensor 减去另一个 Tensor。 更多... | |
template<typename T2 > | |
void | subtract (const TypeTensor< T2 > &) |
在不创建临时 Tensor 的情况下从该 Tensor 减去另一个 Tensor。 更多... | |
template<typename T2 > | |
void | subtract_scaled (const TypeTensor< T2 > &, const T &) |
在不创建临时 Tensor 的情况下从该 Tensor 减去一个缩放的 Tensor。 更多... | |
TypeTensor< T > | operator- () const |
返回该 Tensor 的负值的副本。 更多... | |
template<typename Scalar > | |
auto | operator* (const Scalar &scalar) const -> typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, TypeTensor< decltype(T()*scalar)>>::type |
将该 Tensor 与标量值相乘。 更多... | |
template<typename Scalar , typename boostcopy::enable_if_c< ScalarTraits< Scalar >::value, int >::type = 0> | |
const TypeTensor< T > & | operator*= (const Scalar &factor) |
在地方上将该 Tensor 乘以标量值。 更多... | |
template<typename Scalar > | |
boostcopy::enable_if_c < ScalarTraits< Scalar > ::value, TypeTensor< typename CompareTypes< T, Scalar > ::supertype > >::type | operator/ (const Scalar &) const |
将该 Tensor 的每个元素除以标量值。 更多... | |
const TypeTensor< T > & | operator/= (const T &) |
将该 Tensor 的每个元素除以标量值。 更多... | |
template<typename T2 > | |
TypeTensor< typename CompareTypes< T, T2 > ::supertype > | operator* (const TypeTensor< T2 > &) const |
将两个 Tensor 相乘,即矩阵-矩阵乘积。 这些 Tensor 可能包含不同的数值类型。 更多... | |
template<typename T2 > | |
const TypeTensor< T > & | operator*= (const TypeTensor< T2 > &) |
在地方上将该 Tensor 与另一个 Tensor 相乘。 更多... | |
template<typename T2 > | |
CompareTypes< T, T2 >::supertype | contract (const TypeTensor< T2 > &) const |
将两个 Tensor 相乘,返回一个标量,即 ![]() | |
template<typename T2 > | |
TypeVector< typename CompareTypes< T, T2 > ::supertype > | operator* (const TypeVector< T2 > &) const |
将该 Tensor 右乘以一个向量,即矩阵-向量乘积。 这个 Tensor 和向量可以包含不同的数值类型。 更多... | |
template<typename T2 > | |
TypeVector< typename CompareTypes< T, T2 > ::supertype > | left_multiply (const TypeVector< T2 > &p) const |
将该 Tensor 左乘以一个向量,即矩阵-向量乘积。 这个 Tensor 和向量可以包含不同的数值类型。 更多... | |
TypeTensor< T > | transpose () const |
返回该 Tensor 的转置(对于复数不共轭)。 更多... | |
TypeTensor< T > | inverse () const |
返回该 Tensor 的逆作为独立对象。 更多... | |
void | solve (const TypeVector< T > &b, TypeVector< T > &x) const |
解方程组 ![]() ![]() ![]() | |
auto | norm () const -> decltype(std::norm(T())) |
返回 Tensor 的 Frobenius 范数,即元素平方和的平方根。 更多... | |
auto | norm_sq () const -> decltype(std::norm(T())) |
返回 Tensor 的 Frobenius 范数的平方,即元素模平方的和。 更多... | |
bool | is_zero () const |
如果 Tensor 中的所有值都为零,则返回 true。 更多... | |
T | det () const |
返回 Tensor 的行列式。 由于这些是最多 3x3 的 Tensor,我们不像 DenseMatrix 那样做 LU 分解。 更多... | |
T | tr () const |
返回 Tensor 的迹。 更多... | |
void | zero () |
将 Tensor 的所有元素设置为零。 更多... | |
bool | operator== (const TypeTensor< T > &rhs) const |
检查两个 Tensor 是否相等。 更多... | |
bool | operator< (const TypeTensor< T > &rhs) const |
检查该 Tensor 是否小于另一个 Tensor。 用于排序时很有用。 更多... | |
bool | operator> (const TypeTensor< T > &rhs) const |
检查该 Tensor 是否大于另一个 Tensor。 更多... | |
void | print (std::ostream &os=libMesh::out) const |
格式化输出到流,默认为 libMesh::out。 更多... | |
void | write_unformatted (std::ostream &out_stream, const bool newline=true) const |
无格式输出到流,默认为打印元素并以空格和换行符分隔。 更多... | |
template<> | |
bool | operator< (const TypeTensor< Real > &rhs) const |
template<> | |
bool | operator> (const TypeTensor< Real > &rhs) const |
template<> | |
bool | operator< (const TypeTensor< Complex > &rhs) const |
template<> | |
bool | operator> (const TypeTensor< Complex > &rhs) const |
Protected 属性 | |
T | _coords [LIBMESH_DIM *LIBMESH_DIM] |
TypeTensor 的坐标 更多... | |
友元 | |
template<typename T2 > | |
class | TypeTensor |
This class defines a tensor in LIBMESH_DIM
dimensional space of type T.
T may either be Real or Complex.
在文件 tensor_tools.h 第 36 行定义.
|
protected |
Helper typedef 用于泛型索引编程。
在文件 type_tensor.h 第 120 行定义.
|
protected |
Helper typedef 用于 C++98 泛型编程。
在文件 type_tensor.h 第 115 行定义.
|
inline |
Empty constructor.
Gives the tensor 0 in LIBMESH_DIM
dimensions.
在文件 type_tensor.h 第 615 行定义.
参考 libMesh::TypeTensor< T >::_coords.
参考自 libMesh::TypeTensor< T >::inverse(), libMesh::TypeTensor< T >::operator-() , 以及 libMesh::TypeTensor< T >::transpose().
|
inlineexplicitprotected |
Constructor-from-T。默认情况下将高维项设置为0。 这是一个糟糕的二维张量构造函数-如果要覆盖默认参数,则需要显式给出“xz = 0”等参数。
在文件 type_tensor.h 第 638 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::libmesh_ignore().
|
inlineexplicitprotected |
Constructor-from-Scalar.
在文件 type_tensor.h 第 684 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::libmesh_ignore().
|
protected |
构造函数。将每个向量赋给张量的不同行。 我们在LIBMESH_DIM空间维度中,因此LIBMESH_DIM需要许多向量。
在文件 type_tensor.h 第 743 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
protected |
在文件 type_tensor.h 第 751 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::libmesh_ignore().
|
protected |
在文件 type_tensor.h 第 767 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::libmesh_ignore().
|
inlineprotected |
复制构造函数。
T2 | 另一个 Tensor 的元素类型。 |
p | 要复制的 Tensor。 |
在文件 type_tensor.h 第 733 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
|
inlineprotected |
在不创建临时 Tensor 的情况下将另一个 Tensor 加到该 Tensor 上。
T2 | 另一个 Tensor 的元素类型。 |
p | 另一个 Tensor。 |
在文件 type_tensor.h 第 930 行定义.
参考 libMesh::TypeTensor< T >::_coords.
参考自 libMesh::TypeTensor< T >::operator+=().
|
inlineprotected |
在不创建临时 Tensor 的情况下将一个缩放的 Tensor 加到该 Tensor 上。
T2 | 另一个 Tensor 的元素类型。 |
p | 要加的 Tensor。 |
scale | 缩放因子。 |
在文件 type_tensor.h 第 941 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
将两个 Tensor 相乘,返回一个标量,即 。 这些 Tensor 可能包含不同的数值类型。
Multiply 2 tensors together, i.e.
T2 | 另一个 Tensor 的元素类型。 |
p | 另一个 Tensor。 |
sum Aij*Bij. The tensors may be of different types.
在文件 type_tensor.h 第 1358 行定义.
参考 libMesh::TypeTensor< T >::_coords.
参考自 libMesh::TensorTools::inner_product().
|
inlineprotected |
返回 Tensor 的行列式。 由于这些是最多 3x3 的 Tensor,我们不像 DenseMatrix 那样做 LU 分解。
在文件 type_tensor.h 第 1388 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
返回该 Tensor 的逆作为独立对象。
在文件 type_tensor.h 第 1170 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::TypeTensor< T >::TypeTensor().
|
inlineprotected |
如果 Tensor 中的所有值都为零,则返回 true。
在文件 type_tensor.h 第 1378 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
将该 Tensor 左乘以一个向量,即矩阵-向量乘积。 这个 Tensor 和向量可以包含不同的数值类型。
T2 | 向量的元素类型。 |
p | 另一个向量。 |
在文件 type_tensor.h 第 1301 行定义.
参考自 libMesh::operator*().
|
inlineprotected |
返回 Tensor 的 Frobenius 范数,即元素平方和的平方根。
在文件 type_tensor.h 第 1370 行定义.
参考 libMesh::TypeTensor< T >::norm_sq() , 以及 std::sqrt().
|
inlineprotected |
返回 Tensor 的 Frobenius 范数的平方,即元素模平方的和。
在文件 type_tensor.h 第 1438 行定义.
参考 libMesh::TypeTensor< T >::_coords, libMesh::TensorTools::norm_sq() , 以及 libMesh::Real.
参考自 libMesh::TypeTensor< T >::norm().
|
inlineprotected |
返回 (i,j) 元素的常量引用。
i | 行索引。 |
j | 列索引。 |
在文件 type_tensor.h 第 811 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
返回 (i,j) 元素的可写引用。
i | 行索引。 |
j | 列索引。 |
在文件 type_tensor.h 第 830 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
将该 Tensor 与标量值相乘。
Scalar | 标量类型。 |
scalar | 标量值。 |
在文件 type_tensor.h 第 1055 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
将两个 Tensor 相乘,即矩阵-矩阵乘积。 这些 Tensor 可能包含不同的数值类型。
T2 | 另一个 Tensor 的元素类型。 |
p | 另一个 Tensor。 |
在文件 type_tensor.h 第 1323 行定义.
|
inlineprotected |
将该 Tensor 右乘以一个向量,即矩阵-向量乘积。 这个 Tensor 和向量可以包含不同的数值类型。
T2 | 向量的元素类型。 |
p | 另一个向量。 |
在文件 type_tensor.h 第 1287 行定义.
|
inlineprotected |
在地方上将该 Tensor 乘以标量值。
Scalar | 标量类型。 |
factor | 缩放因子。 |
在文件 type_tensor.h 第 304 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
在地方上将该 Tensor 与另一个 Tensor 相乘。
T2 | 另一个 Tensor 的元素类型。 |
p | 另一个 Tensor。 |
在文件 type_tensor.h 第 1337 行定义.
|
inlineprotected |
将另一个 Tensor 加到该 Tensor 上。
T2 | 另一个 Tensor 的元素类型。 |
p | 另一个 Tensor。 |
在文件 type_tensor.h 第 884 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
在该 Tensor 上加上另一个 Tensor。
T2 | 另一个 Tensor 的元素类型。 |
p | 另一个 Tensor。 |
在文件 type_tensor.h 第 918 行定义.
参考 libMesh::TypeTensor< T >::add().
|
inlineprotected |
从该 Tensor 减去另一个 Tensor。
T2 | 另一个 Tensor 的元素类型。 |
p | 要减去的 Tensor。 |
在文件 type_tensor.h 第 954 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
返回该 Tensor 的负值的副本。
在文件 type_tensor.h 第 1021 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::TypeTensor< T >::TypeTensor().
|
inlineprotected |
从该 Tensor 减去另一个 Tensor。
T2 | 另一个 Tensor 的元素类型。 |
p | 要减去的 Tensor。 |
在文件 type_tensor.h 第 988 行定义.
参考 libMesh::TypeTensor< T >::subtract().
|
inlineprotected |
将该 Tensor 的每个元素除以标量值。
Scalar | 标量类型。 |
divisor | 除数。 |
在文件 type_tensor.h 第 1105 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
将该 Tensor 的每个元素除以标量值。
divisor | 除数。 |
在文件 type_tensor.h 第 1270 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
protected |
在文件 type_tensor.C 第 113 行定义.
|
protected |
在文件 type_tensor.C 第 146 行定义.
参考 std::imag() , 以及 std::real().
|
protected |
检查该 Tensor 是否小于另一个 Tensor。 用于排序时很有用。
rhs | 要比较的另一个 Tensor。 |
|
inlineprotected |
在不创建临时 Tensor 的情况下对该 Tensor 进行赋值。
T2 | 赋值的标量类型。 |
p | 要赋值的标量。 |
在文件 type_tensor.h 第 147 行定义.
参考 libMesh::TypeTensor< T >::zero().
|
inlineprotected |
检查两个 Tensor 是否相等。
rhs | 要比较的另一个 Tensor。 |
在文件 type_tensor.h 第 1450 行定义.
参考 libMesh::TypeTensor< T >::_coords, std::abs() , 以及 libMesh::TOLERANCE.
|
protected |
在文件 type_tensor.C 第 129 行定义.
|
protected |
在文件 type_tensor.C 第 166 行定义.
参考 std::imag() , 以及 std::real().
|
protected |
检查该 Tensor 是否大于另一个 Tensor。
rhs | 要比较的另一个 Tensor。 |
|
protected |
|
inlineprotected |
返回 Tensor 的一行作为 TypeVector 的副本。
r | 行索引。 |
在文件 type_tensor.h 第 870 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::TypeVector< T >::_coords.
|
inlineprotected |
|
inlineprotected |
|
inlineprotected |
解方程组 得到
,其中
为该 Tensor。
b | 右侧向量。 | |
[out] | x | 解向量。 |
在文件 type_tensor.h 第 1219 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
在不创建临时 Tensor 的情况下从该 Tensor 减去另一个 Tensor。
T2 | 另一个 Tensor 的元素类型。 |
p | 要减去的 Tensor。 |
在文件 type_tensor.h 第 1000 行定义.
参考 libMesh::TypeTensor< T >::_coords.
参考自 libMesh::TypeTensor< T >::operator-=().
|
inlineprotected |
在不创建临时 Tensor 的情况下从该 Tensor 减去一个缩放的 Tensor。
T2 | 另一个 Tensor 的元素类型。 |
p | 要减去的 Tensor。 |
scale | 缩放因子。 |
在文件 type_tensor.h 第 1011 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
返回 Tensor 的迹。
在文件 type_tensor.h 第 1411 行定义.
参考 libMesh::TypeTensor< T >::_coords.
|
inlineprotected |
返回该 Tensor 的转置(对于复数不共轭)。
在文件 type_tensor.h 第 1140 行定义.
参考 libMesh::TypeTensor< T >::_coords , 以及 libMesh::TypeTensor< T >::TypeTensor().
|
protected |
|
inlineprotected |
将 Tensor 的所有元素设置为零。
在文件 type_tensor.h 第 1428 行定义.
参考 libMesh::TypeTensor< T >::_coords.
参考自 libMesh::TypeTensor< T >::operator=() , 以及 libMesh::TensorValue< T >::operator=().
在文件 type_tensor.h 第 55 行定义.
|
protected |
TypeTensor
的坐标
在文件 type_tensor.h 第 500 行定义.
参考自 libMesh::TypeTensor< T >::add(), libMesh::TypeTensor< T >::add_scaled(), libMesh::TypeTensor< T >::contract(), libMesh::TypeTensor< T >::det(), libMesh::TypeTensor< T >::inverse(), libMesh::TypeTensor< T >::is_zero(), libMesh::TypeTensor< T >::norm_sq(), libMesh::TypeTensor< T >::operator()(), libMesh::TypeTensor< T >::operator*(), libMesh::TypeTensor< T >::operator*=(), libMesh::TypeTensor< T >::operator+(), libMesh::TypeTensor< T >::operator-(), libMesh::TypeTensor< T >::operator/(), libMesh::TypeTensor< T >::operator/=(), libMesh::TypeTensor< T >::operator==(), libMesh::TypeTensor< T >::row(), libMesh::TypeTensor< T >::solve(), libMesh::TypeTensor< T >::subtract(), libMesh::TypeTensor< T >::subtract_scaled(), libMesh::TypeTensor< T >::tr(), libMesh::TypeTensor< T >::transpose(), libMesh::TypeTensor< T >::TypeTensor() , 以及 libMesh::TypeTensor< T >::zero().