v0.14.0
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpSpatialPhysical Struct Reference

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

Inheritance diagram for EshelbianPlasticity::OpSpatialPhysical:
[legend]
Collaboration diagram for EshelbianPlasticity::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 integratePiola (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 (const std::string &row_field, const 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 (const std::string &row_field, const 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 515 of file EshelbianPlasticity.hpp.

Constructor & Destructor Documentation

◆ OpSpatialPhysical()

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

Definition at line 517 of file EshelbianPlasticity.hpp.

520  : OpAssembleVolume(field_name, data_ptr, OPROW), alphaU(alpha_u) {
521 
522  CHK_MOAB_THROW(PetscOptionsGetBool(PETSC_NULL, "", "-poly_convex",
523  &polyConvex, PETSC_NULL),
524  "get ployconvex option failed");
525  }

Member Function Documentation

◆ integrate()

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

Reimplemented from EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >.

Definition at line 594 of file EshelbianOperators.cpp.

594  {
596 
597  if (dataAtPts->physicsPtr->dependentVariablesPiola.size()) {
598  CHKERR integratePiola(data);
599  } else {
600  if (polyConvex) {
602  } else {
603  CHKERR integrateHencky(data);
604  }
605  }
606 
608 }

◆ integrateHencky()

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

Definition at line 610 of file EshelbianOperators.cpp.

610  {
612 
614  auto t_L = symm_L_tensor();
615 
616  int nb_dofs = data.getIndices().size();
617  int nb_integration_pts = data.getN().size1();
618  auto v = getVolume();
619  auto t_w = getFTensor0IntegrationWeight();
620  auto t_approx_P_adjont_log_du =
621  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
622  auto t_log_streach_h1 =
623  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
624  auto t_dot_log_u =
625  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
626 
627  auto t_D = getFTensor4DdgFromMat<3, 3, 0>(dataAtPts->matD);
628 
633  auto get_ftensor2 = [](auto &v) {
635  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
636  };
637 
638  int nb_base_functions = data.getN().size2();
639  auto t_row_base_fun = data.getFTensor0N();
640  for (int gg = 0; gg != nb_integration_pts; ++gg) {
641  double a = v * t_w;
642  auto t_nf = get_ftensor2(nF);
643 
645  t_T(i, j) =
646  t_D(i, j, k, l) * (t_log_streach_h1(k, l) + alphaU * t_dot_log_u(k, l));
648  t_residual(L) =
649  a * (t_approx_P_adjont_log_du(L) - t_L(i, j, L) * t_T(i, j));
650 
651  int bb = 0;
652  for (; bb != nb_dofs / 6; ++bb) {
653  t_nf(L) += t_row_base_fun * t_residual(L);
654  ++t_nf;
655  ++t_row_base_fun;
656  }
657  for (; bb != nb_base_functions; ++bb)
658  ++t_row_base_fun;
659 
660  ++t_w;
661  ++t_approx_P_adjont_log_du;
662  ++t_dot_log_u;
663  ++t_log_streach_h1;
664  }
666 }

◆ integratePiola()

MoFEMErrorCode EshelbianPlasticity::OpSpatialPhysical::integratePiola ( EntData data)

Definition at line 753 of file EshelbianOperators.cpp.

753  {
755 
757  auto t_L = symm_L_tensor();
758 
759  int nb_dofs = data.getIndices().size();
760  int nb_integration_pts = data.getN().size1();
761  auto v = getVolume();
762  auto t_w = getFTensor0IntegrationWeight();
763  auto t_approx_P_adjont_log_du =
764  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
765  auto t_P = getFTensor2FromMat<3, 3>(dataAtPts->PAtPts);
766  auto t_dot_log_u =
767  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
768  auto t_diff_u =
769  getFTensor4DdgFromMat<3, 3, 1>(dataAtPts->diffStretchTensorAtPts);
770 
775  auto get_ftensor2 = [](auto &v) {
777  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
778  };
779 
780  int nb_base_functions = data.getN().size2();
781  auto t_row_base_fun = data.getFTensor0N();
782  for (int gg = 0; gg != nb_integration_pts; ++gg) {
783  double a = v * t_w;
784  auto t_nf = get_ftensor2(nF);
785 
787  t_Ldiff_u(i, j, L) = t_diff_u(i, j, k, l) * t_L(k, l, L);
788 
790  t_viscous_P(i, j) =
791  alphaU *
792  t_dot_log_u(i,
793  j); // That is chit, should be split on axiator and deviator
794 
796  t_residual(L) =
797  a * (t_approx_P_adjont_log_du(L) - t_Ldiff_u(i, j, L) * t_P(i, j) -
798  t_L(i, j, L) * t_viscous_P(i, j));
799 
800  int bb = 0;
801  for (; bb != nb_dofs / 6; ++bb) {
802  t_nf(L) += t_row_base_fun * t_residual(L);
803  ++t_nf;
804  ++t_row_base_fun;
805  }
806  for (; bb != nb_base_functions; ++bb)
807  ++t_row_base_fun;
808 
809  ++t_w;
810  ++t_approx_P_adjont_log_du;
811  ++t_P;
812  ++t_dot_log_u;
813  ++t_diff_u;
814  }
816 }

◆ integratePolyconvexHencky()

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

Definition at line 668 of file EshelbianOperators.cpp.

668  {
670 
672  auto t_L = symm_L_tensor();
673 
674  int nb_dofs = data.getIndices().size();
675  int nb_integration_pts = data.getN().size1();
676  auto v = getVolume();
677  auto t_w = getFTensor0IntegrationWeight();
678  auto t_approx_P_adjont_log_du =
679  getFTensor1FromMat<size_symm>(dataAtPts->adjointPdUAtPts);
680  auto t_log_streach_h1 =
681  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchTotalTensorAtPts);
682  auto t_dot_log_u =
683  getFTensor2SymmetricFromMat<3>(dataAtPts->logStretchDotTensorAtPts);
684 
685  auto t_D = getFTensor4DdgFromMat<3, 3, 0>(dataAtPts->matD);
686 
691  auto get_ftensor2 = [](auto &v) {
693  &v[0], &v[1], &v[2], &v[3], &v[4], &v[5]);
694  };
695 
696  constexpr double nohat_k = 1. / 4;
697  constexpr double hat_k = 1. / 8;
698  double mu = dataAtPts->mu;
699  double lambda = dataAtPts->lambda;
700 
701  constexpr double third = boost::math::constants::third<double>();
703  auto t_diff_deviator = diff_deviator(diff_tensor());
704 
705  int nb_base_functions = data.getN().size2();
706  auto t_row_base_fun = data.getFTensor0N();
707  for (int gg = 0; gg != nb_integration_pts; ++gg) {
708  double a = v * t_w;
709  auto t_nf = get_ftensor2(nF);
710 
711  double log_det = t_log_streach_h1(i, i);
712  double log_det2 = log_det * log_det;
714  t_dev(i, j) = t_log_streach_h1(i, j) - t_kd(i, j) * (third * log_det);
715  double dev_norm2 = t_dev(i, j) * t_dev(i, j);
716 
718  auto A = 2 * mu * std::exp(nohat_k * dev_norm2);
719  auto B = lambda * std::exp(hat_k * log_det2) * log_det;
720  t_T(i, j) =
721 
722  A * (t_dev(k, l) * t_diff_deviator(k, l, i, j))
723 
724  +
725 
726  B * t_kd(i, j)
727 
728  +
729 
730  alphaU * t_D(i, j, k, l) * t_log_streach_h1(k, l);
731 
733  t_residual(L) =
734  a * (t_approx_P_adjont_log_du(L) - t_L(i, j, L) * t_T(i, j));
735 
736  int bb = 0;
737  for (; bb != nb_dofs / 6; ++bb) {
738  t_nf(L) += t_row_base_fun * t_residual(L);
739  ++t_nf;
740  ++t_row_base_fun;
741  }
742  for (; bb != nb_base_functions; ++bb)
743  ++t_row_base_fun;
744 
745  ++t_w;
746  ++t_approx_P_adjont_log_du;
747  ++t_dot_log_u;
748  ++t_log_streach_h1;
749  }
751 }

Member Data Documentation

◆ alphaU

const double EshelbianPlasticity::OpSpatialPhysical::alphaU
private

Definition at line 534 of file EshelbianPlasticity.hpp.

◆ polyConvex

PetscBool EshelbianPlasticity::OpSpatialPhysical::polyConvex = PETSC_FALSE
private

Definition at line 535 of file EshelbianPlasticity.hpp.


The documentation for this struct was generated from the following files:
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:576
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
EshelbianPlasticity::diff_tensor
auto diff_tensor()
Definition: EshelbianOperators.cpp:49
A
constexpr AssemblyType A
Definition: operators_tests.cpp:30
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::nF
VectorDouble nF
local right hand side vector
Definition: EshelbianPlasticity.hpp:371
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
EshelbianPlasticity::OpSpatialPhysical::alphaU
const double alphaU
Definition: EshelbianPlasticity.hpp:534
MoFEM::EntitiesFieldData::EntData::getFTensor0N
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
Definition: EntitiesFieldData.hpp:1489
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
EshelbianPlasticity::OpSpatialPhysical::integratePolyconvexHencky
MoFEMErrorCode integratePolyconvexHencky(EntData &data)
Definition: EshelbianOperators.cpp:668
a
constexpr double a
Definition: approx_sphere.cpp:30
EshelbianPlasticity::OpSpatialPhysical::integrateHencky
MoFEMErrorCode integrateHencky(EntData &data)
Definition: EshelbianOperators.cpp:610
MoFEM::EntitiesFieldData::EntData::getIndices
const VectorInt & getIndices() const
Get global indices of dofs on entity.
Definition: EntitiesFieldData.hpp:1201
MoFEM::L
VectorDouble L
Definition: Projection10NodeCoordsOnField.cpp:124
EshelbianPlasticity::OpAssembleBasic< VolUserDataOperator >::dataAtPts
boost::shared_ptr< DataAtIntegrationPts > dataAtPts
data at integration pts
Definition: EshelbianPlasticity.hpp:357
EshelbianPlasticity::diff_deviator
auto diff_deviator(FTensor::Ddg< double, 3, 3 > &&t_diff_stress)
Definition: EshelbianOperators.cpp:20
EshelbianPlasticity::OpSpatialPhysical::integratePiola
MoFEMErrorCode integratePiola(EntData &data)
Definition: EshelbianOperators.cpp:753
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: EshelbianOperators.cpp:60
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:1305
EshelbianPlasticity::OpSpatialPhysical::polyConvex
PetscBool polyConvex
Definition: EshelbianPlasticity.hpp:535
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
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:463
third
constexpr double third
Definition: EshelbianADOL-C.cpp:14
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:416
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
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