15constexpr auto A = AssemblyType::BLOCK_MAT;
17#ifndef __ESHELBIAN_PLASTICITY_HPP__
18 #define __ESHELBIAN_PLASTICITY_HPP__
20 #ifdef ENABLE_PYTHON_BINDING
21 #include <boost/python.hpp>
22 #include <boost/python/def.hpp>
23 #include <boost/python/numpy.hpp>
24namespace bp = boost::python;
25namespace np = boost::python::numpy;
31 using CachePhi = boost::tuple<int, int, MatrixDouble>;
37 BaseFunctionUnknownInterface **iface)
const;
38 MoFEMErrorCode
getValue(MatrixDouble &pts,
39 boost::shared_ptr<BaseFunctionCtx> ctx_ptr);
58using EntData = EntitiesFieldData::EntData;
62using EleOnSide = PipelineManager::ElementsAndOpsByDim<SPACE_DIM>::FaceSideEle;
67struct AnalyticalExprPython;
70 :
public boost::enable_shared_from_this<DataAtIntegrationPts> {
152 return boost::shared_ptr<double>(shared_from_this(), &
piolaScale);
156 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
160 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
approxPAtPts);
164 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
divPAtPts);
168 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
divSigmaAtPts);
172 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
wL2AtPts);
176 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
wL2DotAtPts);
180 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
wL2DotDotAtPts);
184 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
189 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
194 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
199 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
204 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
rotAxisAtPts);
208 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
rotAxis0AtPts);
212 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
217 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
222 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
GAtPts);
226 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
GAtPts);
230 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matD);
234 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matInvD);
238 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matAxiatorD);
242 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
matDeviatorD);
246 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
wH1AtPts);
250 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
XH1AtPts);
254 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
contactL2AtPts);
258 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
wGradH1AtPts);
262 return boost::shared_ptr<VectorDouble>(shared_from_this(), &
jacobianAtPts);
266 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
271 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varRotAxis);
275 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varLogStreach);
279 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varPiola);
283 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varDivPiola);
287 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
varWL2);
291 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
296 return boost::shared_ptr<MatrixDouble>(shared_from_this(), &
facePiolaAtPts);
300 return boost::shared_ptr<MatrixDouble>(shared_from_this(),
334 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
335 boost::shared_ptr<PhysicalEquations> physics_ptr) = 0;
339 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
340 const double alpha_u);
343 std::string row_field, std::string col_field,
344 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
const double alpha);
348 boost::shared_ptr<double> total_energy_ptr);
351 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
352 boost::shared_ptr<PhysicalEquations> physics_ptr);
355 boost::shared_ptr<DataAtIntegrationPts> data_ptr,
356 boost::shared_ptr<PhysicalEquations> physics_ptr);
360 boost::shared_ptr<PhysicalEquations> physics_ptr);
373 &
v[S + 5], &
v[S + 6], &
v[S + 7], &
v[S + 8]);
385 const int A00 = nba * 0 + S0;
386 const int A01 = nba * 1 + S0;
387 const int A02 = nba * 2 + S0;
388 const int A10 = nba * 3 + S0;
389 const int A11 = nba * 4 + S0;
390 const int A12 = nba * 5 + S0;
391 const int A20 = nba * 6 + S0;
392 const int A21 = nba * 7 + S0;
393 const int A22 = nba * 8 + S0;
397 &
v[A00 + 0], &
v[A00 + 1], &
v[A00 + 2], &
v[A01 + 0], &
v[A01 + 1],
398 &
v[A01 + 2], &
v[A02 + 0], &
v[A02 + 1], &
v[A02 + 2],
400 &
v[A10 + 0], &
v[A10 + 1], &
v[A10 + 2], &
v[A11 + 0], &
v[A11 + 1],
401 &
v[A11 + 2], &
v[A12 + 0], &
v[A12 + 1], &
v[A12 + 2],
403 &
v[A20 + 0], &
v[A20 + 1], &
v[A20 + 2], &
v[A21 + 0], &
v[A21 + 1],
404 &
v[A21 + 2], &
v[A22 + 0], &
v[A22 + 1], &
v[A22 + 2]
518#ifdef ENABLE_PYTHON_BINDING
519struct AnalyticalExprPython {
520 AnalyticalExprPython() =
default;
521 virtual ~AnalyticalExprPython() =
default;
523 MoFEMErrorCode analyticalExprInit(
const std::string py_file);
524 MoFEMErrorCode evalAnalyticalDisp(
double delta_t,
double t, np::ndarray x,
525 np::ndarray y, np::ndarray z,
const std::string& block_name,
526 np::ndarray &analytical_expr);
527 MoFEMErrorCode evalAnalyticalTraction(
double delta_t,
double t, np::ndarray x,
528 np::ndarray y, np::ndarray z,
const std::string& block_name,
529 np::ndarray &analytical_expr);
531 template <
typename T>
532 inline std::vector<T>
533 py_list_to_std_vector(
const boost::python::object &iterable) {
534 return std::vector<T>(boost::python::stl_input_iterator<T>(iterable),
535 boost::python::stl_input_iterator<T>());
539 bp::object mainNamespace;
540 bp::object analyticalDispFun;
541 bp::object analyticalTractionFun;
544extern boost::weak_ptr<AnalyticalExprPython> AnalyticalExprPythonWeakPtr;
const double v
phase velocity of light in medium (cm/ns)
boost::shared_ptr< MatrixDouble > MatrixPtr
std::vector< AnalyticalTractionBc > AnalyticalTractionBcVec
std::vector< TractionBc > TractionBcVec
std::vector< AnalyticalDisplacementBc > AnalyticalDisplacementBcVec
std::vector< PressureBc > PressureBcVec
std::vector< Range > TractionFreeBc
std::vector< ExternalStrain > ExternalStrainVec
ForcesAndSourcesCore::UserDataOperator UserDataOperator
std::vector< BcRot > BcRotVec
std::vector< NormalDisplacementBc > NormalDisplacementBcVec
FaceElementForcesAndSourcesCore::UserDataOperator FaceUserDataOperator
PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle EleOnSide
std::vector< BcDisp > BcDispVec
boost::shared_ptr< VectorDouble > VectorPtr
constexpr double t
plate stiffness
constexpr auto field_name
MoFEMErrorCode getValueHdivForCGGBubble(MatrixDouble &pts)
MoFEMErrorCode getValue(MatrixDouble &pts, boost::shared_ptr< BaseFunctionCtx > ctx_ptr)
~CGGUserPolynomialBase()=default
boost::tuple< int, int, MatrixDouble > CachePhi
boost::shared_ptr< CachePhi > cachePhiPtr
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, BaseFunctionUnknownInterface **iface) const
MatrixDouble approxSigmaAtPts
MatrixDouble diffStretchTensorAtPts
MatrixPtr getBigG0AtPts()
MatrixPtr getLogStretchTensorAtPts()
VectorDouble normalPressureAtPts
MatrixDouble matDeviatorD
MatrixDouble wL2DotDotAtPts
MatrixDouble logStretchTotalTensorAtPts
MatrixDouble hdOmegaAtPts
MatrixDouble rotAxisDotAtPts
MatrixDouble gradHybridDispAtPts
MatrixDouble leviKirchhoffdOmegaAtPts
MatrixDouble leviKirchhoffPAtPts
MatrixDouble stretchTensorAtPts
MatrixPtr getSmallWL2AtPts()
MatrixPtr getFacePiolaAtPts()
MatrixDouble internalStressAtPts
MatrixPtr getInternalStressAtPts()
MatrixDouble logStretchDotTensorAtPts
MatrixPtr getRotAxisAtPts()
MatrixPtr getRotAxis0AtPts()
VectorDouble detStretchTensorAtPts
MatrixPtr getLeviKirchhoffAtPts()
MatrixPtr getSmallWL2DotDotAtPts()
MatrixDouble adjointPdUdPAtPts
MatrixPtr getRotAxisGradDotAtPts()
MatrixDouble adjointPdstretchAtPts
MatrixPtr getVarLogStreachPts()
MatrixPtr getRotAxisDotAtPts()
MatrixPtr getDivVarPiolaPts()
MatrixPtr getSmallWGradH1AtPts()
MatrixPtr getGradHybridDispAtPts()
MatrixPtr getMatAxiatorDPtr()
MatrixDouble approxPAtPts
MatrixPtr getSmallWH1AtPts()
MatrixPtr getLogStretchDotTensorAtPts()
MatrixDouble divSigmaAtPts
MatrixPtr getContactL2AtPts()
MatrixPtr getApproxSigmaAtPts()
MatrixPtr getApproxPAtPts()
MatrixPtr getStretchTensorAtPts()
MatrixPtr getMatDeviatorDPtr()
MatrixPtr getVarRotAxisPts()
MatrixDouble hdLogStretchAtPts
MatrixPtr getVarPiolaPts()
MatrixPtr getLargeXH1AtPts()
MatrixPtr getSmallWL2DotAtPts()
MatrixPtr getDivSigmaAtPts()
MatrixDouble adjointPdUAtPts
MatrixDouble rotAxis0AtPts
MatrixDouble tractionAtPts
MatrixDouble varLogStreach
MatrixDouble logStretch2H1AtPts
MatrixPtr getGradLogStretchDotTensorAtPts()
VectorPtr getJacobianAtPts()
MatrixDouble logStretchTensorAtPts
VectorDouble jacobianAtPts
MatrixDouble rotAxisGradDotAtPts
MatrixDouble leviKirchhoffdLogStreatchAtPts
MatrixDouble gradLogStretchDotTensorAtPts
MatrixDouble wGradH1AtPts
MatrixDouble leviKirchhoffAtPts
MatrixDouble faceMaterialForceAtPts
MatrixDouble adjointPdUdOmegaAtPts
MatrixDouble externalStrainAtPts
MatrixPtr getMatInvDPtr()
MatrixDouble detStretchTensorAtPts_du
MatrixDouble rotAxisAtPts
boost::shared_ptr< PhysicalEquations > physicsPtr
MatrixDouble facePiolaAtPts
MatrixDouble contactL2AtPts
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)
FTensor::Tensor3< double, 3, 3, 3 > DTensor3
PhysicalEquations()=delete
FTensor::Tensor3< FTensor::PackPtr< double *, 1 >, 3, 3, 3 > DTensor3Ptr
virtual VolUserDataOperator * returnOpSpatialPhysical(const std::string &field_name, boost::shared_ptr< DataAtIntegrationPts > data_ptr, const double alpha_u)
FTensor::Tensor2< FTensor::PackPtr< double *, 1 >, 3, 3 > DTensor2Ptr
virtual VolUserDataOperator * returnOpCalculateStretchFromStress(boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
FTensor::Tensor1< double, 3 > DTensor1
static DTensor3Ptr get_vecTensor3(std::vector< double > &v, const int nba)
FTensor::Tensor2< adouble, 3, 3 > ATensor2
FTensor::Tensor2< double, 3, 3 > DTensor2
PhysicalEquations(const int size_active, const int size_dependent)
virtual VolUserDataOperator * returnOpSetScale(boost::shared_ptr< double > scale_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)
std::vector< double > dependentVariablesPiolaDirevatives
static DTensor2Ptr get_VecTensor2(std::vector< double > &v)
FTensor::Tensor1< adouble, 3 > ATensor1
FTensor::Tensor3< adouble, 3, 3, 3 > ATensor3
virtual MoFEMErrorCode recordTape(const int tag, DTensor2Ptr *t_h)=0
virtual OpJacobian * returnOpJacobian(const int tag, const bool eval_rhs, const bool eval_lhs, boost::shared_ptr< DataAtIntegrationPts > data_ptr, boost::shared_ptr< PhysicalEquations > physics_ptr)=0
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > DTensor0Ptr
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)
std::vector< double > activeVariables
static DTensor0Ptr get_VecTensor0(std::vector< double > &v)
std::vector< double > dependentVariablesPiola
Data on single entity (This is passed as argument to DataOperator::doWork)