v0.14.0
Public Member Functions | Private Attributes | List of all members
HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp > Struct Template Reference

#include <tutorials/vec-2/src/HenckyOps.hpp>

Inheritance diagram for HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >:
[legend]
Collaboration diagram for HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >:
[legend]

Public Member Functions

 OpCalculateEigenValsImpl (const std::string field_name, boost::shared_ptr< CommonData > common_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

template<int DIM, typename DomainEleOp>
struct HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >

Definition at line 135 of file HenckyOps.hpp.

Constructor & Destructor Documentation

◆ OpCalculateEigenValsImpl()

template<int DIM, typename DomainEleOp >
HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >::OpCalculateEigenValsImpl ( const std::string  field_name,
boost::shared_ptr< CommonData common_data 
)
inline

Definition at line 137 of file HenckyOps.hpp.

139  : DomainEleOp(field_name, DomainEleOp::OPROW),
140  commonDataPtr(common_data) {
141  std::fill(&DomainEleOp::doEntities[MBEDGE],
142  &DomainEleOp::doEntities[MBMAXTYPE], false);
143  }

Member Function Documentation

◆ doWork()

template<int DIM, typename DomainEleOp >
MoFEMErrorCode HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >::doWork ( int  side,
EntityType  type,
EntData data 
)
inline

Definition at line 145 of file HenckyOps.hpp.

145  {
147 
151 
152  constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
153  // const size_t nb_gauss_pts = matGradPtr->size2();
154  const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
155 
156  auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->matGradPtr));
157 
158  commonDataPtr->matEigVal.resize(DIM, nb_gauss_pts, false);
159  commonDataPtr->matEigVec.resize(DIM * DIM, nb_gauss_pts, false);
160  auto t_eig_val = getFTensor1FromMat<DIM>(commonDataPtr->matEigVal);
161  auto t_eig_vec = getFTensor2FromMat<DIM, DIM>(commonDataPtr->matEigVec);
162 
163  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
164 
169 
170  F(i, j) = t_grad(i, j) + t_kd(i, j);
171  C(i, j) = F(k, i) ^ F(k, j);
172 
173  for (int ii = 0; ii != DIM; ii++)
174  for (int jj = 0; jj != DIM; jj++)
175  eigen_vec(ii, jj) = C(ii, jj);
176 
177  CHKERR computeEigenValuesSymmetric(eigen_vec, eig);
178  for (auto ii = 0; ii != DIM; ++ii)
179  eig(ii) = std::max(std::numeric_limits<double>::epsilon(), eig(ii));
180 
181  // rare case when two eigen values are equal
182  auto nb_uniq = get_uniq_nb<DIM>(&eig(0));
183  if constexpr (DIM == 3) {
184  if (nb_uniq == 2) {
185  sort_eigen_vals<DIM>(eig, eigen_vec);
186  }
187  }
188 
189  t_eig_val(i) = eig(i);
190  t_eig_vec(i, j) = eigen_vec(i, j);
191 
192  ++t_grad;
193  ++t_eig_val;
194  ++t_eig_vec;
195  }
196 
198  }

Member Data Documentation

◆ commonDataPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<CommonData> HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >::commonDataPtr
private

Definition at line 201 of file HenckyOps.hpp.


The documentation for this struct was generated from the following file:
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
FTensor::Kronecker_Delta
Kronecker Delta class.
Definition: Kronecker_Delta.hpp:15
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
DomainEleOp
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
Definition: child_and_parent.cpp:36
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:137
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', DIM >
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
HenckyOps::OpCalculateEigenValsImpl< DIM, GAUSS, DomainEleOp >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: HenckyOps.hpp:201
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
MoFEM::computeEigenValuesSymmetric
MoFEMErrorCode computeEigenValuesSymmetric(const MatrixDouble &mat, VectorDouble &eig, MatrixDouble &eigen_vec)
compute eigenvalues of a symmetric matrix using lapack dsyev
Definition: Templates.hpp:1452
F
@ F
Definition: free_surface.cpp:394