#ifndef __ADOLCPLASTICITY_HPP_
#define __ADOLCPLASTICITY_HPP_
#ifndef WITH_ADOL_C
#error "MoFEM need to be compiled with ADOL-C"
#endif
return FTensor::Dg<double, 3, 6>{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0,
0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.5, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0};
};
return FTensor::Dg<double, 3, 6>{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0};
};
return FTensor::Dg<double, 3, 6>{1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0,
0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0};
};
struct CommonData : boost::enable_shared_from_this<CommonData> {
};
};
}
}
return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
gradAtGaussPts);
}
PetscBool b_bar =
bBar ? PETSC_TRUE : PETSC_FALSE;
PETSC_NULL);
}
return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
stressMatrix);
}
return boost::shared_ptr<MatrixDouble>(shared_from_this(),
}
}
};
struct ClosestPointProjection {
return 2 * (p - 1);
};
}
}
}
}
}
}
ublas::symmetric_matrix<double, ublas::lower>
C,
D;
boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
std::string block_name,
Sev sev) {
return 0;
}
bool &recalculate_elastic_tangent) {
return 0;
}
ublas::matrix<double, ublas::column_major>
dataA;
SmartPetscObj<SNES>
sNes;
};
template <int DIM>
boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs);
template <>
boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs);
template <>
boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs);
template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
struct OpRhsImpl;
template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
struct OpLhsImpl;
template <typename DomainEleOp> struct ADOLCPlasticityIntegrators {
template <AssemblyType A> struct Assembly {
template <int DIM, IntegrationType I>
using OpRhs = OpRhsImpl<DIM, I, AssemblyDomainEleOp>;
template <int DIM, IntegrationType I>
using OpLhs = OpLhsImpl<DIM, I, AssemblyDomainEleOp>;
};
};
using Pip = boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator>;
template <int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp>
std::string block_name, boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr,
Sev sev = Sev::inform) {
using P = ADOLCPlasticityIntegrators<DomainEleOp>;
CHKERR cp_ptr->addMatBlockOps(m_field, pip, block_name, sev);
pip.push_back(
getRawPtrOpCalculateStress<DIM>(m_field, common_data_ptr, cp_ptr, false));
pip.push_back(
new typename P::template Assembly<A>::template
OpRhs<DIM, I>(
}
template <int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr) {
using P = ADOLCPlasticityIntegrators<DomainEleOp>;
CHKERR cp_ptr->addMatBlockOps(m_field, pip, block_name, Sev::noisy);
pip.push_back(
getRawPtrOpCalculateStress<DIM>(m_field, common_data_ptr, cp_ptr, true));
pip.push_back(
new typename P::template Assembly<A>::template
OpLhs<DIM, I>(
}
template <int DIM>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr);
template <>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr);
template <>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr);
struct TSUpdate {
};
boost::shared_ptr<FEMethod> fe_ptr);
struct MakeB {
const int nb_integration_pts, double *w_ptr,
const int nb_integration_pts, double *w_ptr,
};
template <int DIM, typename AssemblyDomainEleOp>
boost::shared_ptr<CommonData> common_data_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
boost::shared_ptr<CommonData> common_data_ptr);
protected:
boost::shared_ptr<CommonData> commonDataPtr;
};
template <int DIM, typename AssemblyDomainEleOp>
string field_name, boost::shared_ptr<CommonData> common_data_ptr)
commonDataPtr(common_data_ptr) {}
template <int DIM, typename AssemblyDomainEleOp>
double *w_ptr = &(OP::getGaussPts()(DIM, 0));
data, baseStorage, commonDataPtr->bBar, OP::getGaussPts().size2(), w_ptr,
auto t_stress = getFTensor2SymmetricFromMat<3>(commonDataPtr->stressMatrix);
const auto vol = OP::getMeasure();
auto t_w = OP::getFTensor0IntegrationWeight();
for (int gg = 0; gg != OP::nbIntegrationPts; gg++) {
double alpha = vol * t_w;
for (int bb = 0; bb != OP::nbRows; ++bb) {
OP::locF[bb] += alpha * (t_stress(
i,
j) * t_diff(
i,
j));
++t_diff;
}
++t_w;
++t_stress;
}
}
template <int DIM, typename AssemblyDomainEleOp>
string field_name, boost::shared_ptr<CommonData> common_data_ptr)
AssemblyDomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr) {
this->sYmm = false;
}
template <int DIM, typename AssemblyDomainEleOp>
double *w_ptr = &(OP::getGaussPts()(DIM, 0));
row_data, baseRowStorage, commonDataPtr->bBar, OP::getGaussPts().size2(),
col_data, baseColStorage, commonDataPtr->bBar, OP::getGaussPts().size2(),
auto get_ftensor2_symmetric = [&](auto &storage, const auto gg,
const auto rr) {
&storage(gg, 6 * rr + 0), &storage(gg, 6 * rr + 1),
&storage(gg, 6 * rr + 2), &storage(gg, 6 * rr + 3),
&storage(gg, 6 * rr + 4), &storage(gg, 6 * rr + 5)};
};
auto t_Cep =
getFTensor4DdgFromMat<3, 3, 1>(commonDataPtr->materialTangentOperator);
const auto vol = OP::getMeasure();
auto t_w = OP::getFTensor0IntegrationWeight();
for (int gg = 0; gg != OP::nbIntegrationPts; ++gg) {
const double alpha = vol * t_w;
++t_w;
for (auto rr = 0; rr != OP::nbRows; ++rr) {
t_rowCep(
k,
l) = t_Cep(
i,
j,
k,
l) * t_diff_row(
i,
j);
auto t_diff_col = get_ftensor2_symmetric(baseColStorage, gg, 0);
for (auto cc = 0; cc != OP::nbCols; ++cc) {
OP::locMat(rr, cc) += alpha * (t_rowCep(
k,
l) * t_diff_col(
k,
l));
++t_diff_col;
}
++t_diff_row;
}
++t_Cep;
}
}
}
#endif //__ADOLCPLASTICITY_HPP_