25#ifndef __SYMMETRIZE_STRESS_TENSOR_HPP__
26#define __SYMMETRIZE_STRESS_TENSOR_HPP__
33symmetrize_stress_tensor(Crystal_symmetry
const& sym__, r3::matrix<double>& s__)
35 if (sym__.size() == 1) {
39 r3::matrix<double> result;
41 for (
int i = 0; i < sym__.size(); i++) {
42 auto R = sym__[i].spg_op.Rcp;
43 result = result + dot(dot(
transpose(R), s__), R);
46 s__ = result * (1.0 / sym__.size());
48 std::vector<std::array<int, 2>> idx = {{0, 1}, {0, 2}, {1, 2}};
50 s__(e[0], e[1]) = s__(e[1], e[0]) = 0.5 * (s__(e[0], e[1]) + s__(e[1], e[0]));
Contains definition and partial implementation of sirius::Crystal_symmetry class.
auto transpose(matrix< T > src)
Return transpose of the matrix.
Namespace of the SIRIUS library.