24constexpr auto A = AssemblyType::BLOCK_MAT;
28#ifndef __ESHELBIAN_PLASTICITY_HPP__
29 #define __ESHELBIAN_PLASTICITY_HPP__
35using DL = DataLayoutTraits<DataLayout::GaussByCoeffs>;
52using EntData = EntitiesFieldData::EntData;
56using EleOnSide = PipelineManager::ElementsAndOpsByDim<SPACE_DIM>::FaceSideEle;
62struct AnalyticalExprPython;
65 :
public boost::enable_shared_from_this<MatOpsDataAtIntegrationPts> {
73 matOpsData->insertCommonData(
"wL2DotDotAtPts");
74 matOpsData->insertCommonData(
"logStretchTensorAtPts");
75 matOpsData->insertCommonData(
"logStretchDotTensorAtPts");
76 matOpsData->insertCommonData(
"gradLogStretchDotTensorAtPts");
79 matOpsData->insertCommonData(
"rotAxisDotAtPts");
80 matOpsData->insertCommonData(
"rotAxisGradDotAtPts");
81 matOpsData->insertCommonData(
"stretchH1AtPts");
83 matOpsData->insertCommonData(
"stretchTensorAtPts");
84 matOpsData->insertCommonData(
"diffStretchH1AtPts");
85 matOpsData->insertCommonData(
"diffStretchTensorAtPts");
87 matOpsData->insertCommonData(
"adjointPdstretchAtPts");
88 matOpsData->insertCommonData(
"adjointPdUAtPts");
89 matOpsData->insertCommonData(
"adjointPdUdOmegaAtPts");
90 matOpsData->insertCommonData(
"adjointPdUdPAtPts");
159 return boost::shared_ptr<double>(shared_from_this(), &
piolaScale);
164 template <
class Tensor>
165 static inline auto getFTensor(MatrixDouble &
m,
const int nb_gauss_pts) {
166 return MatrixSizeHelper<Tensor, DL>::get(
m, nb_gauss_pts)();
169 template <
class Tensor>
171 return getFTensor<Tensor>(*
m, nb_gauss_pts);
177 matOpsData->getCommonDataPtr(
"approxPAtPts"), nb_gauss_pts);
183 matOpsData->getCommonDataPtr(
"PAtPts"), nb_gauss_pts);
189 matOpsData->getCommonDataPtr(
"PAtPts_du"), nb_gauss_pts);
194 matOpsData->getCommonDataPtr(
"divPAtPts"), nb_gauss_pts);
199 matOpsData->getCommonDataPtr(
"wL2AtPts"), nb_gauss_pts);
204 matOpsData->getCommonDataPtr(
"wL2DotAtPts"), nb_gauss_pts);
209 matOpsData->getCommonDataPtr(
"wL2DotDotAtPts"), nb_gauss_pts);
214 matOpsData->getCommonDataPtr(
"logStretchTensorAtPts"),
220 matOpsData->getCommonDataPtr(
"logStretchDotTensorAtPts"),
226 matOpsData->getCommonDataPtr(
"gradLogStretchDotTensorAtPts"),
232 matOpsData->getCommonDataPtr(
"rotAxisAtPts"), nb_gauss_pts);
237 matOpsData->getCommonDataPtr(
"rotAxis0AtPts"), nb_gauss_pts);
242 matOpsData->getCommonDataPtr(
"rotAxisDotAtPts"), nb_gauss_pts);
248 matOpsData->getCommonDataPtr(
"rotAxisGradDotAtPts"), nb_gauss_pts);
254 matOpsData->getCommonDataPtr(
"stretchH1AtPts"), nb_gauss_pts);
260 matOpsData->getCommonDataPtr(
"wGradH1AtPts"), nb_gauss_pts);
265 matOpsData->getCommonDataPtr(
"stretchTensorAtPts"), nb_gauss_pts);
271 matOpsData->getCommonDataPtr(
"diffStretchH1AtPts"), nb_gauss_pts);
277 matOpsData->getCommonDataPtr(
"diffStretchTensorAtPts"),
284 matOpsData->getCommonDataPtr(
"hAtPts"), nb_gauss_pts);
290 matOpsData->getCommonDataPtr(
"adjointPdstretchAtPts"),
296 matOpsData->getCommonDataPtr(
"adjointPdUAtPts"), nb_gauss_pts);
301 matOpsData->getCommonDataPtr(
"adjointPdUdOmegaAtPts"),
308 matOpsData->getCommonDataPtr(
"adjointPdUdPAtPts"), nb_gauss_pts);
313 matOpsData->getCommonDataPtr(
"eigenVals"), nb_gauss_pts);
319 matOpsData->getCommonDataPtr(
"eigenVecs"), nb_gauss_pts);
323 return matOpsData->getCommonDataPtr(
"approxPAtPts");
329 return matOpsData->getCommonDataPtr(
"PAtPts_du");
333 return matOpsData->getCommonDataPtr(
"diffStretchH1AtPts");
337 return matOpsData->getCommonDataPtr(
"stretchH1AtPts");
341 return matOpsData->getCommonDataPtr(
"adjointPdstretchAtPts");
345 return matOpsData->getCommonDataPtr(
"adjointPdUAtPts");
349 return matOpsData->getCommonDataPtr(
"adjointPdUdOmegaAtPts");
353 return matOpsData->getCommonDataPtr(
"adjointPdUdPAtPts");
357 return matOpsData->getCommonDataPtr(
"eigenVals");
361 return matOpsData->getCommonDataPtr(
"eigenVecs");
365 return matOpsData->getCommonDataPtr(
"divPAtPts");
369 return matOpsData->getCommonDataPtr(
"wL2AtPts");
373 return matOpsData->getCommonDataPtr(
"wL2DotAtPts");
377 return matOpsData->getCommonDataPtr(
"wL2DotDotAtPts");
381 return matOpsData->getCommonDataPtr(
"logStretchTensorAtPts");
385 return matOpsData->getCommonDataPtr(
"stretchTensorAtPts");
389 return matOpsData->getCommonDataPtr(
"diffStretchTensorAtPts");
393 return matOpsData->getCommonDataPtr(
"hAtPts");
397 return matOpsData->getCommonDataPtr(
"logStretchDotTensorAtPts");
401 return matOpsData->getCommonDataPtr(
"gradLogStretchDotTensorAtPts");
405 return matOpsData->getCommonDataPtr(
"rotAxisAtPts");
409 return matOpsData->getCommonDataPtr(
"rotAxis0AtPts");
413 return matOpsData->getCommonDataPtr(
"rotAxisDotAtPts");
417 return matOpsData->getCommonDataPtr(
"rotAxisGradDotAtPts");
421 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matD);
425 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matInvD);
429 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matAxiatorD);
433 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matDeviatorD);
437 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
wH1AtPts);
441 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
XH1AtPts);
445 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
contactL2AtPts);
449 return matOpsData->getCommonDataPtr(
"wGradH1AtPts");
453 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
458 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varRotAxis);
462 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varGradRotAxis);
466 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varLogStreach);
470 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varPiola);
474 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varDivPiola);
478 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varWL2);
482 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
487 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
492 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
facePiolaAtPts);
496 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
501 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
506 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
511 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
gradientAtPts);
515 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
rotMatAtPts);
675 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
676 boost::shared_ptr<PhysicalEquations> physics_ptr);
680 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
681 const double alpha_u);
685 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
686 boost::shared_ptr<ExternalStrainVec> external_strain_vec_ptr,
687 std::map<std::string, boost::shared_ptr<ScalingMethod>> smv);
690 std::string row_field, std::string col_field,
691 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
const double alpha);
695 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
696 SmartPetscObj<Vec> assemble_vec,
697 boost::shared_ptr<TopologicalData> topo_ptr,
const double alpha_u,
698 boost::shared_ptr<double> J_ptr);
702 boost::shared_ptr<double> total_energy_ptr);
705 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
706 boost::shared_ptr<PhysicalEquations> physics_ptr);
709 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
710 boost::shared_ptr<PhysicalEquations> physics_ptr);
783template <
typename OP_PTR>
784std::tuple<std::string, MatrixDouble>
786 const std::string block_name);
788template <
typename OP_PTR>
789std::tuple<std::string, VectorDouble>
791 const std::string block_name);
793template <
typename OP_PTR>
798 MatrixDouble &m_ref_coords,
799 MatrixDouble &m_ref_normals,
800 const std::string block_name);
804 MatrixDouble &m_ref_coords,
805 const std::string block_name);
809 MatrixDouble &m_ref_coords,
810 const std::string block_name);
Analytical expression Python bridge.
VectorDouble analytical_externalstrain_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, const std::string block_name)
boost::shared_ptr< MatrixDouble > MatrixPtr
std::vector< AnalyticalTractionBc > AnalyticalTractionBcVec
std::vector< TractionBc > TractionBcVec
std::tuple< std::string, VectorDouble > getAnalyticalExternalStrain(OP_PTR op_ptr, VectorDouble &analytical_expr, const std::string block_name)
std::vector< AnalyticalDisplacementBc > AnalyticalDisplacementBcVec
std::vector< PressureBc > PressureBcVec
std::tuple< std::string, MatrixDouble > getAnalyticalExpr(OP_PTR op_ptr, MatrixDouble &analytical_expr, const std::string block_name)
VectorDouble analytical_elastic_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, const std::string block_name)
std::vector< Range > TractionFreeBc
std::vector< ExternalStrain > ExternalStrainVec
ForcesAndSourcesCore::UserDataOperator UserDataOperator
VectorDouble getAnalyticalElastic(OP_PTR op_ptr, const std::string block_name)
DataLayoutTraits< DataLayout::GaussByCoeffs > DL
std::vector< BcRot > BcRotVec
std::vector< NormalDisplacementBc > NormalDisplacementBcVec
FaceElementForcesAndSourcesCore::UserDataOperator FaceUserDataOperator
PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle EleOnSide
MatrixDouble analytical_expr_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_ref_coords, MatrixDouble &m_ref_normals, const std::string block_name)
std::vector< BcDisp > BcDispVec
boost::shared_ptr< VectorDouble > VectorPtr
boost::shared_ptr< MatOpsData > createMatOpsDataPtr()
constexpr double t
plate stiffness
constexpr auto field_name
FTensor::Index< 'm', 3 > m
MatrixPtr getAdjointPdUdOmegaAtPts()
MatrixPtr getAdjointPdstretchAtPts()
MatrixPtr getHybridDispAtPts()
auto getFTensorSmallWH1(const int nb_gauss_pts)
auto getFTensorPDu(const int nb_gauss_pts)
MatrixPtr getLogStretchTensorAtPts()
VectorDouble normalPressureAtPts
MatrixDouble matDeviatorD
auto getFTensorStretch(const int nb_gauss_pts)
auto getFTensorLogStretchDot(const int nb_gauss_pts)
MatrixDouble logStretchTotalTensorAtPts
MatrixDouble hdOmegaAtPts
auto getFTensorVarGradRotAxis(const int nb_gauss_pts)
auto getFTensorEigenVecsC(const int nb_gauss_pts)
auto getFTensorSigma(const int nb_gauss_pts)
MatrixDouble gradHybridDispAtPts
MatrixPtr getStretchH1AtPts()
MatrixDouble leviKirchhoffdOmegaAtPts
MatrixDouble leviKirchhoffPAtPts
auto getFTensorSmallWL2Dot(const int nb_gauss_pts)
MatrixPtr getSmallWL2AtPts()
MatrixPtr getGradientAtPts()
MatrixPtr getFacePiolaAtPts()
MatrixDouble internalStressAtPts
auto getFTensorVarPiola(const int nb_gauss_pts)
MatrixPtr getInternalStressAtPts()
auto getFTensorSmallHdLogStretch(const int nb_gauss_pts)
auto getFTensorAdjointPdstretch(const int nb_gauss_pts)
auto getFTensorSmallH(const int nb_gauss_pts)
auto getFTensorSmallHybridDisp(const int nb_gauss_pts)
auto getFTensorVarRotAxis(const int nb_gauss_pts)
MatrixPtr getRotAxisAtPts()
MatrixPtr getRotAxis0AtPts()
auto getFTensorLeviKirchhoffP(const int nb_gauss_pts)
MatrixPtr getLeviKirchhoffAtPts()
MatrixPtr getSmallWL2DotDotAtPts()
MatrixPtr getRotAxisGradDotAtPts()
auto getFTensorRotAxis0(const int nb_gauss_pts)
MatrixPtr getRotMatAtPts()
auto getFTensorLeviKirchhoff(const int nb_gauss_pts)
MatrixPtr getVarLogStreachPts()
MatrixPtr getRotAxisDotAtPts()
MatrixPtr getDivVarPiolaPts()
MatrixPtr getVarGradRotAxisPts()
MatrixPtr getSmallWGradH1AtPts()
MatrixPtr getHybridDispDotAtPts()
auto getFTensorEigenVals(const int nb_gauss_pts)
auto getFTensorGradHybridDisp(const int nb_gauss_pts)
MatrixPtr getGradHybridDispAtPts()
MatrixPtr getMatAxiatorDPtr()
auto getFTensorVarLogStreach(const int nb_gauss_pts)
auto getFTensorEigenVecs(const int nb_gauss_pts)
auto getFTensorRotAxisDot(const int nb_gauss_pts)
auto getFTensorApproxP(const int nb_gauss_pts)
MatrixPtr getSmallWH1AtPts()
MatrixPtr getAdjointPdUAtPts()
MatrixPtr getLogStretchDotTensorAtPts()
MatrixPtr getContactL2AtPts()
auto getFTensorRotMat(const int nb_gauss_pts)
auto getFTensorAdjointPdUdOmega(const int nb_gauss_pts)
auto getFTensorInternalStressVec(const int nb_gauss_pts)
MatrixPtr getApproxPAtPts()
auto getFTensorLeviKirchhoffdOmega(const int nb_gauss_pts)
MatrixPtr getStretchTensorAtPts()
MatrixDouble hybridDispDotAtPts
auto getFTensorInternalStress(const int nb_gauss_pts)
auto getFTensorVarWL2(const int nb_gauss_pts)
auto getFTensorSmallWL2DotDot(const int nb_gauss_pts)
auto getFTensorEigenValsC(const int nb_gauss_pts)
auto getFTensorLogStretchTotal(const int nb_gauss_pts)
MatrixPtr getMatDeviatorDPtr()
MatrixPtr getDiffStretchH1AtPts()
MatrixPtr getVarRotAxisPts()
MatrixDouble hdLogStretchAtPts
MatrixPtr getVarPiolaPts()
MatrixPtr getLargeXH1AtPts()
static auto getFTensor(MatrixDouble &m, const int nb_gauss_pts)
MatrixPtr getVarHybridDispAtPts()
MatrixPtr getDeformationGradient()
auto getFTensorLeviKirchhoffdLogStretch(const int nb_gauss_pts)
MatrixPtr getSmallWL2DotAtPts()
auto getFTensorDiffStretchH1(const int nb_gauss_pts)
auto getFTensorFaceMaterialForce(const int nb_gauss_pts)
auto getFTensorLogStretch2H1(const int nb_gauss_pts)
auto getFTensorSmallWGradH1(const int nb_gauss_pts)
auto getFTensorTraction(const int nb_gauss_pts)
auto getFTensorRotAxis(const int nb_gauss_pts)
MatrixDouble varHybridDispAtPts
MatrixDouble tractionAtPts
MatrixDouble varLogStreach
MatrixPtr getAdjointPdUdPAtPts()
auto getFTensorSmallHdOmega(const int nb_gauss_pts)
MatrixDouble logStretch2H1AtPts
MatrixPtr getGradLogStretchDotTensorAtPts()
VectorDouble youngModulusAtPts
auto getFTensorGradient(const int nb_gauss_pts)
MatrixPtr getDiffStretchTensorAtPts()
MatrixDouble leviKirchhoffdLogStreatchAtPts
auto getFTensorDivVarPiola(const int nb_gauss_pts)
auto getFTensorAdjointPdU(const int nb_gauss_pts)
auto getFTensorSmallWL2(const int nb_gauss_pts)
auto getFTensorP(const int nb_gauss_pts)
auto getFTensorRotAxisGradDot(const int nb_gauss_pts)
static constexpr int SizeSymm
MatrixDouble gradientAtPts
MatrixDouble varGradRotAxis
MatrixDouble leviKirchhoffAtPts
MatrixDouble faceMaterialForceAtPts
auto getFTensorDivP(const int nb_gauss_pts)
MatrixDouble hybridDispAtPts
auto getFTensorLogStretch(const int nb_gauss_pts)
MatrixPtr getMatInvDPtr()
auto getFTensorGradLogStretchDot(const int nb_gauss_pts)
auto getFTensorStretchH1(const int nb_gauss_pts)
boost::shared_ptr< PhysicalEquations > physicsPtr
auto getFTensorAdjointPdUdP(const int nb_gauss_pts)
static auto getFTensor(MatrixPtr m, const int nb_gauss_pts)
auto getFTensorDiffStretch(const int nb_gauss_pts)
MatrixDouble facePiolaAtPts
MatrixDouble contactL2AtPts
boost::shared_ptr< MatOps::MatOpsData > matOpsData
MatOpsDataAtIntegrationPts()
PhysicalEquations()=default
virtual VolUserDataOperator * returnOpCalculateVarStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
virtual VolUserDataOperator * returnOpCalculateEnergy(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< double > total_energy_ptr)
virtual UserDataOperator * returnOpJacobian(const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
virtual VolUserDataOperator * returnOpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
virtual VolUserDataOperator * returnOpSpatialPhysicalExternalStrain(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< ExternalStrainVec > external_strain_vec_ptr, std::map< std::string, boost::shared_ptr< ScalingMethod > > smv)
virtual VolUserDataOperator * returnOpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
virtual VolUserDataOperator * returnOpTopoSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, SmartPetscObj< Vec > assemble_vec, boost::shared_ptr< TopologicalData > topo_ptr, const double alpha_u, boost::shared_ptr< double > J_ptr)
virtual ~PhysicalEquations()=default
virtual VolUserDataOperator * returnOpSpatialPhysical_du_du(std::string row_field, std::string col_field, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha)
Data on single entity (This is passed as argument to DataOperator::doWork)