93 {
95
99
101
102 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
103
104 auto t_grad = getFTensor2FromMat<DIM, DIM>(*(
commonDataPtr->matGradPtr));
105
107 commonDataPtr->matEigVec.resize(nb_gauss_pts, DIM * DIM,
false);
108 auto t_eig_val = getFTensor1FromMat<DIM>(
commonDataPtr->matEigVal);
109 auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(
commonDataPtr->matEigVec);
110
111 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
112
117
120
121 for (int ii = 0; ii != DIM; ii++)
122 for (int jj = 0; jj != DIM; jj++)
123 eigen_vec(ii, jj) = C(ii, jj);
124
126 for (auto ii = 0; ii != DIM; ++ii)
127 eig(ii) = std::max(
eps, eig(ii));
128
129
130 auto nb_uniq =
132 if constexpr (DIM == 3) {
133 if (nb_uniq == 2) {
134 CHKERR sortEigenVals<DIM>(
138 }
139 }
140
141 t_eig_val(
i) = eig(
i);
142 t_eig_vec(
i,
j) = eigen_vec(
i,
j);
143
144#ifndef NDEBUG
147 if (nb_uniq_test != nb_uniq) {
149 "Inconsistent number of unique eigen values %ld != %ld",
150 nb_uniq, nb_uniq_test);
151 }
152#endif
153
154 ++t_grad;
155 ++t_eig_val;
156 ++t_eig_vec;
157 }
158
160 }
#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