template <int DIM, typename AssemblyDomainEleOp>
struct OpCalculatePlasticInternalForceLhs_dEPImpl<DIM,
GAUSS,
OpCalculatePlasticInternalForceLhs_dEPImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
boost::shared_ptr<MatrixDouble> mDPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticInternalForceLhs_dEPImpl<DIM, GAUSS, AssemblyDomainEleOp>::
OpCalculatePlasticInternalForceLhs_dEPImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr)
AssemblyDomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
AssemblyDomainEleOp::sYmm = false;
}
&mat(2 * rr + 0, 0), &mat(2 * rr + 0, 1), &mat(2 * rr + 0, 2),
&mat(2 * rr + 1, 0), &mat(2 * rr + 1, 1), &mat(2 * rr + 1, 2)};
}
&mat(3 * rr + 0, 0), &mat(3 * rr + 0, 1), &mat(3 * rr + 0, 2),
&mat(3 * rr + 0, 3), &mat(3 * rr + 0, 4), &mat(3 * rr + 0, 5),
&mat(3 * rr + 1, 0), &mat(3 * rr + 1, 1), &mat(3 * rr + 1, 2),
&mat(3 * rr + 1, 3), &mat(3 * rr + 1, 4), &mat(3 * rr + 1, 5),
&mat(3 * rr + 2, 0), &mat(3 * rr + 2, 1), &mat(3 * rr + 2, 2),
&mat(3 * rr + 2, 3), &mat(3 * rr + 2, 4), &mat(3 * rr + 2, 5)};
}
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticInternalForceLhs_dEPImpl<DIM, GAUSS, 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();
auto t_D = getFTensor4DdgFromMat<DIM, DIM, 0>(*mDPtr);
auto t_w = AssemblyDomainEleOp::getFTensor0IntegrationWeight();
auto t_row_diff_base = row_data.getFTensor1DiffN<DIM>();
for (size_t gg = 0; gg != nb_integration_pts; ++gg) {
double alpha = AssemblyDomainEleOp::getMeasure() * t_w;
++t_w;
size_t rr = 0;
auto t_mat =
t_tmp(
i,
L) = (t_DL(
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;
}
}
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticFlowLhs_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
boost::shared_ptr<MatrixDouble> mDPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
OpCalculatePlasticFlowLhs_dUImpl<DIM, GAUSS, AssemblyDomainEleOp>::
OpCalculatePlasticFlowLhs_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr)
AssemblyDomainEleOp::OPROWCOL),
commonDataPtr(common_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 = AssemblyDomainEleOp::getGaussPts().size2();
const size_t nb_row_base_functions = row_data.getN().size2();
auto t_res_flow_dstrain =
getFTensor4DdgFromMat<DIM, DIM>(commonDataPtr->resFlowDstrain);
auto next = [&]() { ++t_res_flow_dstrain; };
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;
alpha * ((t_L(
m,
n,
L) * (t_res_flow_dstrain(
m,
n,
k,
l))) *
t_diff_grad(
k,
l,
i,
j));
next();
size_t rr = 0;
auto t_mat =
auto t_col_diff_base = col_data.getFTensor1DiffN<DIM>(gg, 0);
t_mat(
L,
l) += t_row_base * (t_res_tens(
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;
}
}
template <int DIM, typename AssemblyDomainEleOp>
OpCalculateConstraintsLhs_dUImpl<DIM, GAUSS, AssemblyDomainEleOp>::
OpCalculateConstraintsLhs_dUImpl(
const std::string row_field_name, const std::string col_field_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<MatrixDouble> m_D_ptr)
DomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr), mDPtr(m_D_ptr) {
AssemblyDomainEleOp::sYmm = false;
}
template <int DIM, typename AssemblyDomainEleOp>
const auto nb_integration_pts = AssemblyDomainEleOp::getGaussPts().size2();
const auto nb_row_base_functions = row_data.getN().size2();
auto t_c_dstrain =
getFTensor2SymmetricFromMat<DIM>(commonDataPtr->resCdStrain);
auto next = [&]() { ++t_c_dstrain; };
auto get_mat_scalar_dvector = [&]() {
if constexpr (DIM == 2)
&locMat(0, 1)};
else
&locMat(0, 0), &locMat(0, 1), &locMat(0, 2)};
};
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;
((t_c_dstrain(
k,
l)) * t_diff_grad_symmetrise(
k,
l,
i,
j));
next();
auto t_mat = get_mat_scalar_dvector();
size_t rr = 0;
const double row_base = alpha * t_row_base;
auto t_col_diff_base = col_data.getFTensor1DiffN<DIM>(gg, 0);
t_mat(
i) += row_base * (t_res_mat(
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;
}
}
};