v0.14.0
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::HMHHencky::OpSpatialPhysical Struct Reference
Inheritance diagram for EshelbianPlasticity::HMHHencky::OpSpatialPhysical:
[legend]
Collaboration diagram for EshelbianPlasticity::HMHHencky::OpSpatialPhysical:
[legend]

Public Member Functions

 OpSpatialPhysical (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
 
MoFEMErrorCode integrate (EntData &data)
 
MoFEMErrorCode integrateHencky (EntData &data)
 
MoFEMErrorCode integratePolyconvexHencky (EntData &data)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleVolume
 OpAssembleVolume (const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleVolume (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry)
 
- Public Member Functions inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
 OpAssembleBasic (const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
 
 OpAssembleBasic (std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type, const bool assemble_symmetry, ScaleOff scale_off=[]() { return 1;})
 
virtual MoFEMErrorCode integrate (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode integrate (EntData &row_data, EntData &col_data)
 
virtual MoFEMErrorCode assemble (EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, EntityType row_type, EntData &data)
 
virtual MoFEMErrorCode assemble (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 
MoFEMErrorCode doWork (int row_side, int col_side, EntityType row_type, EntityType col_type, EntData &row_data, EntData &col_data)
 

Private Attributes

const double alphaU
 
PetscBool polyConvex = PETSC_FALSE
 

Additional Inherited Members

- Public Types inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
using ScaleOff = boost::function< double()>
 
- Public Attributes inherited from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >
const bool assembleSymmetry
 
boost::shared_ptr< DataAtIntegrationPtsdataAtPts
 data at integration pts More...
 
VectorDouble nF
 local right hand side vector More...
 
MatrixDouble K
 local tangent matrix More...
 
MatrixDouble transposeK
 
ScaleOff scaleOff
 

Detailed Description

Definition at line 79 of file Hencky.cpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical()

EshelbianPlasticity::HMHHencky::OpSpatialPhysical::OpSpatialPhysical ( const std::string &  field_name,
boost::shared_ptr< DataAtIntegrationPts data_ptr,
const double  alpha_u 
)

Definition at line 287 of file Hencky.cpp.

290  : OpAssembleVolume(field_name, data_ptr, OPROW), alphaU(alpha_u) {
291 
292  CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULL, "", "-poly_convex",
293  &polyConvex, PETSC_NULL),
294  "get polyconvex option failed");
295 }

Member Function Documentation

◆ integrate()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integrate ( EntData data)
virtual

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Definition at line 297 of file Hencky.cpp.

297  {
299  if (polyConvex) {
301  } else {
302  CHKERR integrateHencky(data);
303  }
305 }

◆ integrateHencky()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integrateHencky ( EntData data)

Definition at line 307 of file Hencky.cpp.

307  {
309 
311  auto t_L = symm_L_tensor();
312 
313  int nb_dofs = data.getIndices().size();
314  int nb_integration_pts = data.getN().size1();
315  auto v = getVolume();
316  auto t_w = getFTensor0IntegrationWeight();
317  auto t_approx_P_adjont_log_du =
318  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
319  auto t_log_stretch_h1 =
320  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
321  auto t_dot_log_u =
322  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
323 
324  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
325 
330  auto get_ftensor2 = [](auto &v) {
332  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
333  };
334 
335  int nb_base_functions = data.getN().size2();
336  auto t_row_base_fun = data.getFTensor0N();
337  for (int gg = 0; gg != nb_integration_pts; ++gg) {
338  double a = v * t_w;
339  auto t_nf = get_ftensor2(nF);
340 
342  t_T(i, j) =
343  t_D(i, j, k, l) * (t_log_stretch_h1(k, l) + alphaU * t_dot_log_u(k, l));
345  t_residual(L) =
346  a * (t_approx_P_adjont_log_du(L) - t_L(i, j, L) * t_T(i, j));
347 
348  int bb = 0;
349  for (; bb != nb_dofs / 6; ++bb) {
350  t_nf(L) += t_row_base_fun * t_residual(L);
351  ++t_nf;
352  ++t_row_base_fun;
353  }
354  for (; bb != nb_base_functions; ++bb)
355  ++t_row_base_fun;
356 
357  ++t_w;
358  ++t_approx_P_adjont_log_du;
359  ++t_dot_log_u;
360  ++t_log_stretch_h1;
361  }
363 }

◆ integratePolyconvexHencky()

MoFEMErrorCode EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integratePolyconvexHencky ( EntData data)

Definition at line 366 of file Hencky.cpp.

366  {
368 
370  auto t_L = symm_L_tensor();
371 
372  int nb_dofs = data.getIndices().size();
373  int nb_integration_pts = data.getN().size1();
374  auto v = getVolume();
375  auto t_w = getFTensor0IntegrationWeight();
376  auto t_approx_P_adjont_log_du =
377  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
378  auto t_log_stretch_h1 =
379  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
380  auto t_dot_log_u =
381  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
382 
383  auto t_D = getFTensor4DdgFromPtr<3, 3, 0>(&*dataAtPts->matD.data().begin());
384 
389  auto get_ftensor2 = [](auto &v) {
391  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
392  };
393 
394  constexpr double nohat_k = 1. / 4;
395  constexpr double hat_k = 1. / 8;
396  double mu = dataAtPts->mu;
397  double lambda = dataAtPts->lambda;
398 
399  constexpr double third = boost::math::constants::third<double>();
401  auto t_diff_deviator = diff_deviator(diff_tensor());
402 
403  int nb_base_functions = data.getN().size2();
404  auto t_row_base_fun = data.getFTensor0N();
405  for (int gg = 0; gg != nb_integration_pts; ++gg) {
406  double a = v * t_w;
407  auto t_nf = get_ftensor2(nF);
408 
409  double log_det = t_log_stretch_h1(i, i);
410  double log_det2 = log_det * log_det;
412  t_dev(i, j) = t_log_stretch_h1(i, j) - t_kd(i, j) * (third * log_det);
413  double dev_norm2 = t_dev(i, j) * t_dev(i, j);
414 
416  auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
417  auto B = lambda * std::exp(hat_k * log_det2) * log_det;
418  t_T(i, j) =
419 
420  A * (t_dev(k, l) * t_diff_deviator(k, l, i, j))
421 
422  +
423 
424  B * t_kd(i, j)
425 
426  +
427 
428  alphaU * t_D(i, j, k, l) * t_dot_log_u(k, l);
429 
431  t_residual(L) =
432  a * (t_approx_P_adjont_log_du(L) - t_L(i, j, L) * t_T(i, j));
433 
434  int bb = 0;
435  for (; bb != nb_dofs / size_symm; ++bb) {
436  t_nf(L) += t_row_base_fun * t_residual(L);
437  ++t_nf;
438  ++t_row_base_fun;
439  }
440  for (; bb != nb_base_functions; ++bb)
441  ++t_row_base_fun;
442 
443  ++t_w;
444  ++t_approx_P_adjont_log_du;
445  ++t_dot_log_u;
446  ++t_log_stretch_h1;
447  }
449 }

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::HMHHencky::OpSpatialPhysical::alphaU
private

Definition at line 92 of file Hencky.cpp.

◆ polyConvex

PetscBool EshelbianPlasticity::HMHHencky::OpSpatialPhysical::polyConvex = PETSC_FALSE
private

Definition at line 93 of file Hencky.cpp.


The documentation for this struct was generated from the following file:
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
EshelbianPlasticity::size_symm
constexpr static auto size_symm
Definition: EshelbianAux.hpp:39
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
EshelbianPlasticity::diff_tensor
auto diff_tensor()
Definition: EshelbianAux.hpp:41
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::nF
VectorDouble nF
local right hand side vector
Definition: EshelbianPlasticity.hpp:426
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1502
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integrateHencky
MoFEMErrorCode integrateHencky(EntData &data)
Definition: Hencky.cpp:307
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
a
constexpr double a
Definition: approx_sphere.cpp:30
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1214
MoFEM::L
VectorDouble L
Definition: Projection10NodeCoordsOnField.cpp:124
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:412
EshelbianPlasticity::diff_deviator
auto diff_deviator(FTensor::Ddg< double, 3, 3 > &&t_diff_stress)
Definition: EshelbianAux.hpp:12
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
EshelbianPlasticity::symm_L_tensor
auto symm_L_tensor()
Definition: EshelbianAux.hpp:52
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index
Definition: Index.hpp:23
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
MoFEM::EntitiesFieldData::EntData::getN
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
Definition: EntitiesFieldData.hpp:1318
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::integratePolyconvexHencky
MoFEMErrorCode integratePolyconvexHencky(EntData &data)
Definition: Hencky.cpp:366
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
mu
double mu
Definition: dynamic_first_order_con_law.cpp:98
lambda
static double lambda
Definition: incompressible_elasticity.cpp:199
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::alphaU
const double alphaU
Definition: Hencky.cpp:92
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
EshelbianPlasticity::OpAssembleVolume::OpAssembleVolume
OpAssembleVolume(const std::string &field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const char type)
Definition: EshelbianPlasticity.hpp:518
third
constexpr double third
Definition: EshelbianADOL-C.cpp:17
EshelbianPlasticity::HMHHencky::OpSpatialPhysical::polyConvex
PetscBool polyConvex
Definition: Hencky.cpp:93
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
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182