v0.16.0
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp > Struct Template Reference

#include "users_modules/multifield-thermoplasticity-private/tutorials/adv-0/src/PlasticOpsGeneric.hpp"

Inheritance diagram for PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >:
[legend]
Collaboration diagram for PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >:
[legend]

Public Member Functions

 OpCalculatePlasticityWithoutRatesImpl (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< MatrixDouble > m_D_ptr, boost::shared_ptr< ThermoPlasticOps::ThermoPlasticBlockedParameters > tp_common_data_ptr=nullptr)
 
MoFEMErrorCode doWork (int side, EntityType type, EntData &data)
 

Protected Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
boost::shared_ptr< ThermoPlasticOps::ThermoPlasticBlockedParametersTPCommonDataPtr
 
boost::shared_ptr< MatrixDouble > mDPtr
 

Detailed Description

template<int DIM, typename DomainEleOp>
struct PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >

Definition at line 812 of file PlasticOpsGeneric.hpp.

Constructor & Destructor Documentation

◆ OpCalculatePlasticityWithoutRatesImpl()

template<int DIM, typename DomainEleOp >
PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >::OpCalculatePlasticityWithoutRatesImpl ( const std::string  field_name,
boost::shared_ptr< CommonData common_data_ptr,
boost::shared_ptr< MatrixDouble >  m_D_ptr,
boost::shared_ptr< ThermoPlasticOps::ThermoPlasticBlockedParameters tp_common_data_ptr = nullptr 
)

Definition at line 829 of file PlasticOpsGeneric.hpp.

834 : DomainEleOp(field_name, DomainEleOp::OPROW),
835 commonDataPtr(common_data_ptr), mDPtr(m_D_ptr),
836 TPCommonDataPtr(tp_common_data_ptr) {
837 // Opetor is only executed for vertices
838 std::fill(&DomainEleOp::doEntities[MBEDGE],
839 &DomainEleOp::doEntities[MBMAXTYPE], false);
840}
DomainEle::UserDataOperator DomainEleOp
Finire element operator type.
constexpr auto field_name
boost::shared_ptr< ThermoPlasticOps::ThermoPlasticBlockedParameters > TPCommonDataPtr

Member Function Documentation

◆ doWork()

template<int DIM, typename DomainEleOp >
MoFEMErrorCode PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >::doWork ( int  side,
EntityType  type,
EntData data 
)

< material parameters

Definition at line 843 of file PlasticOpsGeneric.hpp.

