template <int DIM, typename AssemblyDomainEleOp>
struct OpCalculatePlasticInternalForceLhs_LogStrain_dEPImpl<DIM,
GAUSS,
OpCalculatePlasticInternalForceLhs_LogStrain_dEPImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<HenckyOps::CommonData> common_hencky_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
boost::shared_ptr<MatrixDouble> mDPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticInternalForceLhs_LogStrain_dEPImpl<DIM,
GAUSS,
OpCalculatePlasticInternalForceLhs_LogStrain_dEPImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<HenckyOps::CommonData> common_hencky_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr)
AssemblyDomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr),
commonHenckyDataPtr(common_hencky_data_ptr), mDPtr(m_D_ptr) {
AssemblyDomainEleOp::sYmm = false;
}
template <int DIM, typename AssemblyDomainEleOp>
constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
const size_t nb_integration_pts = row_data.getN().size1();
const size_t nb_row_base_functions = row_data.getN().size2();
resDiff.resize(DIM * DIM *
size_symm, nb_integration_pts,
false);
auto t_res_diff = getFTensor3FromMat<DIM, DIM, size_symm>(resDiff);
auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*mDPtr);
auto t_logC_dC =
getFTensor4DdgFromMat<DIM, DIM>(commonHenckyDataPtr->matLogCdC);
auto t_grad =
getFTensor2FromMat<DIM, DIM>(*(commonHenckyDataPtr->matGradPtr));
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
t_DLogC_dC(
i,
j,
k,
l) = t_D(
m,
n,
k,
l) * t_logC_dC(
m,
n,
i,
j);
t_FDLogC_dC(
i,
j,
k,
l) = t_F(
i,
m) * t_DLogC_dC(
m,
j,
k,
l);
t_res_diff(
i,
j,
L) = t_FDLogC_dC(
i,
j,
k,
l) * t_L(
k,
l,
L);
++t_logC_dC;
++t_grad;
++t_res_diff;
}
}
auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
auto t_row_diff_base = row_data.getFTensor1DiffN<DIM>();
auto t_res_diff = getFTensor3FromMat<DIM, DIM, size_symm>(resDiff);
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
size_t rr = 0;
auto t_mat =
t_tmp(
i,
L) = (t_res_diff(
i,
j,
L) * (alpha * t_row_diff_base(
j)));
auto t_col_base = col_data.getFTensor0N(gg, 0);
t_mat(
i,
L) -= (t_col_base * t_tmp(
i,
L));
++t_mat;
++t_col_base;
}
++t_row_diff_base;
}
for (; rr < nb_row_base_functions; ++rr)
++t_row_diff_base;
++t_w;
++t_res_diff;
}
}
template <int DIM, typename AssemblyDomainEleOp>
struct OpCalculatePlasticFlowLhs_LogStrain_dUImpl<DIM,
GAUSS,
OpCalculatePlasticFlowLhs_LogStrain_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<HenckyOps::CommonData> common_hencky_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
boost::shared_ptr<MatrixDouble> mDPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticFlowLhs_LogStrain_dUImpl<DIM, GAUSS, AssemblyDomainEleOp>::
OpCalculatePlasticFlowLhs_LogStrain_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<HenckyOps::CommonData> common_hencky_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr)
AssemblyDomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr),
commonHenckyDataPtr(common_hencky_data_ptr), mDPtr(m_D_ptr) {
AssemblyDomainEleOp::sYmm = false;
}
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticFlowLhs_LogStrain_dUImpl<DIM, GAUSS, AssemblyDomainEleOp>::
constexpr
auto size_symm = (DIM * (DIM + 1)) / 2;
const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
const auto nb_row_base_functions = row_data.getN().size2();
resDiff.resize(
size_symm * DIM * DIM, nb_integration_pts,
false);
auto t_res_diff = getFTensor3FromMat<size_symm, DIM, DIM>(resDiff);
auto t_res_flow_dstrain =
getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->resFlowDstrain);
auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->mGradPtr));
auto t_logC_dC =
getFTensor4DdgFromMat<DIM, DIM>(commonHenckyDataPtr->matLogCdC);
auto next = [&]() {
++t_res_flow_dstrain;
++t_grad;
++t_logC_dC;
++t_res_diff;
};
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
t_diff_ls_dlogC_dC(
i,
j,
k,
l) =
(t_res_flow_dstrain(
i,
j,
m,
n)) * (t_logC_dC(
m,
n,
k,
l) / 2);
(t_L(
m,
n,
L) * t_diff_ls_dlogC_dC(
m,
n,
k,
l)) * t_dC_dF(
k,
l,
i,
j);
next();
}
}
auto t_res_diff = getFTensor3FromMat<size_symm, DIM, DIM>(resDiff);
auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
auto t_row_base = row_data.getFTensor0N();
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
++t_w;
size_t rr = 0;
const auto row_base = alpha * t_row_base;
auto t_mat =
auto t_col_diff_base = col_data.getFTensor1DiffN<DIM>(gg, 0);
t_mat(
L,
l) += row_base * (t_res_diff(
L,
l,
k) * t_col_diff_base(
k));
++t_mat;
++t_col_diff_base;
}
++t_row_base;
}
for (; rr < nb_row_base_functions; ++rr)
++t_row_base;
++t_res_diff;
}
}
template <int DIM, typename AssemblyDomainEleOp>
OpCalculateConstraintsLhs_LogStrain_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<HenckyOps::CommonData> common_hencky_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
boost::shared_ptr<HenckyOps::CommonData> commonHenckyDataPtr;
boost::shared_ptr<MatrixDouble> mDPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
OpCalculateConstraintsLhs_LogStrain_dUImpl<DIM, GAUSS, AssemblyDomainEleOp>::
OpCalculateConstraintsLhs_LogStrain_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<HenckyOps::CommonData> common_hencky_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr)
DomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr),
commonHenckyDataPtr(common_hencky_data_ptr), mDPtr(m_D_ptr) {
AssemblyDomainEleOp::sYmm = false;
}
template <int DIM, typename AssemblyDomainEleOp>
OpCalculateConstraintsLhs_LogStrain_dUImpl<DIM, GAUSS, AssemblyDomainEleOp>::
false);
const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
const auto nb_row_base_functions = row_data.getN().size2();
resDiff.resize(DIM * DIM, nb_integration_pts, false);
auto t_res_diff = getFTensor2FromMat<DIM, DIM>(resDiff);
auto t_grad = getFTensor2FromMat<DIM, DIM>(*(commonDataPtr->mGradPtr));
auto t_logC_dC =
getFTensor4DdgFromMat<DIM, DIM>(commonHenckyDataPtr->matLogCdC);
auto t_c_dstrain =
getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resCdStrain);
auto next = [&]() {
++t_grad;
++t_logC_dC;
++t_c_dstrain;
++t_res_diff;
};
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
(t_c_dstrain(
i,
j)) * (t_logC_dC(
i,
j,
k,
l) / 2);
t_res_diff(
i,
j) = (t_diff_ls_dlog_c(
k,
l) * t_dC_dF(
k,
l,
i,
j));
next();
}
}
auto t_res_diff = getFTensor2FromMat<DIM, DIM>(resDiff);
auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
auto t_row_base = row_data.getFTensor0N();
for (auto gg = 0; gg != nb_integration_pts; ++gg) {
double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
++t_w;
auto t_mat =
size_t rr = 0;
const auto row_base = alpha * t_row_base;
auto t_col_diff_base = col_data.getFTensor1DiffN<DIM>(gg, 0);
t_mat(
i) += row_base * (t_res_diff(
i,
j) * t_col_diff_base(
j));
++t_mat;
++t_col_diff_base;
}
++t_row_base;
}
for (; rr != nb_row_base_functions; ++rr)
++t_row_base;
++t_res_diff;
}
}
};