v0.14.0
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
EshelbianPlasticity::OpConstrainBoundaryRhs Struct Reference

#include <users_modules/eshelbian_plasticty/src/EshelbianContact.hpp>

Inheritance diagram for EshelbianPlasticity::OpConstrainBoundaryRhs:
[legend]
Collaboration diagram for EshelbianPlasticity::OpConstrainBoundaryRhs:
[legend]

Public Member Functions

 OpConstrainBoundaryRhs (const std::string row_field_name, boost::shared_ptr< ContactOps::CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data)
 

Private Attributes

ContactOps::SurfaceDistanceFunction surfaceDistanceFunction
 
ContactOps::GradSurfaceDistanceFunction gradSurfaceDistanceFunction
 
ContactOps::HessSurfaceDistanceFunction hessSurfaceDistanceFunction
 
boost::shared_ptr< ContactOps::CommonDatacommonDataPtr
 

Detailed Description

Examples
EshelbianPlasticity.cpp.

Definition at line 28 of file EshelbianContact.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryRhs()

EshelbianPlasticity::OpConstrainBoundaryRhs::OpConstrainBoundaryRhs ( const std::string  row_field_name,
boost::shared_ptr< ContactOps::CommonData common_data_ptr 
)

Definition at line 27 of file EshelbianContact.cpp.

30 : ContactOps::AssemblyBoundaryEleOp(row_field_name, row_field_name,
32 commonDataPtr(common_data_ptr) {}
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode EshelbianPlasticity::OpConstrainBoundaryRhs::iNtegrate ( EntitiesFieldData::EntData &  row_data)

Definition at line 35 of file EshelbianContact.cpp.

35 {
37
42
43 const size_t nb_gauss_pts = getGaussPts().size2();
44
45 // #ifndef NDEBUGbase
46 if (commonDataPtr->contactDisp.size2() != nb_gauss_pts) {
47 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
48 "Wrong number of integration pts %d != %d",
49 commonDataPtr->contactDisp.size2(), nb_gauss_pts);
50 }
51 // #endif // !NDEBUG
52
53 auto &nf = locF;
54 locF.clear();
55
56 auto t_w = getFTensor0IntegrationWeight();
57 auto t_disp = getFTensor1FromMat<3>(commonDataPtr->contactDisp);
58 auto t_traction = getFTensor1FromMat<3>(commonDataPtr->contactTraction);
59 auto t_coords = getFTensor1CoordsAtGaussPts();
60 auto t_normal_at_pts = getFTensor1NormalsAtGaussPts();
61
62 auto next = [&]() {
63 ++t_w;
64 ++t_disp;
65 ++t_traction;
66 ++t_coords;
67 ++t_normal_at_pts;
68 };
69
70 size_t nb_base_functions = data.getN().size2() / 3;
71 auto t_base = data.getFTensor1N<3>();
72 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
73
75 t_normal(i) = t_normal_at_pts(i) / t_normal_at_pts.l2();
76
77 auto t_nf = getFTensor1FromPtr<3>(&nf[0]);
78 const double alpha = t_w * getMeasure();
79
80 FTensor::Tensor1<double, 3> t_spatial_coords{0., 0., 0.};
81 t_spatial_coords(i) = t_coords(i) + t_disp(i);
82
83 auto ts_t = getTStime();
84
86 ts_t, t_spatial_coords(0), t_spatial_coords(1), t_spatial_coords(2),
87 t_normal_at_pts(0), t_normal_at_pts(1), t_normal_at_pts(2));
88
89 auto t_grad_sdf = gradSurfaceDistanceFunction(
90 ts_t, t_spatial_coords(0), t_spatial_coords(1), t_spatial_coords(2),
91 t_normal_at_pts(0), t_normal_at_pts(1), t_normal_at_pts(2));
92
93 auto tn = t_traction(i) * t_grad_sdf(i);
94 auto c = ContactOps::constrain(sdf, tn);
95
97 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
99 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
100
102 t_disp_e(i) = t_disp(i) - ContactOps::cn_contact * t_traction(i);
103
105 t_rhs(i) = -c * sdf * t_grad_sdf(i)
106
107 +
108
109 t_cP(i, j) * t_disp(j)
110
111 +
112
113 t_cQ(i, j) * t_disp_e(j);
114
115 size_t bb = 0;
116 for (; bb != nbRows / 3; ++bb) {
117 const double row_base = t_base(i) * t_normal(i);
118 const double beta = alpha * row_base;
119 t_nf(i) -= beta * t_rhs(i);
120 ++t_nf;
121 ++t_base;
122 }
123 for (; bb < nb_base_functions; ++bb)
124 ++t_base;
125
126 next();
127 }
128
130}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
FTensor::Index< 'l', 3 > l
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:572
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
Definition: sdf.py:1
ContactOps::SurfaceDistanceFunction surfaceDistanceFunction
ContactOps::GradSurfaceDistanceFunction gradSurfaceDistanceFunction

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<ContactOps::CommonData> EshelbianPlasticity::OpConstrainBoundaryRhs::commonDataPtr
private

Definition at line 44 of file EshelbianContact.hpp.

◆ gradSurfaceDistanceFunction

ContactOps::GradSurfaceDistanceFunction EshelbianPlasticity::OpConstrainBoundaryRhs::gradSurfaceDistanceFunction
private
Initial value:
=
MatrixDouble grad_surface_distance_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_spatial_coords, MatrixDouble &m_normals_at_pts, int block_id)
Definition: ContactOps.hpp:273

Definition at line 39 of file EshelbianContact.hpp.

◆ hessSurfaceDistanceFunction

ContactOps::HessSurfaceDistanceFunction EshelbianPlasticity::OpConstrainBoundaryRhs::hessSurfaceDistanceFunction
private
Initial value:
=
MatrixDouble hess_surface_distance_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_spatial_coords, MatrixDouble &m_normals_at_pts, int block_id)
Definition: ContactOps.hpp:330

Definition at line 41 of file EshelbianContact.hpp.

◆ surfaceDistanceFunction

ContactOps::SurfaceDistanceFunction EshelbianPlasticity::OpConstrainBoundaryRhs::surfaceDistanceFunction
private
Initial value:
=
VectorDouble surface_distance_function(double delta_t, double t, int nb_gauss_pts, MatrixDouble &m_spatial_coords, MatrixDouble &m_normals_at_pts, int block_id)
Definition: ContactOps.hpp:216

Definition at line 37 of file EshelbianContact.hpp.


The documentation for this struct was generated from the following files: