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

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

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

Public Member Functions

 OpCalculateConstraintLhs_dTAU (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 195 of file PlasticOperators.hpp.

Constructor & Destructor Documentation

◆ OpCalculateConstraintLhs_dTAU()

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

Definition at line 1026 of file PlasticOperators.cpp.

1029 : DomainEleOpAssembly(row_field_name, col_field_name,
1031 commonDataPtr(common_data_ptr) {
1032 sYmm = false;
1033}
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_dTAU::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 1035 of file PlasticOperators.cpp.

1036 {
1038
1039 const size_t nb_row_dofs = row_data.getIndices().size();
1040 const size_t nb_col_dofs = col_data.getIndices().size();
1041 if (nb_row_dofs && nb_col_dofs) {
1042
1043 auto get_dt = [&]() {
1044 double dt;
1045 CHKERR TSGetTimeStep(getFEMethod()->ts, &dt);
1046 dt = 1;
1047 return dt;
1048 };
1049 const auto dt = get_dt();
1050
1051 const size_t nb_integration_pts = row_data.getN().size1();
1052 const size_t nb_row_base_functions = row_data.getN().size2();
1053 auto t_w = getFTensor0IntegrationWeight();
1054 auto t_f = getFTensor0FromVec(*(commonDataPtr->plasticSurfacePtr));
1055 auto t_tau = getFTensor0FromVec(*(commonDataPtr->plasticTauPtr));
1056 auto t_tau_dot = getFTensor0FromVec(*(commonDataPtr->plasticTauDotPtr));
1057
1058 auto t_omega = getFTensor1FromMat<3>(*commonDataPtr->guidingVelocityPtr);
1059 bool is_rotating = commonDataPtr->guidingVelocityPtr->size2() > 1;
1060
1061 auto &cn = (*cache).cn_pl;
1062
1063 auto get_row_base = [&]() {
1064 if (commonDataPtr->isDualBase) {
1065 double *base_ptr = &*commonDataPtr->dualBaseMat.data().begin();
1066 return Tensor0<PackPtr<double *, 1>>(base_ptr);
1067 } else {
1068 return row_data.getFTensor0N();
1069 }
1070 };
1071 auto t_row_base = get_row_base();
1072
1073 for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
1074 const double alpha = dt * getMeasure() * t_w * (*cache).scale_constraint;
1075 const double t_a = getTSa();
1076 const double c0 =
1077 alpha * /* t_a * */
1078 diff_constrain_dtau_dot(t_tau_dot, t_f, hardening(t_tau));
1079 const double c1 =
1080 alpha * diff_constrain_dsigma_y(t_tau_dot, t_f, hardening(t_tau)) *
1081 hardening_dtau(t_tau);
1082
1083 auto mat_ptr = locMat.data().begin();
1084
1085 size_t rr = 0;
1086 for (; rr != nb_row_dofs; ++rr) {
1087
1088 auto t_col_base = col_data.getFTensor0N(gg, 0);
1089 auto t_col_diff_base = col_data.getFTensor1DiffN<3>(gg, 0);
1090 for (size_t cc = 0; cc != nb_col_dofs; ++cc) {
1091 if (!is_rotating) {
1092 *mat_ptr += (c0 * t_a + c1) * t_row_base * t_col_base;
1093
1094 } else {
1095 const double c0_p =
1096 c0 * (t_col_base * t_a + (t_col_diff_base(i) * t_omega(i)));
1097 *mat_ptr += (c0_p + c1 * t_col_base) * t_row_base;
1098 }
1099
1100 ++mat_ptr;
1101 ++t_col_base;
1102 ++t_col_diff_base;
1103 }
1104 ++t_row_base;
1105 }
1106 for (; rr < nb_row_base_functions; ++rr)
1107 ++t_row_base;
1108
1109 if (is_rotating)
1110 ++t_omega;
1111
1112 ++t_w;
1113 ++t_f;
1114 ++t_tau;
1115 ++t_tau_dot;
1116 }
1117 }
1118
1120}
#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
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
double diff_constrain_dtau_dot(long double tau_dot, long double f, long double hardening)
auto diff_constrain_dsigma_y(long double tau_dot, long double f, long double hardening)
auto hardening_dtau(long double tau)
auto hardening(long double tau)
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

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

Definition at line 202 of file PlasticOperators.hpp.


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