96 {
98
102
104
105 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
106
107 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(
commonDataPtr->matGradPtr));
108
110 commonDataPtr->matEigVec.resize(nb_gauss_pts, DIM * DIM,
false);
111 auto t_eig_val = getFTensor1FromMat<DIM>(
commonDataPtr->matEigVal);
112 auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(
commonDataPtr->matEigVec);
113
114 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
115
120
123
124 for (int ii = 0; ii != DIM; ii++)
125 for (int jj = 0; jj != DIM; jj++)
126 eigen_vec(ii, jj) =
C(ii, jj);
127
129 for (auto ii = 0; ii != DIM; ++ii)
130 eig(ii) = std::max(
eps, eig(ii));
131
132
133 auto nb_uniq =
135 if constexpr (DIM == 3) {
136 if (nb_uniq == 2) {
137 CHKERR sortEigenVals<DIM>(
141 }
142 }
143
144 t_eig_val(
i) = eig(
i);
145 t_eig_vec(
i,
j) = eigen_vec(
i,
j);
146
147#ifndef NDEBUG
150 if (nb_uniq_test != nb_uniq) {
152 "Inconsistent number of unique eigen values %ld != %ld",
153 nb_uniq, nb_uniq_test);
154 }
155#endif
156
157 ++t_grad;
158 ++t_eig_val;
159 ++t_eig_vec;
160 }
161
163 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
auto getMatrixAdaptor(T1 ptr, const size_t n, const size_t m)
Get Matrix adaptor.
MoFEMErrorCode computeEigenValuesSymmetric(const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
compute eigenvalues of a symmetric matrix using lapack dsyev