v0.14.0
ADOLCPlasticity.hpp

Operators and data structures for small strain plasticity

/** \file ADOLCPlasticity.hpp
* \ingroup adoc_plasticity
* \example ADOLCPlasticity.hpp
*
* \brief Operators and data structures for small strain plasticity
*
* \defgroup adoc_plasticity ADOL-C plasticity
* \ingroup user_modules
* \defgroup user_modules User modules
*
**/
#ifndef __ADOLCPLASTICITY_HPP_
#define __ADOLCPLASTICITY_HPP_
#ifndef WITH_ADOL_C
#error "MoFEM need to be compiled with ADOL-C"
#endif
/**
* \ingroup adoc_plasticity
*
*/
namespace ADOLCPlasticity {
/**
* \brief Op convert Vight strain vector to strain tensor
*/
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};
};
/**
* \brief Op convert strain tensor to Vight strain vector
*/
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};
};
/**
* \brief Op convert Vight stress vector to stress tensor
*/
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};
};
/** \brief common data used by volume elements
* \ingroup nonlinear_elastic_elem
*/
struct CommonData : boost::enable_shared_from_this<CommonData> {
inline auto getFTensor1StressAtGaussPts(int gg = 0) {
&gradientW(gg, 7),
&gradientW(gg, 8),
&gradientW(gg, 9),
&gradientW(gg, 10),
&gradientW(gg, 11),
static_cast<int>(gradientW.size2())};
};
inline auto getFTensor1PlasticStrainAtGaussPts(int gg = 0) {
static_cast<int>(activeVariablesW.size2())};
};
inline auto getPlasticStrain(int gg = 0) {
return getVectorAdaptor(&(activeVariablesW(gg, 0)), 6);
}
inline auto getInternalVariables(int gg = 0) {
activeVariablesW.size2() - 12);
}
vector<double> deltaGamma; //< Lagrange plastic multiplier
inline auto getGardAtGaussPtsPtr() {
return boost::shared_ptr<MatrixDouble>(shared_from_this(), &gradAtGaussPts);
}
bool bBar = true;
PetscBool b_bar = bBar ? PETSC_TRUE : PETSC_FALSE;
CHKERR PetscOptionsGetBool(PETSC_NULL, PETSC_NULL, "-b_bar", &b_bar,
PETSC_NULL);
bBar = b_bar;
}
boost::shared_ptr<MatrixDouble> getStressMatrixPtr() {
return boost::shared_ptr<MatrixDouble>(shared_from_this(), &stressMatrix);
}
boost::shared_ptr<MatrixDouble> getPlasticStrainMatrixPtr() {
return boost::shared_ptr<MatrixDouble>(shared_from_this(),
}
CHK_THROW_MESSAGE(getDefaultMaterialParameters(), "get parameters failed");
}
};
/** \brief Closest point projection algorithm
* \ingroup small_strain_plasticity
*/
struct ClosestPointProjection {
boost::function<int(int, int, int)> integrationRule = [](int, int, int p) {
return 2 * (p - 1);
};
}
}
}
}
return getVectorAdaptor(&(gradientW[6]), 6);
}
}
enum TypesTags { W = 0, Y, H, LAST_TAPE }; //< W - energy, Y - yield, H - flow
std::array<int, LAST_TAPE> tapesTags; //< Tapes nmbers
double w;
double y;
double h;
double deltaGamma; // Increment of plastic multiplier
ublas::symmetric_matrix<double, ublas::lower> C, D;
/**
* \brief Record strain energy
*/
/**
* \brief Record yield function
*/
/**
* \brief Record flow potential
*/
MatrixDouble hessianW; //< Hessian of energy
VectorDouble gradientY; //< Gradient of yield function
VectorDouble gradientH; //< Gradient of flow potential
MatrixDouble hessianH; //< Hessian of flow potential
MoFEMErrorCode createMatAVecR(); //< For integration point SNES solver
MoFEMErrorCode evaluatePotentials(); //< Evaluate potentials
playPotentials(); //< Play potentials from recorded ADOl-C tapes
playPotentials_NoHessian(); //< Play potentials from recorded ADOl-C tapes
MoFEMErrorCode calculateR(Vec R); //< Calculate residual
MoFEMErrorCode calculateA(); //< Calculate tangent matrix
/**
* \brief Function executed by nested SENES at evaluationg residual
*/
friend MoFEMErrorCode ADOLCPlasticityRes(SNES, Vec, Vec, void *ctx);
/**
* \brief Function executed by nested SENES at evaluationg tangent matrix
*/
friend MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx);
/**
* \brief Create nested snes
*/
/**
* \brief Solve nonlinear system of equations to find stress, internal
* fluxes, and Lagrange plastic multiplier
*/
/**
* \brief Calculate consistent tangent matrix
*/
/**
* \brief Record tapes
*/
/**
* \brief Get model parameters from blocks
*/
boost::ptr_deque<ForcesAndSourcesCore::UserDataOperator> &pip,
std::string block_name, Sev sev) {
return 0;
}
/**
* \brief Set parameters for ADOL-C of constitutive relations
*
* \param tag [in] - tag of the tape
* \param recalculate_elastic_tangent [out] - if setParam set it to true,
* tangent matrix for elastic domain should be recalculated
*/
virtual MoFEMErrorCode setParams(short tag,
bool &recalculate_elastic_tangent) {
return 0;
}
/**
* \brief Set Hemholtz energy
*/
/**
* \brief Set yield function
*/
/**
* \brief Set flow potential
*/
// protected:
MatrixDouble partialWStrainPlasticStrain; //< Partial derivative of free energy
// with respect to plastic strain
VectorAdaptor partialYSigma; //< Partial derivative of yield function with
// respect to stress
VectorAdaptor partialYFlux; //< Partial derivative of yield function with
// respect to internal fluxes
VectorAdaptor partialHSigma; //< Partial derivative of flow potential with
// respect to stress
VectorAdaptor partialHFlux; //< Partial derivative of flow potential with
// respect to internal fluxes
/// Second partial derivative of flow potential with respect to stresses
/// and internal
ublas::symmetric_matrix<double, ublas::lower> partial2HSigma;
/// Second partial derivative of flow potential with respect to internal
/// fluxes
ublas::symmetric_matrix<double, ublas::lower> partial2HFlux;
/// Mixed decond partial derivative of flow potential with respect to stresses
/// and internal fluxes
SmartPetscObj<Mat> A; //< Nested SNES tangent matrix
SmartPetscObj<Vec> R; //< Nested SNES residual
SmartPetscObj<Vec> Chi; //< Nested SNES unknown vector
SmartPetscObj<Vec> dChi; //< Nested SNES increment vector
ublas::matrix<double, ublas::column_major> dataA;
SmartPetscObj<SNES> sNes; //< Nested SNES solver
ublas::vector<adouble> a_sTrain;
ublas::vector<adouble> a_plasticStrain;
ublas::vector<adouble> a_internalVariables;
ublas::vector<adouble> a_sTress, a_internalFluxes;
};
/**
* \brief Internal SNES function used at integration points to calulate stress
*/
MoFEMErrorCode ADOLCPlasticityRes(SNES snes, Vec chi, Vec r, void *ctx);
/**
* \brief Internal SNES function used at integration points to calulate
* tangent matrix
*/
MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx);
/**
* \brief Get opreator to calulate stress
*/
template <int DIM>
MoFEM::Interface &m_field, boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs);
template <>
MoFEM::Interface &m_field, boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs);
template <>
MoFEM::Interface &m_field, boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr, bool calc_lhs);
/**
* \brief Assemble right hand side
*
* \param field_name [in] - name of field
* \param common_data_ptr [in] - shared pointer to common data
*
* \ingroup small_strain_plasticity
*/
template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
struct OpRhsImpl;
/**
* \brief Assemble left hand side
*
* \param field_name [in] - name of field
* \param common_data_ptr [in] - shared pointer to common data
*
* \ingroup small_strain_plasticity
*/
template <int DIM, IntegrationType I, typename AssemblyDomainEleOp>
struct OpLhsImpl;
template <typename DomainEleOp> struct ADOLCPlasticityIntegrators {
template <AssemblyType A> struct Assembly {
typename FormsIntegrators<DomainEleOp>::template Assembly<A>::OpBase;
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>;
/**
* @brief Assemble the left hand side, i.e. tangent matrix
* @ingroup adoc_plasticity
*
* @tparam DIM dimension of the problem
* @tparam A assembly type
* @tparam I integration type
* @tparam DomainEleOp operator type
* @param m_field
* @param field_name
* @param pip
* @param block_name esh block name caring material parameters
* @param common_data_ptr
* @param cp_ptr
* @return MoFEMErrorCode
*/
template <int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp>
MoFEM::Interface &m_field, string field_name, Pip &pip,
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>(
field_name, common_data_ptr));
}
/**
* @brief Assemble the left hand side, i.e. tangent matrix
* @ingroup adoc_plasticity
*
* @tparam DIM dimension of the problem
* @tparam A assembly type
* @tparam I integration type
* @tparam DomainEleOp operator type
* @param m_field
* @param field_name
* @param pip
* @param block_name esh block name caring material parameters
* @param common_data_ptr
* @param cp_ptr
* @return MoFEMErrorCode
*/
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>(
field_name, common_data_ptr));
}
/**
* @brief Push operators to update history variables
* @ingroup adoc_plasticity
*
* @tparam DIM dimension of the problem
* @param m_field core interface
* @param pip
* @param block_name mesh block name caring material parameters
* @param common_data_ptr
* @param cp_ptr
* @return MoFEMErrorCode
*/
template <int DIM>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr);
/**
* @copydoc ADOLCPlasticity::opFactoryDomainUpdate
*/
template <>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr);
/**
* @copydoc ADOLCPlasticity::opFactoryDomainUpdate
*/
template <>
std::string block_name,
boost::shared_ptr<CommonData> common_data_ptr,
boost::shared_ptr<ClosestPointProjection> cp_ptr);
/**
* \brief Update internal fluxes (update history variables)
* \ingroup adoc_plasticity
*/
struct TSUpdate {
virtual MoFEMErrorCode postProcess(TS ts) = 0;
};
boost::shared_ptr<TSUpdate> createTSUpdate(std::string fe_name,
boost::shared_ptr<FEMethod> fe_ptr);
/**
* \brief Calculate tensorial base functions. Apply bBar method when needed
*/
struct MakeB {
MatrixDouble &storage, const bool b_bar,
const int nb_integration_pts, double *w_ptr,
MatrixDouble &storage, const bool b_bar,
const int nb_integration_pts, double *w_ptr,
};
template <int DIM, typename AssemblyDomainEleOp>
struct OpRhsImpl<DIM, GAUSS, AssemblyDomainEleOp> : public AssemblyDomainEleOp {
OpRhsImpl(std::string field_name,
boost::shared_ptr<CommonData> common_data_ptr);
private:
boost::shared_ptr<CommonData> commonDataPtr;
MatrixDouble baseStorage; ///< Store tensorial base functions
};
template <int DIM, typename AssemblyDomainEleOp>
struct OpLhsImpl<DIM, GAUSS, AssemblyDomainEleOp> : public AssemblyDomainEleOp {
OpLhsImpl(std::string field_name,
boost::shared_ptr<CommonData> common_data_ptr);
protected:
boost::shared_ptr<CommonData> commonDataPtr;
MatrixDouble baseRowStorage; ///< Store tensorial base functions
MatrixDouble baseColStorage; ///< Store tensorial base functions
};
template <int DIM, typename AssemblyDomainEleOp>
string field_name, boost::shared_ptr<CommonData> common_data_ptr)
: AssemblyDomainEleOp(field_name, field_name, AssemblyDomainEleOp::OPROW),
commonDataPtr(common_data_ptr) {}
//! [OpRhsImpl integrate]
template <int DIM, typename AssemblyDomainEleOp>
double *w_ptr = &(OP::getGaussPts()(DIM, 0));
// Calulate tensorial base functions. Apply bBar method when needed
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;
}
}
//! [OpRhsImpl integrate]
template <int DIM, typename AssemblyDomainEleOp>
string field_name, boost::shared_ptr<CommonData> common_data_ptr)
AssemblyDomainEleOp::OPROWCOL),
commonDataPtr(common_data_ptr) {
this->sYmm = false; // It has to be false for not-associtive plasticity
}
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;
}
}
} // namespace ADOLCPlasticity
#endif //__ADOLCPLASTICITY_HPP_
ADOLCPlasticity::ClosestPointProjection::getActiveVariablesYH
VectorAdaptor getActiveVariablesYH()
Definition: ADOLCPlasticity.hpp:158
ADOLCPlasticity::CommonData::deltaGamma
vector< double > deltaGamma
Definition: ADOLCPlasticity.hpp:97
ADOLCPlasticity::ClosestPointProjection::playW
MoFEMErrorCode playW()
Definition: ClosetPointProjection.cpp:122
ADOLCPlasticity::ClosestPointProjection::playW_NoHessian
MoFEMErrorCode playW_NoHessian()
Definition: ClosetPointProjection.cpp:172
ADOLCPlasticity::ClosestPointProjection::getInternalVariables
VectorAdaptor getInternalVariables()
Definition: ADOLCPlasticity.hpp:155
ADOLCPlasticity::ClosestPointProjection::flowPotential
virtual MoFEMErrorCode flowPotential()=0
Set flow potential.
ADOLCPlasticity::ClosestPointProjection::partial2HSigmaFlux
MatrixDouble partial2HSigmaFlux
Definition: ADOLCPlasticity.hpp:315
ADOLCPlasticity::ClosestPointProjection::plasticStrain0
VectorDouble plasticStrain0
Definition: ADOLCPlasticity.hpp:147
ADOLCPlasticity::ClosestPointProjection::a_h
adouble a_h
Definition: ADOLCPlasticity.hpp:330
ADOLCPlasticity::getRawPtrOpCalculateStress< 3 >
ForcesAndSourcesCore::UserDataOperator * getRawPtrOpCalculateStress< 3 >(MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
Definition: ADOLCPlasticity.cpp:547
ADOLCPlasticity::ClosestPointProjection::playH_NoHessian
MoFEMErrorCode playH_NoHessian()
Definition: ClosetPointProjection.cpp:287
ADOLCPlasticity::Pip
boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > Pip
Definition: ADOLCPlasticity.hpp:399
FTensor::Tensor1
Definition: Tensor1_value.hpp:8
ADOLCPlasticity::ClosestPointProjection::Ep
MatrixDouble Ep
Definition: ADOLCPlasticity.hpp:181
ADOLCPlasticity::ClosestPointProjection::deltaGamma
double deltaGamma
Definition: ADOLCPlasticity.hpp:180
ADOLCPlasticity::createTSUpdate
boost::shared_ptr< TSUpdate > createTSUpdate(std::string fe_name, boost::shared_ptr< FEMethod > fe_ptr)
ADOLCPlasticity::OpRhsImpl< DIM, GAUSS, AssemblyDomainEleOp >::iNtegrate
MoFEMErrorCode iNtegrate(EntitiesFieldData::EntData &data)
[OpRhsImpl integrate]
Definition: ADOLCPlasticity.hpp:565
ADOLCPlasticity::ClosestPointProjection::ClosestPointProjection
ClosestPointProjection()
Definition: ClosetPointProjection.cpp:15
ADOLCPlasticity::CommonData::getDefaultMaterialParameters
MoFEMErrorCode getDefaultMaterialParameters()
Definition: ADOLCPlasticity.hpp:109
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:596
ADOLCPlasticity::strain_to_voight_op
FTensor::Dg< double, 3, 6 > strain_to_voight_op()
Op convert strain tensor to Vight strain vector.
Definition: ADOLCPlasticity.hpp:39
ADOLCPlasticity::ClosestPointProjection::TypesTags
TypesTags
Definition: ADOLCPlasticity.hpp:168
ADOLCPlasticity::ClosestPointProjection::a_plasticStrain
ublas::vector< adouble > a_plasticStrain
Definition: ADOLCPlasticity.hpp:325
ADOLCPlasticity::ClosestPointProjection::evaluatePotentials
MoFEMErrorCode evaluatePotentials()
Definition: ClosetPointProjection.cpp:335
ADOLCPlasticity::ClosestPointProjection::A
SmartPetscObj< Mat > A
Definition: ADOLCPlasticity.hpp:317
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
ADOLCPlasticity::CommonData::getFTensor1StressAtGaussPts
auto getFTensor1StressAtGaussPts(int gg=0)
Definition: ADOLCPlasticity.hpp:64
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
ADOLCPlasticity::MakeB::getFTensor2SymmetricDiffBase
static FTensor::Tensor2_symmetric< FTensor::PackPtr< double *, 6 >, 3 > getFTensor2SymmetricDiffBase(DataForcesAndSourcesCore::EntData &data, MatrixDouble &storage, const bool b_bar, const int nb_integration_pts, double *w_ptr, FTensor::Number< 2 >)
Definition: ADOLCPlasticity.cpp:186
ADOLCPlasticity::CommonData::activeVariablesW
MatrixDouble activeVariablesW
Definition: ADOLCPlasticity.hpp:61
ADOLCPlasticity::ClosestPointProjection::a_sTrain
ublas::vector< adouble > a_sTrain
Definition: ADOLCPlasticity.hpp:324
ADOLCPlasticity::ClosestPointProjection::partialYFlux
VectorAdaptor partialYFlux
Definition: ADOLCPlasticity.hpp:300
ADOLCPlasticity::ClosestPointProjection::setParams
virtual MoFEMErrorCode setParams(short tag, bool &recalculate_elastic_tangent)
Set parameters for ADOL-C of constitutive relations.
Definition: ADOLCPlasticity.hpp:274
ADOLCPlasticity::ClosestPointProjection::partialWStrainPlasticStrain
MatrixDouble partialWStrainPlasticStrain
Definition: ADOLCPlasticity.hpp:296
FTensor::Tensor2_symmetric
Definition: Tensor2_symmetric_value.hpp:13
OpBase
OpBaseImpl< PETSC, EdgeEleOp > OpBase
Definition: radiation.cpp:29
ADOLCPlasticity::CommonData::gradientW
MatrixDouble gradientW
Definition: ADOLCPlasticity.hpp:62
ADOLCPlasticity::CommonData::plasticStrainSize
int plasticStrainSize
Definition: ADOLCPlasticity.hpp:100
ADOLCPlasticity::ClosestPointProjection::Cep
MatrixDouble Cep
Definition: ADOLCPlasticity.hpp:181
sdf.r
int r
Definition: sdf.py:8
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
ADOLCPlasticity::ClosestPointProjection::dChi
SmartPetscObj< Vec > dChi
Definition: ADOLCPlasticity.hpp:320
ADOLCPlasticity::ClosestPointProjection::hessianW
MatrixDouble hessianW
Definition: ADOLCPlasticity.hpp:199
ADOLCPlasticity::CommonData::getGardAtGaussPtsPtr
auto getGardAtGaussPtsPtr()
Definition: ADOLCPlasticity.hpp:103
ADOLCPlasticity::CommonData::internalVariablesPtr
double * internalVariablesPtr
Definition: ADOLCPlasticity.hpp:99
ADOLCPlasticity::ClosestPointProjection::calculateR
MoFEMErrorCode calculateR(Vec R)
Definition: ClosetPointProjection.cpp:360
MoFEM::Sev
MoFEM::LogManager::SeverityLevel Sev
Definition: CoreTemplates.hpp:17
MoFEM::OpBaseImpl
Definition: FormsIntegrators.hpp:178
ADOLCPlasticity::ClosestPointProjection::playY
MoFEMErrorCode playY()
Definition: ClosetPointProjection.cpp:191
ADOLCPlasticity::ClosestPointProjection::recordY
MoFEMErrorCode recordY()
Record yield function.
Definition: ClosetPointProjection.cpp:70
ADOLCPlasticity::ClosestPointProjection::gradientW
VectorAdaptor gradientW
Definition: ADOLCPlasticity.hpp:174
FTensor::Number< 2 >
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
ADOLCPlasticity::ClosestPointProjection::H
@ H
Definition: ADOLCPlasticity.hpp:168
ADOLCPlasticity::ClosestPointProjection::integrationRule
boost::function< int(int, int, int)> integrationRule
Definition: ADOLCPlasticity.hpp:142
ADOLCPlasticity::ClosestPointProjection::getPlasticStrain
VectorAdaptor getPlasticStrain()
Definition: ADOLCPlasticity.hpp:149
OpLhs
Definition: approx_sphere.cpp:134
ADOLCPlasticity::ClosestPointProjection::playPotentials
MoFEMErrorCode playPotentials()
Definition: ClosetPointProjection.cpp:343
MoFEM::getVectorAdaptor
auto getVectorAdaptor(T1 ptr, const size_t n)
Get Vector adaptor.
Definition: Templates.hpp:31
ADOLCPlasticity::CommonData::CommonData
CommonData()
Definition: ADOLCPlasticity.hpp:129
ADOLCPlasticity::CommonData::stressMatrix
MatrixDouble stressMatrix
Definition: ADOLCPlasticity.hpp:126
ADOLCPlasticity::CommonData::plasticStrainPtr
double * plasticStrainPtr
Definition: ADOLCPlasticity.hpp:98
ADOLCPlasticity::ClosestPointProjection::getStress
VectorAdaptor getStress()
Definition: ADOLCPlasticity.hpp:161
ADOLCPlasticity::opFactoryDomainLhs
MoFEMErrorCode opFactoryDomainLhs(MoFEM::Interface &m_field, string field_name, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Assemble the left hand side, i.e. tangent matrix.
Definition: ADOLCPlasticity.hpp:449
ADOLCPlasticity::ClosestPointProjection::solveClosetProjection
MoFEMErrorCode solveClosetProjection()
Solve nonlinear system of equations to find stress, internal fluxes, and Lagrange plastic multiplier.
Definition: ClosetPointProjection.cpp:459
ADOLCPlasticity::getRawPtrOpCalculateStress
ForcesAndSourcesCore::UserDataOperator * getRawPtrOpCalculateStress(MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
Get opreator to calulate stress.
ADOLCPlasticity::ClosestPointProjection::getInternalFluxes
VectorAdaptor getInternalFluxes()
Definition: ADOLCPlasticity.hpp:164
ADOLCPlasticity::CommonData::getPlasticStrain
auto getPlasticStrain(int gg=0)
Definition: ADOLCPlasticity.hpp:88
ADOLCPlasticity::ClosestPointProjection::h
double h
Definition: ADOLCPlasticity.hpp:178
ADOLCPlasticity::CommonData::internalVariablesSize
int internalVariablesSize
Definition: ADOLCPlasticity.hpp:101
ADOLCPlasticity::ClosestPointProjection::partial2HFlux
ublas::symmetric_matrix< double, ublas::lower > partial2HFlux
Definition: ADOLCPlasticity.hpp:312
ADOLCPlasticity::CommonData::getPlasticStrainMatrixPtr
boost::shared_ptr< MatrixDouble > getPlasticStrainMatrixPtr()
Definition: ADOLCPlasticity.hpp:121
EshelbianPlasticity::P
@ P
Definition: EshelbianContact.cpp:193
ADOLCPlasticity::ClosestPointProjection::playPotentials_NoHessian
MoFEMErrorCode playPotentials_NoHessian()
Definition: ClosetPointProjection.cpp:351
ADOLCPlasticity::opFactoryDomainRhs
MoFEMErrorCode opFactoryDomainRhs(MoFEM::Interface &m_field, string field_name, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, Sev sev=Sev::inform)
Assemble the left hand side, i.e. tangent matrix.
Definition: ADOLCPlasticity.hpp:418
ADOLCPlasticity::ClosestPointProjection::partialYSigma
VectorAdaptor partialYSigma
Definition: ADOLCPlasticity.hpp:298
ADOLCPlasticity::voight_to_strain_op
FTensor::Dg< double, 3, 6 > voight_to_strain_op()
Op convert Vight strain vector to strain tensor.
Definition: ADOLCPlasticity.hpp:29
MoFEM::GAUSS
@ GAUSS
Definition: FormsIntegrators.hpp:136
ADOLCPlasticity::CommonData::gradAtGaussPts
MatrixDouble gradAtGaussPts
Definition: ADOLCPlasticity.hpp:83
ADOLCPlasticity::CommonData::plasticStrainMatrix
MatrixDouble plasticStrainMatrix
Definition: ADOLCPlasticity.hpp:127
ADOLCPlasticity::ClosestPointProjection::Chi
SmartPetscObj< Vec > Chi
Definition: ADOLCPlasticity.hpp:319
ADOLCPlasticity::ClosestPointProjection::R
SmartPetscObj< Vec > R
Definition: ADOLCPlasticity.hpp:318
ADOLCPlasticity::ClosestPointProjection::a_w
adouble a_w
Definition: ADOLCPlasticity.hpp:328
ADOLCPlasticity::ClosestPointProjection::dataA
ublas::matrix< double, ublas::column_major > dataA
Definition: ADOLCPlasticity.hpp:321
ADOLCPlasticity::TSUpdate::postProcess
virtual MoFEMErrorCode postProcess(TS ts)=0
ADOLCPlasticity::ClosestPointProjection::partialHSigma
VectorAdaptor partialHSigma
Definition: ADOLCPlasticity.hpp:302
ADOLCPlasticity
Definition: ADOLCPlasticity.hpp:24
MoFEM::Types::VectorAdaptor
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:115
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
ADOLCPlasticity::ClosestPointProjection::a_internalFluxes
ublas::vector< adouble > a_internalFluxes
Definition: ADOLCPlasticity.hpp:327
ADOLCPlasticity::ClosestPointProjection::nbInternalVariables
int nbInternalVariables
Definition: ADOLCPlasticity.hpp:141
ADOLCPlasticity::ClosestPointProjection::activeVariablesW
VectorAdaptor activeVariablesW
Definition: ADOLCPlasticity.hpp:173
ADOLCPlasticity::ClosestPointProjection::tapesTags
std::array< int, LAST_TAPE > tapesTags
Definition: ADOLCPlasticity.hpp:169
EntData
EntitiesFieldData::EntData EntData
Definition: child_and_parent.cpp:37
field_name
constexpr auto field_name
Definition: poisson_2d_homogeneous.cpp:13
FTensor::Index< 'i', 3 >
ADOLCPlasticity::opFactoryDomainUpdate
MoFEMErrorCode opFactoryDomainUpdate(MoFEM::Interface &m_field, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Push operators to update history variables.
ADOLCPlasticity::ADOLCPlasticityRes
MoFEMErrorCode ADOLCPlasticityRes(SNES snes, Vec chi, Vec r, void *ctx)
Internal SNES function used at integration points to calulate stress.
Definition: ClosetPointProjection.cpp:558
ADOLCPlasticity::ClosestPointProjection::partialHFlux
VectorAdaptor partialHFlux
Definition: ADOLCPlasticity.hpp:304
ADOLCPlasticity::OpLhsImpl< DIM, GAUSS, AssemblyDomainEleOp >::OpLhsImpl
OpLhsImpl(std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
[OpRhsImpl integrate]
Definition: ADOLCPlasticity.hpp:593
OpRhs
Definition: approx_sphere.cpp:68
adouble
ADOLCPlasticity::ClosestPointProjection::ADOLCPlasticityRes
friend MoFEMErrorCode ADOLCPlasticityRes(SNES, Vec, Vec, void *ctx)
Function executed by nested SENES at evaluationg residual.
Definition: ClosetPointProjection.cpp:558
ADOLCPlasticity::ClosestPointProjection::w
double w
Definition: ADOLCPlasticity.hpp:176
ADOLCPlasticity::opFactoryDomainUpdate< 2 >
MoFEMErrorCode opFactoryDomainUpdate< 2 >(MoFEM::Interface &m_field, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Push operators to update history variables.
Definition: ADOLCPlasticity.cpp:586
ADOLCPlasticity::ClosestPointProjection::sNes
SmartPetscObj< SNES > sNes
Definition: ADOLCPlasticity.hpp:322
FTensor::Dg
Definition: Dg_value.hpp:9
ADOLCPlasticity::ClosestPointProjection::getTotalStrain
VectorAdaptor getTotalStrain()
Definition: ADOLCPlasticity.hpp:152
ADOLCPlasticity::ClosestPointProjection::a_internalVariables
ublas::vector< adouble > a_internalVariables
Definition: ADOLCPlasticity.hpp:326
ADOLCPlasticity::ClosestPointProjection::recordW
MoFEMErrorCode recordW()
Record strain energy.
Definition: ClosetPointProjection.cpp:40
ADOLCPlasticity::ClosestPointProjection::playH
MoFEMErrorCode playH()
Definition: ClosetPointProjection.cpp:230
UserDataOperator
ForcesAndSourcesCore::UserDataOperator UserDataOperator
Definition: HookeElement.hpp:75
ADOLCPlasticity::ClosestPointProjection::consistentTangent
MoFEMErrorCode consistentTangent()
Calculate consistent tangent matrix.
Definition: ClosetPointProjection.cpp:509
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
ADOLCPlasticity::ClosestPointProjection::addMatBlockOps
virtual MoFEMErrorCode addMatBlockOps(MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string block_name, Sev sev)
Get model parameters from blocks.
Definition: ADOLCPlasticity.hpp:261
ADOLCPlasticity::ClosestPointProjection::a_y
adouble a_y
Definition: ADOLCPlasticity.hpp:329
ADOLCPlasticity::ClosestPointProjection::createMatAVecR
MoFEMErrorCode createMatAVecR()
Definition: ClosetPointProjection.cpp:314
CommonData
Definition: continuity_check_on_skeleton_with_simple_2d_for_h1.cpp:22
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
ADOLCPlasticity::CommonData::getInternalVariables
auto getInternalVariables(int gg=0)
Definition: ADOLCPlasticity.hpp:92
ADOLCPlasticity::ClosestPointProjection::recordTapes
MoFEMErrorCode recordTapes()
Record tapes.
Definition: ClosetPointProjection.cpp:610
ADOLCPlasticity::voight_to_stress_op
FTensor::Dg< double, 3, 6 > voight_to_stress_op()
Op convert Vight stress vector to stress tensor.
Definition: ADOLCPlasticity.hpp:49
ADOLCPlasticity::ClosestPointProjection::calculateA
MoFEMErrorCode calculateA()
Definition: ClosetPointProjection.cpp:382
ADOLCPlasticity::ClosestPointProjection::LAST_TAPE
@ LAST_TAPE
Definition: ADOLCPlasticity.hpp:168
ADOLCPlasticity::ClosestPointProjection::a_sTress
ublas::vector< adouble > a_sTress
Definition: ADOLCPlasticity.hpp:327
ADOLCPlasticity::ClosestPointProjection::gradientY
VectorDouble gradientY
Definition: ADOLCPlasticity.hpp:203
ADOLCPlasticity::ClosestPointProjection::D
ublas::symmetric_matrix< double, ublas::lower > D
Definition: ADOLCPlasticity.hpp:182
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
ADOLCPlasticity::ClosestPointProjection::gradientH
VectorDouble gradientH
Definition: ADOLCPlasticity.hpp:207
ADOLCPlasticity::ClosestPointProjection::C
ublas::symmetric_matrix< double, ublas::lower > C
Definition: ADOLCPlasticity.hpp:182
ADOLCPlasticity::OpLhsImpl< DIM, GAUSS, AssemblyDomainEleOp >::iNtegrate
MoFEMErrorCode iNtegrate(DataForcesAndSourcesCore::EntData &row_data, DataForcesAndSourcesCore::EntData &col_data)
Definition: ADOLCPlasticity.hpp:602
AssemblyDomainEleOp
FormsIntegrators< DomainEleOp >::Assembly< A >::OpBase AssemblyDomainEleOp
Definition: tensor_divergence_operator.cpp:59
ADOLCPlasticity::ClosestPointProjection::snesCreate
MoFEMErrorCode snesCreate()
Create nested snes.
Definition: ClosetPointProjection.cpp:433
ADOLCPlasticity::ClosestPointProjection::ADOLCPlasticityJac
friend MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx)
Function executed by nested SENES at evaluationg tangent matrix.
Definition: ClosetPointProjection.cpp:584
ADOLCPlasticity::CommonData::getStressMatrixPtr
boost::shared_ptr< MatrixDouble > getStressMatrixPtr()
Definition: ADOLCPlasticity.hpp:118
ADOLCPlasticity::getRawPtrOpCalculateStress< 2 >
ForcesAndSourcesCore::UserDataOperator * getRawPtrOpCalculateStress< 2 >(MoFEM::Interface &m_field, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr, bool calc_lhs)
Definition: ADOLCPlasticity.cpp:554
ADOLCPlasticity::ClosestPointProjection::partial2HSigma
ublas::symmetric_matrix< double, ublas::lower > partial2HSigma
Definition: ADOLCPlasticity.hpp:309
ADOLCPlasticity::ClosestPointProjection::freeHemholtzEnergy
virtual MoFEMErrorCode freeHemholtzEnergy()=0
Set Hemholtz energy.
ADOLCPlasticity::opFactoryDomainUpdate< 3 >
MoFEMErrorCode opFactoryDomainUpdate< 3 >(MoFEM::Interface &m_field, Pip &pip, std::string block_name, boost::shared_ptr< CommonData > common_data_ptr, boost::shared_ptr< ClosestPointProjection > cp_ptr)
Push operators to update history variables.
Definition: ADOLCPlasticity.cpp:576
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
ADOLCPlasticity::ClosestPointProjection::playY_NoGradient
MoFEMErrorCode playY_NoGradient()
Definition: ClosetPointProjection.cpp:217
ADOLCPlasticity::CommonData::getFTensor1PlasticStrainAtGaussPts
auto getFTensor1PlasticStrainAtGaussPts(int gg=0)
Definition: ADOLCPlasticity.hpp:74
OP
convert.int
int
Definition: convert.py:64
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
ADOLCPlasticity::ClosestPointProjection::internalVariables0
VectorDouble internalVariables0
Definition: ADOLCPlasticity.hpp:146
ADOLCPlasticity::CommonData::bBar
bool bBar
Definition: ADOLCPlasticity.hpp:107
ADOLCPlasticity::ClosestPointProjection::Cp
MatrixDouble Cp
Definition: ADOLCPlasticity.hpp:181
ADOLCPlasticity::CommonData::materialTangentOperator
MatrixDouble materialTangentOperator
Definition: ADOLCPlasticity.hpp:86
ADOLCPlasticity::ClosestPointProjection::Y
@ Y
Definition: ADOLCPlasticity.hpp:168
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
ADOLCPlasticity::OpRhsImpl< DIM, GAUSS, AssemblyDomainEleOp >::OpRhsImpl
OpRhsImpl(std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
Definition: ADOLCPlasticity.hpp:558
ADOLCPlasticity::ClosestPointProjection::yieldFunction
virtual MoFEMErrorCode yieldFunction()=0
Set yield function.
ADOLCPlasticity::ClosestPointProjection::hessianH
MatrixDouble hessianH
Definition: ADOLCPlasticity.hpp:208
ADOLCPlasticity::ClosestPointProjection::y
double y
Definition: ADOLCPlasticity.hpp:177
MoFEM::PetscOptionsGetBool
PetscErrorCode PetscOptionsGetBool(PetscOptions *, const char pre[], const char name[], PetscBool *bval, PetscBool *set)
Definition: DeprecatedPetsc.hpp:182
ADOLCPlasticity::ClosestPointProjection::recordH
MoFEMErrorCode recordH()
Record flow potential.
Definition: ClosetPointProjection.cpp:96
ADOLCPlasticity::ClosestPointProjection::W
@ W
Definition: ADOLCPlasticity.hpp:168
ADOLCPlasticity::ADOLCPlasticityJac
MoFEMErrorCode ADOLCPlasticityJac(SNES, Vec, Mat, Mat, void *ctx)
Internal SNES function used at integration points to calulate tangent matrix.
Definition: ClosetPointProjection.cpp:584