v0.14.0
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
ContactOps Namespace Reference

Classes

struct  CommonData
 [Common data] More...
 
struct  ContactIntegrators
 
struct  Monitor
 
struct  OpAssembleTotalContactTractionImpl
 
struct  OpAssembleTotalContactTractionImpl< DIM, GAUSS, BoundaryEleOp >
 
struct  OpConstrainBoundaryLhs_dTractionImpl
 
struct  OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >
 
struct  OpConstrainBoundaryLhs_dUImpl
 
struct  OpConstrainBoundaryLhs_dUImpl< DIM, GAUSS, AssemblyBoundaryEleOp >
 
struct  OpConstrainBoundaryRhsImpl
 
struct  OpConstrainBoundaryRhsImpl< DIM, GAUSS, AssemblyBoundaryEleOp >
 
struct  OpEvaluateSDFImpl
 
struct  OpEvaluateSDFImpl< DIM, GAUSS, BoundaryEleOp >
 
struct  OpMixLhsSide
 
struct  PostProcEleByDim
 
struct  PostProcEleByDim< 2 >
 
struct  PostProcEleByDim< 3 >
 

Typedefs

using EntData = EntitiesFieldData::EntData
 
using BoundaryEle = FaceElementForcesAndSourcesCore
 
using BoundaryEleOp = BoundaryEle::UserDataOperator
 
using AssemblyBoundaryEleOp = FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase
 
using SurfaceDistanceFunction = boost::function< double(double t, double x, double y, double z, double tx, double ty, double tz)>
 [Common data] More...
 
using GradSurfaceDistanceFunction = boost::function< FTensor::Tensor1< double, 3 >(double t, double x, double y, double z, double tx, double ty, double tz)>
 
using HessSurfaceDistanceFunction = boost::function< FTensor::Tensor2_symmetric< double, 3 >(double t, double x, double y, double z, double tx, double ty, double tz)>
 
using PostProcEleDomain = PostProcEleByDim< SPACE_DIM >::PostProcEleDomain
 
using SideEle = PostProcEleByDim< SPACE_DIM >::SideEle
 
using PostProcEleBdy = PostProcEleByDim< SPACE_DIM >::PostProcEleBdy
 

Functions

double surface_distance_function (double t, double x, double y, double z, double tx, double ty, double tz)
 
FTensor::Tensor1< double, 3 > grad_surface_distance_function (double t, double x, double y, double z, double tx, double ty, double tz)
 
FTensor::Tensor2_symmetric< double, 3 > hess_surface_distance_function (double t, double x, double y, double z, double tx, double ty, double tz)
 
double sign (double x)
 
double w (const double sdf, const double tn)
 
double constrain (double sdf, double tn)
 constrain function More...
 
template<int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp >
MoFEMErrorCode opFactoryDomainRhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string sigma, std::string u)
 
template<int DIM, AssemblyType A, IntegrationType I, typename DomainEle >
MoFEMErrorCode opFactoryBoundaryToDomainLhs (MoFEM::Interface &m_field, boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string fe_domain_name, std::string sigma, std::string u, std::string geom, ForcesAndSourcesCore::RuleHookFun rule)
 
template<int DIM, AssemblyType A, IntegrationType I, typename BoundaryEleOp >
MoFEMErrorCode opFactoryBoundaryLhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string sigma, std::string u)
 
template<int DIM, AssemblyType A, IntegrationType I, typename BoundaryEleOp >
MoFEMErrorCode opFactoryBoundaryRhs (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string sigma, std::string u)
 
template<int DIM, IntegrationType I, typename BoundaryEleOp >
MoFEMErrorCode opFactoryCalculateTraction (boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &pip, std::string sigma)
 

Variables

double cn_contact = 1
 
double scale = 1
 

Typedef Documentation

◆ AssemblyBoundaryEleOp

using ContactOps::AssemblyBoundaryEleOp = typedef FormsIntegrators<BoundaryEleOp>::Assembly<A>::OpBase
Examples
ContactOps.hpp.

Definition at line 16 of file EshelbianContact.hpp.

◆ BoundaryEle

Definition at line 13 of file EshelbianContact.hpp.

◆ BoundaryEleOp

Examples
ContactOps.hpp.

Definition at line 14 of file EshelbianContact.hpp.

◆ EntData

using ContactOps::EntData = typedef EntitiesFieldData::EntData

Definition at line 12 of file EshelbianContact.hpp.

◆ GradSurfaceDistanceFunction

Examples
ContactOps.hpp.

Definition at line 206 of file ContactOps.hpp.

◆ HessSurfaceDistanceFunction

Examples
ContactOps.hpp.

Definition at line 209 of file ContactOps.hpp.

◆ PostProcEleBdy

Definition at line 26 of file PostProcContact.hpp.

◆ PostProcEleDomain

Definition at line 24 of file PostProcContact.hpp.

◆ SideEle

Definition at line 25 of file PostProcContact.hpp.

◆ SurfaceDistanceFunction

typedef boost::function< double(double t, double x, double y, double z, double tx, double ty, double tz)> ContactOps::SurfaceDistanceFunction

[Common data]

[Surface distance function from python] [Surface distance function from python]

Examples
ContactOps.hpp.

Definition at line 203 of file ContactOps.hpp.

Function Documentation

◆ constrain()

double ContactOps::constrain ( double  sdf,
double  tn 
)
inline

constrain function

return 1 if negative sdf or positive tn

Parameters
sdfsigned distance
tntraction
Returns
double

return 1 if negative sdn or positive tn

Parameters
sdfsigned distance
tntraction
Returns
double
Examples
ContactOps.hpp.

Definition at line 400 of file ContactOps.hpp.

400 {
401 const auto s = sign(w(sdf, tn));
402 return (1 - s) / 2;
403}
Definition: sdf.py:1

◆ grad_surface_distance_function()

FTensor::Tensor1< double, 3 > ContactOps::grad_surface_distance_function ( double  t,
double  x,
double  y,
double  z,
double  tx,
double  ty,
double  tz 
)
inline
Examples
ContactOps.hpp.

Definition at line 229 of file ContactOps.hpp.

230 {
231#ifdef PYTHON_SFD
232 if (auto sdf_ptr = sdfPythonWeakPtr.lock()) {
233 std::vector<double> grad_sdf;
234 CHK_MOAB_THROW(sdf_ptr->evalGradSdf(t, x, y, z, tx, ty, tz, grad_sdf),
235 "Failed python call");
236 return FTensor::Tensor1<double, 3>{grad_sdf[0], grad_sdf[1], grad_sdf[2]};
237 }
238#endif
239 return FTensor::Tensor1<double, 3>{0., 1., 0.};
240}
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:576
constexpr double t
plate stiffness
Definition: plate.cpp:59

◆ hess_surface_distance_function()

FTensor::Tensor2_symmetric< double, 3 > ContactOps::hess_surface_distance_function ( double  t,
double  x,
double  y,
double  z,
double  tx,
double  ty,
double  tz 
)
inline
Examples
ContactOps.hpp.

Definition at line 243 of file ContactOps.hpp.

244 {
245#ifdef PYTHON_SFD
246 if (auto sdf_ptr = sdfPythonWeakPtr.lock()) {
247 std::vector<double> hess_sdf;
248 CHK_MOAB_THROW(sdf_ptr->evalHessSdf(t, x, y, z, tx, ty, tz, hess_sdf),
249 "Failed python call");
250 return FTensor::Tensor2_symmetric<double, 3>{hess_sdf[0], hess_sdf[1],
251 hess_sdf[2], hess_sdf[3],
252 hess_sdf[4], hess_sdf[5]};
253 }
254#endif
255 return FTensor::Tensor2_symmetric<double, 3>{0., 0., 0., 0., 0., 0.};
256}

◆ opFactoryBoundaryLhs()

template<int DIM, AssemblyType A, IntegrationType I, typename BoundaryEleOp >
MoFEMErrorCode ContactOps::opFactoryBoundaryLhs ( boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip,
std::string  sigma,
std::string  u 
)
Examples
ContactOps.hpp.

Definition at line 918 of file ContactOps.hpp.

920 {
922
924
925 auto common_data_ptr = boost::make_shared<ContactOps::CommonData>();
926
927 pip.push_back(new OpCalculateVectorFieldValues<DIM>(
928 u, common_data_ptr->contactDispPtr()));
929 pip.push_back(new OpCalculateHVecTensorTrace<DIM, BoundaryEleOp>(
930 sigma, common_data_ptr->contactTractionPtr()));
931 pip.push_back(
932 new typename C::template Assembly<A>::template OpConstrainBoundaryLhs_dU<
933 DIM, GAUSS>(sigma, u, common_data_ptr));
934 pip.push_back(new typename C::template Assembly<A>::
935 template OpConstrainBoundaryLhs_dTraction<DIM, GAUSS>(
936 sigma, sigma, common_data_ptr));
937
939}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416

◆ opFactoryBoundaryRhs()

template<int DIM, AssemblyType A, IntegrationType I, typename BoundaryEleOp >
MoFEMErrorCode ContactOps::opFactoryBoundaryRhs ( boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip,
std::string  sigma,
std::string  u 
)
Examples
ContactOps.hpp.

Definition at line 942 of file ContactOps.hpp.

944 {
946
948
949 auto common_data_ptr = boost::make_shared<ContactOps::CommonData>();
950
951 pip.push_back(new OpCalculateVectorFieldValues<DIM>(
952 u, common_data_ptr->contactDispPtr()));
953 pip.push_back(new OpCalculateHVecTensorTrace<DIM, BoundaryEleOp>(
954 sigma, common_data_ptr->contactTractionPtr()));
955 pip.push_back(
956 new typename C::template Assembly<A>::template OpConstrainBoundaryRhs<
957 DIM, GAUSS>(sigma, common_data_ptr));
958
960}

◆ opFactoryBoundaryToDomainLhs()

template<int DIM, AssemblyType A, IntegrationType I, typename DomainEle >
MoFEMErrorCode ContactOps::opFactoryBoundaryToDomainLhs ( MoFEM::Interface m_field,
boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip,
std::string  fe_domain_name,
std::string  sigma,
std::string  u,
std::string  geom,
ForcesAndSourcesCore::RuleHookFun  rule 
)
Examples
ContactOps.hpp.

Definition at line 882 of file ContactOps.hpp.

886 {
888
889 using DomainEleOp = typename DomainEle::UserDataOperator;
890
891 auto op_loop_side = new OpLoopSide<DomainEle>(
892 m_field, fe_domain_name, DIM, Sev::noisy,
893 boost::make_shared<ForcesAndSourcesCore::UserDataOperator::AdjCache>());
894 pip.push_back(op_loop_side);
895
896 CHKERR AddHOOps<DIM, DIM, DIM>::add(op_loop_side->getOpPtrVector(),
897 {H1, HDIV}, geom);
898
899 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
900 A>::template BiLinearForm<I>;
901
902 using OpMixDivULhs = typename B::template OpMixDivTimesVec<DIM>;
903 using OpLambdaGraULhs = typename B::template OpMixTensorTimesGrad<DIM>;
904 using OpMixDivULhsSide = OpMixLhsSide<OpMixDivULhs>;
905 using OpLambdaGraULhsSide = OpMixLhsSide<OpLambdaGraULhs>;
906
907 auto unity = []() { return 1; };
908 op_loop_side->getOpPtrVector().push_back(
909 new OpMixDivULhsSide(sigma, u, unity, true));
910 op_loop_side->getOpPtrVector().push_back(
911 new OpLambdaGraULhsSide(sigma, u, unity, true));
912
913 op_loop_side->getSideFEPtr()->getRuleHook = rule;
915}
#define CHKERR
Inline error check.
Definition: definitions.h:535
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::BiLinearForm< GAUSS >::OpMixDivTimesVec< 3 > OpMixDivULhs
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::BiLinearForm< GAUSS >::OpMixTensorTimesGrad< 3 > OpLambdaGraULhs
constexpr AssemblyType A

◆ opFactoryCalculateTraction()

template<int DIM, IntegrationType I, typename BoundaryEleOp >
MoFEMErrorCode ContactOps::opFactoryCalculateTraction ( boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip,
std::string  sigma 
)
Examples
ContactOps.hpp.

Definition at line 963 of file ContactOps.hpp.

965 {
967
969
970 auto common_data_ptr = boost::make_shared<ContactOps::CommonData>();
971 pip.push_back(new OpCalculateHVecTensorTrace<DIM, BoundaryEleOp>(
972 sigma, common_data_ptr->contactTractionPtr()));
973 pip.push_back(new typename C::template OpAssembleTotalContactTraction<DIM, I>(
974 common_data_ptr, 1. / scale));
975
977}
double scale
Definition: plastic.cpp:170

◆ opFactoryDomainRhs()

template<int DIM, AssemblyType A, IntegrationType I, typename DomainEleOp >
MoFEMErrorCode ContactOps::opFactoryDomainRhs ( boost::ptr_deque< ForcesAndSourcesCore::UserDataOperator > &  pip,
std::string  sigma,
std::string  u 
)
Examples
ContactOps.hpp.

Definition at line 826 of file ContactOps.hpp.

828 {
830 using B = typename FormsIntegrators<DomainEleOp>::template Assembly<
831 A>::template LinearForm<I>;
832 using OpMixDivURhs = typename B::template OpMixDivTimesU<3, DIM, DIM>;
833 using OpMixLambdaGradURhs = typename B::template OpMixTensorTimesGradU<DIM>;
835 typename B::template OpMixVecTimesDivLambda<SPACE_DIM>;
837 typename B::template OpGradTimesTensor<1, DIM, DIM>;
838
839 auto common_data_ptr = boost::make_shared<ContactOps::CommonData>();
840 auto mat_grad_ptr = boost::make_shared<MatrixDouble>();
841 auto div_stress_ptr = boost::make_shared<MatrixDouble>();
842 auto contact_stress_ptr = boost::make_shared<MatrixDouble>();
843
844 pip.push_back(new OpCalculateVectorFieldValues<DIM>(
845 u, common_data_ptr->contactDispPtr()));
846 pip.push_back(
847 new OpCalculateHVecTensorField<DIM, DIM>(sigma, contact_stress_ptr));
848 pip.push_back(
849 new OpCalculateHVecTensorDivergence<DIM, DIM>(sigma, div_stress_ptr));
850
851 pip.push_back(new OpCalculateVectorFieldGradient<DIM, DIM>(u, mat_grad_ptr));
852
853 pip.push_back(
854 new OpMixDivURhs(sigma, common_data_ptr->contactDispPtr(),
855 [](double, double, double) constexpr { return 1; }));
856 pip.push_back(new OpMixLambdaGradURhs(sigma, mat_grad_ptr));
857 pip.push_back(new OpMixUTimesDivLambdaRhs(u, div_stress_ptr));
858 pip.push_back(new OpMixUTimesLambdaRhs(u, contact_stress_ptr));
859
861}
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::LinearForm< GAUSS >::OpGradTimesTensor< 1, 3, 3 > OpMixUTimesLambdaRhs
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::LinearForm< GAUSS >::OpMixVecTimesDivLambda< 3 > OpMixUTimesDivLambdaRhs
FormsIntegrators< DomainEleOp >::Assembly< USER_ASSEMBLE >::LinearForm< GAUSS >::OpMixDivTimesU< 3, 3, 3 > OpMixDivURhs
FormsIntegrators< DomainEleOp >::Assembly< A >::LinearForm< I >::OpGradTimesTensor< 1, FIELD_DIM, SPACE_DIM > OpGradTimesTensor

◆ sign()

double ContactOps::sign ( double  x)
inline
Examples
ContactOps.hpp.

Definition at line 378 of file ContactOps.hpp.

378 {
379 if (x == 0)
380 return 0;
381 else if (x > 0)
382 return 1;
383 else
384 return -1;
385};

◆ surface_distance_function()

double ContactOps::surface_distance_function ( double  t,
double  x,
double  y,
double  z,
double  tx,
double  ty,
double  tz 
)
inline
Examples
ContactOps.hpp.

Definition at line 214 of file ContactOps.hpp.

215 {
216
217#ifdef PYTHON_SFD
218 if (auto sdf_ptr = sdfPythonWeakPtr.lock()) {
219 double sdf;
220 CHK_MOAB_THROW(sdf_ptr->evalSdf(t, x, y, z, tx, ty, tz, sdf),
221 "Failed python call");
222 return sdf;
223 }
224#endif
225 return y + 0.5;
226}

◆ w()

double ContactOps::w ( const double  sdf,
const double  tn 
)
inline
Examples
ContactOps.hpp.

Definition at line 387 of file ContactOps.hpp.

387 {
388 return sdf - cn_contact * tn;
389}

Variable Documentation

◆ cn_contact

double ContactOps::cn_contact = 1
Examples
ContactOps.hpp, and plastic.cpp.

Definition at line 19 of file EshelbianContact.hpp.

◆ scale

double ContactOps::scale = 1
Examples
ContactOps.hpp.

Definition at line 20 of file EshelbianContact.hpp.