v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN > Struct Template Reference

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

Inheritance diagram for OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN >:
[legend]
Collaboration diagram for OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN >:
[legend]

Public Member Functions

 OpCalculateConstraintLhs_dU (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

template<bool LOGSTRAIN>
struct OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN >

Definition at line 175 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateConstraintLhs_dU()

template<bool LOGSTRAIN>
OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN >::OpCalculateConstraintLhs_dU ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 820 of file PlasticOperators.cpp.

823 : DomainEleOpAssembly(row_field_name, col_field_name,
825 commonDataPtr(common_data_ptr) {
826 sYmm = false;
827}
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()

template<bool LOGSTRAIN>
MoFEMErrorCode OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN >::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 829 of file PlasticOperators.cpp.

831 {
833
834 const size_t nb_row_dofs = row_data.getIndices().size();
835 const size_t nb_col_dofs = col_data.getIndices().size();
836 if (nb_row_dofs && nb_col_dofs) {
837
838 auto get_dt = [&]() {
839 double dt;
840 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
841 dt = 1;
842 return dt;
843 };
844 const auto dt = get_dt();
845
846 const size_t nb_integration_pts = row_data.getN().size1();
847 const size_t nb_row_base_functions = row_data.getN().size2();
848 auto t_w = getFTensor0IntegrationWeight();
849
850 auto get_row_base = [&]() {
851 if (commonDataPtr->isDualBase) {
852 double *base_ptr = &*commonDataPtr->dualBaseMat.data().begin();
853 return Tensor0<PackPtr<double *, 1>>(base_ptr);
854 } else {
855 return row_data.getFTensor0N();
856 }
857 };
858 auto t_row_base = get_row_base();
859
860 auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
861 auto t_tau = getFTensor0FromVec(*(commonDataPtr->plasticTauPtr));
862 auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
863 auto t_flow =
864 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->plasticFlowPtr));
865 auto t_stress =
866 getFTensor2SymmetricFromMat<3>(*(commonDataPtr->mStressPtr));
867 auto t_D = getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD);
868 auto t_D_Deviator =
869 getFTensor4DdgFromMat<3, 3, 0>(*commonDataPtr->mtD_Deviator);
870 auto t_diff_symmetrize = diff_symmetrize();
871
872 MatrixDouble &dE_dF = *(commonDataPtr->dE_dF_mat);
873 auto t_dE_dF = getFTensor4FromMat<3, 3, 3, 3>(dE_dF);
874
875 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
876 double alpha = dt * getMeasure() * t_w * (*cache).scale_constraint;
877
878 auto t_diff_constrain_dstrain = diff_constrain_dstrain(
879 t_D_Deviator,
881 diff_constrain_df(t_tau_dot, t_f, hardening(t_tau)), t_flow));
882
883 Tensor2<double, 3, 3> t_diff_constrain_dgrad;
884 if (!LOGSTRAIN) {
885
886 t_diff_constrain_dgrad(k, l) =
887 t_diff_constrain_dstrain(i, j) * t_diff_symmetrize(i, j, k, l);
888 } else {
889
890 Tensor2<double, 3, 3> t_diff_constrain_dgrads;
891 t_diff_constrain_dgrad(k, l) =
892 t_diff_constrain_dstrain(i, j) * t_dE_dF(i, j, k, l);
893 }
894
895 Tensor1<PackPtr<double *, 3>, 3> t_mat{&locMat(0, 0), &locMat(0, 1),
896 &locMat(0, 2)};
897
898 size_t rr = 0;
899 for (; rr != nb_row_dofs; ++rr) {
900
901 auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
902 for (size_t cc = 0; cc != nb_col_dofs / 3; cc++) {
903
904 t_mat(i) += alpha * t_row_base * t_diff_constrain_dgrad(i, j) *
905 t_col_diff_base(j);
906
907 ++t_mat;
908 ++t_col_diff_base;
909 }
910
911 ++t_row_base;
912 }
913 for (; rr != nb_row_base_functions; ++rr)
914 ++t_row_base;
915
916 if (LOGSTRAIN)
917 ++t_dE_dF;
918
919 ++t_f;
920 ++t_tau;
921 ++t_tau_dot;
922 ++t_flow;
923 ++t_stress;
924 ++t_w;
925 }
926 }
927
929}
#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< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
auto diff_constrain_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::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1DiffN(const FieldApproximationBase base)
Get derivatives of base functions.
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

template<bool LOGSTRAIN>
boost::shared_ptr<CommonData> OpPlasticTools::OpCalculateConstraintLhs_dU< LOGSTRAIN >::commonDataPtr
private

Definition at line 182 of file PlasticOperators.hpp.


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