v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculateConstraintLhs_dEP Struct Reference

#include <users_modules/multifield_plasticity/src/PlasticOperators.hpp>

Inheritance diagram for OpPlasticTools::OpCalculateConstraintLhs_dEP:
[legend]
Collaboration diagram for OpPlasticTools::OpCalculateConstraintLhs_dEP:
[legend]

Public Member Functions

 OpCalculateConstraintLhs_dEP (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 185 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateConstraintLhs_dEP()

OpPlasticTools::OpCalculateConstraintLhs_dEP::OpCalculateConstraintLhs_dEP ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 931 of file PlasticOperators.cpp.

934 : DomainEleOpAssembly(row_field_name, col_field_name,
936 commonDataPtr(common_data_ptr) {
937 sYmm = false;
938}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::OpBase DomainEleOpAssembly
@ OPROWCOL
operator doWork is executed on FE rows &columns
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpPlasticTools::OpCalculateConstraintLhs_dEP::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 940 of file PlasticOperators.cpp.

941 {
943
944 const size_t nb_row_dofs = row_data.getIndices().size();
945 const size_t nb_col_dofs = col_data.getIndices().size();
946 if (nb_row_dofs && nb_col_dofs) {
947
948 auto get_dt = [&]() {
949 double dt;
950 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
951 dt = 1;
952 return dt;
953 };
954 const auto dt = get_dt();
955
956 const size_t nb_integration_pts = row_data.getN().size1();
957 const size_t nb_row_base_functions = row_data.getN().size2();
958 auto t_w = getFTensor0IntegrationWeight();
959
960 auto get_row_base = [&]() {
961 if (commonDataPtr->isDualBase) {
962 double *base_ptr = &*commonDataPtr->dualBaseMat.data().begin();
963 return Tensor0<PackPtr<double *, 1>>(base_ptr);
964 } else {
965 return row_data.getFTensor0N();
966 }
967 };
968 auto t_row_base = get_row_base();
969
970 auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
971 auto t_tau = getFTensor0FromVec(*(commonDataPtr->plasticTauPtr));
972 auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
973 auto t_flow =
974 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticFlowPtr));
975
976 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD);
977 auto t_D_Deviator =
978 getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD_Deviator);
979
980 auto t_diff_symmetrize = diff_symmetrize();
982 auto t_L = symm_L_tensor();
983
984 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
985 double alpha = dt * getMeasure() * t_w * (*cache).scale_constraint;
986
987 auto mat_ptr = locMat.data().begin();
988 auto t_diff_constrain_dstrain = diff_constrain_kin_hard_dstrain(
989 t_D_Deviator,
991 diff_constrain_df(t_tau_dot, t_f, hardening(t_tau)), t_flow));
992
993 Tensor1<PackPtr<double *, 6>, 6> t_mat(&locMat(0, 0), &locMat(0, 1),
994 &locMat(0, 2), &locMat(0, 3),
995 &locMat(0, 4), &locMat(0, 5));
996
997 size_t rr = 0;
998 for (; rr != nb_row_dofs; ++rr) {
999
1000 auto t_col_base = col_data.getFTensor0N(gg, 0);
1001 for (size_t cc = 0; cc != nb_col_dofs / 6; cc++) {
1002
1003 t_mat(L) -= (alpha * t_row_base * t_col_base) *
1004 (t_diff_constrain_dstrain(i, j) * t_L(i, j, L));
1005
1006 ++t_mat;
1007 ++t_col_base;
1008 }
1009
1010 ++t_row_base;
1011 }
1012 for (; rr != nb_row_base_functions; ++rr)
1013 ++t_row_base;
1014
1015 ++t_f;
1016 ++t_tau;
1017 ++t_tau_dot;
1018 ++t_flow;
1019 ++t_w;
1020 }
1021 }
1022
1024}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
FTensor::Index< 'i', SPACE_DIM > i
double dt
Definition: heat_method.cpp:26
FTensor::Index< 'j', 3 > j
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
auto diff_constrain_kin_hard_dstrain(Ddg< T1, 3, 3 > &t_D, Tensor2_symmetric< T2, 3 > &&t_diff_constrain_dstress)
auto diff_constrain_df(long double tau_dot, long double f, long double hardening)
auto hardening(long double tau)
auto diff_constrain_dstress(long double &&diff_constrain_df, Tensor2_symmetric< T, 3 > &t_plastic_flow)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpPlasticTools::OpCalculateConstraintLhs_dEP::commonDataPtr
private

Definition at line 192 of file PlasticOperators.hpp.


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