844 {
846
847 FTensor::Index<'i', DIM> i;
848 FTensor::Index<'j', DIM> j;
849 FTensor::Index<'k', DIM> k;
850 FTensor::Index<'l', DIM> l;
851 FTensor::Index<'m', DIM> m;
852 FTensor::Index<'n', DIM> n;
853
854 auto &params = commonDataPtr->blockParams; ///< material parameters
855
856 const size_t nb_gauss_pts = DomainEleOp::getGaussPts().size2();
857 auto t_w = DomainEleOp::getFTensor0IntegrationWeight();
858 auto t_tau = getFTensor0FromVec(commonDataPtr->plasticTau);
859 auto t_tau_dot = getFTensor0FromVec(commonDataPtr->plasticTauDot);
860 auto t_f = getFTensor0FromVec(commonDataPtr->plasticSurface);
861 auto t_flow = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->plasticFlow);
862 auto t_plastic_strain =
863 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->plasticStrain);
864 auto t_stress =
865 getFTensor2SymmetricFromMat<DIM>(*(commonDataPtr->mStressPtr));
866
867 auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*commonDataPtr->mDPtr);
868 auto t_D_Op = getFTensor4DdgFromMat<DIM, DIM, 0>(*mDPtr);
869
870 auto t_temp = getFTensor0FromVec(TPCommonDataPtr->temperature);
871
872 auto t_diff_plastic_strain = diffTensor(FTensor::Number<DIM>());
873 auto t_diff_deviator = diff_deviator(diffTensor(FTensor::Number<DIM>()));
874
875 FTensor::Ddg<double, DIM, DIM> t_flow_dir_dstress;
876 FTensor::Ddg<double, DIM, DIM> t_flow_dir_dstrain;
877 t_flow_dir_dstress(i, j, k, l) =
878 1.5 * (t_diff_deviator(M, N, i, j) * t_diff_deviator(M, N, k, l));
879 t_flow_dir_dstrain(i, j, k, l) =
880 t_flow_dir_dstress(i, j, m, n) * t_D_Op(m, n, k, l);
881
882 auto t_alpha_dir =
883 kinematic_hardening_dplastic_strain<DIM>(params[CommonData::C1_k]);
884
885 commonDataPtr->resC.resize(nb_gauss_pts, false);
886 commonDataPtr->resCdTau.resize(nb_gauss_pts, false);
887 commonDataPtr->resCdStrain.resize(size_symm, nb_gauss_pts, false);
888 commonDataPtr->resCdPlasticStrain.resize(size_symm, nb_gauss_pts, false);
889 TPCommonDataPtr->resCdTemperature.resize(nb_gauss_pts, false);
890 commonDataPtr->resFlow.resize(size_symm, nb_gauss_pts, false);
891 commonDataPtr->resFlowDtau.resize(size_symm, nb_gauss_pts, false);
892 commonDataPtr->resFlowDstrain.resize(size_symm * size_symm, nb_gauss_pts,
893 false);
894 commonDataPtr->resFlowDstrainDot.resize(size_symm * size_symm, nb_gauss_pts,
895 false);
896 TPCommonDataPtr->resFlowDtemp.resize(size_symm, nb_gauss_pts, false);
897
898 commonDataPtr->resC.clear();
899 commonDataPtr->resCdTau.clear();
900 commonDataPtr->resCdStrain.clear();
901 commonDataPtr->resCdPlasticStrain.clear();
902 TPCommonDataPtr->resCdTemperature.clear();
903 commonDataPtr->resFlow.clear();
904 commonDataPtr->resFlowDtau.clear();
905 commonDataPtr->resFlowDstrain.clear();
906 commonDataPtr->resFlowDstrainDot.clear();
907 TPCommonDataPtr->resFlowDtemp.clear();
908
909 auto t_res_c = getFTensor0FromVec(commonDataPtr->resC);
910 auto t_res_c_dtau = getFTensor0FromVec(commonDataPtr->resCdTau);
911 auto t_res_c_dstrain =
912 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resCdStrain);
913 auto t_res_c_plastic_strain =
914 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resCdPlasticStrain);
915 auto t_res_c_temperature =
916 getFTensor0FromVec(TPCommonDataPtr->resCdTemperature);
917 auto t_res_flow = getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resFlow);
918 auto t_res_flow_dtau =
919 getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resFlowDtau);
920 auto t_res_flow_dstrain =
921 getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->resFlowDstrain);
922 auto t_res_flow_dplastic_strain =
923 getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->resFlowDstrainDot);
924 auto t_res_flow_dtemp =
925 getFTensor2SymmetricFromMat<DIM>(TPCommonDataPtr->resFlowDtemp);
926
927 auto next = [&]() {
928 ++t_tau;
929 ++t_tau_dot;
930 ++t_f;
931 ++t_flow;
932 ++t_plastic_strain;
933 ++t_stress;
934 ++t_res_c;
935 ++t_res_c_dtau;
936 ++t_res_c_dstrain;
937 ++t_res_c_plastic_strain;
938 ++t_res_c_temperature;
939 ++t_res_flow;
940 ++t_res_flow_dtau;
941 ++t_res_flow_dstrain;
942 ++t_res_flow_dplastic_strain;
943 ++t_res_flow_dtemp;
944 ++t_w;
945 ++t_temp;
946 };
947
948 auto get_avtive_pts = [&]() {
949 int nb_points_avtive_on_elem = 0;
950 int nb_points_on_elem = 0;
951
952 auto t_tau = getFTensor0FromVec(commonDataPtr->plasticTau);
953 auto t_tau_dot = getFTensor0FromVec(commonDataPtr->plasticTauDot);
954 auto t_f = getFTensor0FromVec(commonDataPtr->plasticSurface);
955 auto t_plastic_strain_dot =
956 getFTensor2SymmetricFromMat<SPACE_DIM>(commonDataPtr->plasticStrainDot);
957 auto t_temp = getFTensor0FromVec(TPCommonDataPtr->temperature);
958
959 auto dt = this->getTStimeStep();
960
961 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
962 auto eqiv = equivalent_strain_dot(t_plastic_strain_dot);
963 const auto ww =
964 w(eqiv, t_tau_dot, t_f,
965 iso_hardening(t_tau, params[CommonData::H], TPCommonDataPtr->omega0,
966 params[CommonData::QINF], TPCommonDataPtr->omegaH,
967 params[CommonData::BISO], params[CommonData::SIGMA_Y],
968 TPCommonDataPtr->temp0, t_temp),
969 params[CommonData::SIGMA_Y]);
970 const auto sign_ww = constrian_sign(ww, dt);
971
972 ++nb_points_on_elem;
973 if (sign_ww > 0) {
974 ++nb_points_avtive_on_elem;
975 }
976
977 ++t_tau;
978 ++t_tau_dot;
979 ++t_f;
980 ++t_plastic_strain_dot;
981 ++t_temp;
982 }
983
984 int &active_points = PlasticOps::CommonData::activityData[0];
985 int &avtive_full_elems = PlasticOps::CommonData::activityData[1];
986 int &avtive_elems = PlasticOps::CommonData::activityData[2];
987 int &nb_points = PlasticOps::CommonData::activityData[3];
988 int &nb_elements = PlasticOps::CommonData::activityData[4];
989
990 ++nb_elements;
991 nb_points += nb_points_on_elem;
992 if (nb_points_avtive_on_elem > 0) {
993 ++avtive_elems;
994 active_points += nb_points_avtive_on_elem;
995 if (nb_points_avtive_on_elem == nb_points_on_elem) {
996 ++avtive_full_elems;
997 }
998 }
999
1000 if (nb_points_avtive_on_elem != nb_points_on_elem)
1001 return 1;
1002 else
1003 return 0;
1004 };
1005
1006 if (DomainEleOp::getTSCtx() == TSMethod::TSContext::CTX_TSSETIJACOBIAN) {
1007 get_avtive_pts();
1008 }
1009
1010 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
1011
1012 double eqiv;
1014
1015 double c_dot_tau, c_sigma_y, c, c_f, c_equiv;
1016
1017 eqiv = 0.0;
1018 t_diff_eqiv(i, j) = 0.0;
1019 c = 0.0;
1020 c_dot_tau = 0.0;
1021 c_equiv = 0.0;
1022 c_sigma_y = 0.0;
1023 c_f = 0.0;
1024
1025 auto t_dev_stress = deviator(
1026
1027 t_stress, trace(t_stress),
1028
1029 kinematic_hardening(t_plastic_strain, params[CommonData::C1_k])
1030
1031 );
1032
1033 next();
1034 }
1035
1037}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'i', SPACE_DIM > i
double dt
const double c
speed of light (cm/ns)
const double n
refractive index of diffusive medium
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
FTensor::Index< 'N', 3 > N
double constrian_sign(double x, double dt)
auto diff_deviator(FTensor::Ddg< double, DIM, DIM > &&t_diff_stress, FTensor::Number< DIM >)
double trace(FTensor::Tensor2_symmetric< T, 2 > &t_stress)
auto deviator(FTensor::Tensor2_symmetric< T, DIM > &t_stress, double trace, FTensor::Tensor2_symmetric< double, DIM > &t_alpha, FTensor::Number< DIM >)
double w(double eqiv, double dot_tau, double f, double sigma_y, double sigma_Y)
auto equivalent_strain_dot(FTensor::Tensor2_symmetric< T, DIM > &t_plastic_strain_dot)
FTensor::Index< 'm', 3 > m
static std::array< int, 5 > activityData
auto kinematic_hardening(FTensor::Tensor2_symmetric< T, DIM > &t_plastic_strain, double C1_k)
Definition plastic.cpp:93
constexpr auto size_symm
Definition plastic.cpp:42
double iso_hardening(double tau, double H, double Qinf, double b_iso, double sigmaY)
Definition plastic.cpp:74

Member Data Documentation

◆ commonDataPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<CommonData> PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >::commonDataPtr
protected

Definition at line 822 of file PlasticOpsGeneric.hpp.

◆ mDPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<MatrixDouble> PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >::mDPtr
protected

Definition at line 825 of file PlasticOpsGeneric.hpp.

◆ TPCommonDataPtr

template<int DIM, typename DomainEleOp >
boost::shared_ptr<ThermoPlasticOps::ThermoPlasticBlockedParameters> PlasticOps::OpCalculatePlasticityWithoutRatesImpl< DIM, GAUSS, DomainEleOp >::TPCommonDataPtr
protected

Definition at line 824 of file PlasticOpsGeneric.hpp.


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