Functions | |
| template<typename NumTypeA, typename NumTypeG> | |
| sym_mat3< NumTypeG > | gradient_transform (mat3< NumTypeA > const &a, sym_mat3< NumTypeG > const &g) |
| Transformation of gradients (first derivatives) w.r.t. the elements of a symmetric tensor. | |
| template<typename NumTypeA> | |
| void | gradient_transform_matrix (NumTypeA *result, NumTypeA const *a) |
| See overload. | |
| template<typename NumTypeA> | |
| af::versa< NumTypeA, af::c_grid< 2 > > | gradient_transform_matrix (mat3< NumTypeA > const &a) |
| Transformation matrix for gradients (first derivatives) w.r.t. the elements of a symmetric tensor. | |
| sym_mat3<NumTypeG> scitbx::matrix::tensor_rank_2::gradient_transform | ( | mat3< NumTypeA > const & | a, | |
| sym_mat3< NumTypeG > const & | g | |||
| ) | [inline] |
Transformation of gradients (first derivatives) w.r.t. the elements of a symmetric tensor.
| a | is a linear transformation. | |
| g | are the gradients. |
g={{g0,g3,g4},{g3,g1,g5},{g4,g5,g2}}
a={{a0,a1,a2},{a3,a4,a5},{a6,a7,a8}}
agat = a.g.Transpose[a]
D[agat, g0]
D[agat, g1]
D[agat, g2]
D[agat, g3]
D[agat, g4]
D[agat, g5] Output:
2 2 2
{{a0 , a0 a3, a0 a6}, {a0 a3, a3 , a3 a6}, {a0 a6, a3 a6, a6 }}
2 2 2
{{a1 , a1 a4, a1 a7}, {a1 a4, a4 , a4 a7}, {a1 a7, a4 a7, a7 }}
2 2 2
{{a2 , a2 a5, a2 a8}, {a2 a5, a5 , a5 a8}, {a2 a8, a5 a8, a8 }}
{{2 a0 a1, a1 a3 + a0 a4, a1 a6 + a0 a7},
{a1 a3 + a0 a4, 2 a3 a4, a4 a6 + a3 a7},
{a1 a6 + a0 a7, a4 a6 + a3 a7, 2 a6 a7}}
{{2 a0 a2, a2 a3 + a0 a5, a2 a6 + a0 a8},
{a2 a3 + a0 a5, 2 a3 a5, a5 a6 + a3 a8},
{a2 a6 + a0 a8, a5 a6 + a3 a8, 2 a6 a8}}
{{2 a1 a2, a2 a4 + a1 a5, a2 a7 + a1 a8},
{a2 a4 + a1 a5, 2 a4 a5, a5 a7 + a4 a8},
{a2 a7 + a1 a8, a5 a7 + a4 a8, 2 a7 a8}}
The transformed gradients are obtained by the dot products of the upper triangles of the derivative matrices with the original gradients g.
Referenced by cctbx::adptbx::grad_u_cart_as_u_star(), and cctbx::adptbx::grad_u_star_as_u_cart().
| af::versa<NumTypeA, af::c_grid<2> > scitbx::matrix::tensor_rank_2::gradient_transform_matrix | ( | mat3< NumTypeA > const & | a | ) | [inline] |
Transformation matrix for gradients (first derivatives) w.r.t. the elements of a symmetric tensor.
The result is a 6x6 matrix of the coefficients as used in gradient_transform(). The transformed gradients are obtained by multiplying this matrix with the vector of original gradients.
References gradient_transform_matrix().
1.5.6