v0.11.0
Public Member Functions | Public Attributes | List of all members
EshelbianPlasticity::OpCalculateRotationAndSpatialGradient Struct Reference

#include <users_modules/eshelbian_plasticty/src/EshelbianPlasticity.hpp>

Inherits VolUserDataOperator.

Public Member Functions

 OpCalculateRotationAndSpatialGradient (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > &data_ptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Public Attributes

boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 

Detailed Description

Definition at line 758 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpCalculateRotationAndSpatialGradient()

EshelbianPlasticity::OpCalculateRotationAndSpatialGradient::OpCalculateRotationAndSpatialGradient ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts > &  data_ptr 
)

Definition at line 761 of file EshelbianPlasticity.hpp.

764  : VolUserDataOperator(field_name, OPROW), dataAtPts(data_ptr) {}
VolumeElementForcesAndSourcesCore::UserDataOperator VolUserDataOperator
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts

Member Function Documentation

◆ doWork()

MoFEMErrorCode EshelbianPlasticity::OpCalculateRotationAndSpatialGradient::doWork ( int  side,
EntityType  type,
EntData data 
)

Definition at line 166 of file EshelbianOperators.cpp.

168  {
170  if (type != MBTET)
172  int nb_integration_pts = data.getN().size1();
177 
178  dataAtPts->hAtPts.resize(9, nb_integration_pts, false);
179  dataAtPts->rotMatAtPts.resize(9, nb_integration_pts, false);
180  dataAtPts->diffRotMatAtPts.resize(27, nb_integration_pts, false);
181  dataAtPts->streachTensorAtPts.resize(6, nb_integration_pts, false);
182  dataAtPts->diffStreachTensorAtPts.resize(36, nb_integration_pts, false);
183  dataAtPts->eigenVals.resize(3, nb_integration_pts, false);
184  dataAtPts->eigenVecs.resize(9, nb_integration_pts, false);
185  dataAtPts->nbUniq.resize(nb_integration_pts, false);
186 
187  auto t_h = getFTensor2FromMat<3, 3>(dataAtPts->hAtPts);
188  auto t_omega = getFTensor1FromMat<3>(dataAtPts->rotAxisAtPts);
189  auto t_R = getFTensor2FromMat<3, 3>(dataAtPts->rotMatAtPts);
190  auto t_diff_R = getFTensor3FromMat(dataAtPts->diffRotMatAtPts);
191  auto t_log_u =
192  getFTensor2SymmetricFromMat<3>(dataAtPts->logStreachTensorAtPts);
193  auto t_u = getFTensor2SymmetricFromMat<3>(dataAtPts->streachTensorAtPts);
194 
195  auto t_diff_u =
196  getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStreachTensorAtPts);
197  auto t_eigen_vals = getFTensor1FromMat<3>(dataAtPts->eigenVals);
198  auto t_eigen_vecs = getFTensor2FromMat<3, 3>(dataAtPts->eigenVecs);
199  auto &nbUniq = dataAtPts->nbUniq;
200 
201  for (int gg = 0; gg != nb_integration_pts; ++gg) {
202 
203  auto t0_diff = get_diff_rotation_form_vector(t_omega);
204  auto t0 = get_rotation_form_vector(t_omega);
205 
206  t_diff_R(i, j, k) = t0_diff(i, j, k);
207  t_R(i, j) = t0(i, j);
208 
211  CHKERR get_eigen_val_and_proj_lapack(t_log_u, eig, eigen_vec);
212 
213  t_eigen_vals(i) = eig(i);
214  t_eigen_vecs(i, j) = eigen_vec(i, j);
215 
216  // rare case when two eigen values are equal
217  nbUniq[gg] = get_uniq_nb(eig);
218  if (nbUniq[gg] == 2)
219  sort_eigen_vals(eig, eigen_vec);
220 
221  auto t_u_tmp = EigenMatrix::getMat(t_eigen_vals, t_eigen_vecs, f);
222  auto t_diff_u_tmp =
223  EigenMatrix::getDiffMat(t_eigen_vals, t_eigen_vecs, f, d_f, nbUniq[gg]);
224  for (int ii = 0; ii != 3; ++ii) {
225  for (int jj = ii; jj != 3; ++jj) {
226  for (int kk = 0; kk != 3; ++kk) {
227  for (int ll = 0; ll < kk; ++ll) {
228  t_diff_u_tmp(ii, jj, kk, ll) *= 2;
229  }
230  }
231  }
232  }
233 
234  t_u(i, j) = t_u_tmp(i, j);
235  t_diff_u(i, j, k, l) = t_diff_u_tmp(i, j, k, l);
236  t_h(i, j) = t_R(i, k) * t_u(k, j);
237 
238  ++t_h;
239  ++t_R;
240  ++t_diff_R;
241  ++t_log_u;
242  ++t_u;
243  ++t_diff_u;
244  ++t_eigen_vals;
245  ++t_eigen_vecs;
246  ++t_omega;
247  }
248 
250 }
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:516
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:415
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:485
#define CHKERR
Inline error check.
Definition: definitions.h:604
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'i', 3 > i
FTensor::Index< 'k', 3 > k
FTensor::Ddg< double, 3, 3 > getDiffMat(Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f, Fun< double > d_f, const int nb)
Get the Diff Mat object.
FTensor::Tensor2_symmetric< double, 3 > getMat(Val< double, 3 > &t_val, Vec< double, 3 > &t_vec, Fun< double > f)
Get the Mat object.
static FTensor::Tensor3< typename TensorTypeExtractor< T >::Type, 3, 3, 3 > get_diff_rotation_form_vector(FTensor::Tensor1< T, 3 > &t_omega)
static FTensor::Tensor2< typename TensorTypeExtractor< T >::Type, 3, 3 > get_rotation_form_vector(FTensor::Tensor1< T, 3 > &t_omega)
MoFEMErrorCode get_eigen_val_and_proj_lapack(T1 &X, T2 &eig, T3 &eig_vec)
double f(const double v)
void sort_eigen_vals(T1 &eig, T2 &eigen_vec)
FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > getFTensor3FromMat(MatrixDouble &m)
double d_f(const double v)
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....

Member Data Documentation

◆ dataAtPts

boost::shared_ptr<DataAtIntegrationPts> EshelbianPlasticity::OpCalculateRotationAndSpatialGradient::dataAtPts

data at integration pts

Definition at line 760 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following files: