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

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

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

Public Member Functions

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

Private Attributes

ContactOps::SurfaceDistanceFunction surfaceDistanceFunction
 
ContactOps::GradSurfaceDistanceFunction gradSurfaceDistanceFunction
 
ContactOps::HessSurfaceDistanceFunction hessSurfaceDistanceFunction
 
boost::shared_ptr< ContactOps::CommonDatacommonDataPtr
 
boost::shared_ptr< EntitiesFieldData::EntData > colDataPtr
 

Detailed Description

Examples
EshelbianPlasticity.cpp.

Definition at line 47 of file EshelbianContact.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryLhs_dU()

EshelbianPlasticity::OpConstrainBoundaryLhs_dU::OpConstrainBoundaryLhs_dU ( const std::string  row_field_name,
boost::shared_ptr< ContactOps::CommonData common_data_ptr,
boost::shared_ptr< EntitiesFieldData::EntData >  col_data_ptr 
)

Definition at line 132 of file EshelbianContact.cpp.

136 : ContactOps::AssemblyBoundaryEleOp(row_field_name, row_field_name,
138 commonDataPtr(common_data_ptr), colDataPtr(col_data_ptr) {}
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
boost::shared_ptr< EntitiesFieldData::EntData > colDataPtr
boost::shared_ptr< ContactOps::CommonData > commonDataPtr
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ aSsemble()

MoFEMErrorCode EshelbianPlasticity::OpConstrainBoundaryLhs_dU::aSsemble ( EntitiesFieldData::EntData &  row_data)

Definition at line 283 of file EshelbianContact.cpp.

283 {
285 auto &locMat = ContactOps::AssemblyBoundaryEleOp::locMat;
286 CHKERR matSetValuesHook(this, row_data, *colDataPtr, locMat);
288}
#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
#define CHKERR
Inline error check.
Definition: definitions.h:535

◆ iNtegrate()

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

Definition at line 141 of file EshelbianContact.cpp.

141 {
143
144 using namespace ContactOps;
145
149
150 auto nb_rows = row_data.getIndices().size();
151 auto nb_cols = colDataPtr->getIndices().size();
152
153 auto &locMat = AssemblyBoundaryEleOp::locMat;
154 locMat.resize(nb_rows, nb_cols, false);
155 locMat.clear();
156
157 if (nb_cols && nb_rows) {
158
159 const size_t nb_gauss_pts = getGaussPts().size2();
160
161 // #ifndef NDEBUG
162 if (row_data.getN().size1() != nb_gauss_pts) {
163 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
164 "Wrong number of integration pts %d != %d",
165 row_data.getN().size1(), nb_gauss_pts);
166 }
167 if (row_data.getN().size2() < nb_rows / 3) {
168 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
169 "Wrong number of base functions", row_data.getN().size2(),
170 nb_rows / 3);
171 }
172 if (colDataPtr->getN().size1() != nb_gauss_pts) {
173 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
174 "Wrong number of integration pts %d != %d",
175 colDataPtr->getN().size1(), nb_gauss_pts);
176 }
177 if (colDataPtr->getN().size2() < nb_cols / 3) {
178 SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
179 "Wrong number of base functions", colDataPtr->getN().size2(),
180 nb_cols / 3);
181 }
182 // #endif
183
184 auto t_w = getFTensor0IntegrationWeight();
185 auto t_disp = getFTensor1FromMat<3>(commonDataPtr->contactDisp);
186 auto t_traction = getFTensor1FromMat<3>(commonDataPtr->contactTraction);
187 auto t_coords = getFTensor1CoordsAtGaussPts();
188 auto t_normal_at_pts = getFTensor1NormalsAtGaussPts();
189
190 auto next = [&]() {
191 ++t_w;
192 ++t_disp;
193 ++t_traction;
194 ++t_coords;
195 ++t_normal_at_pts;
196 };
197
198 auto t_row_base = row_data.getFTensor1N<3>();
199 auto nb_face_functions = row_data.getN().size2() / 3;
200
201 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
202
203 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
204
206 t_normal(i) = t_normal_at_pts(i) / t_normal_at_pts.l2();
207
208 const double alpha = t_w * getMeasure();
209
210 FTensor::Tensor1<double, 3> t_spatial_coords{0., 0., 0.};
211 t_spatial_coords(i) = t_coords(i) + t_disp(i);
212
213 auto ts_time = getTStime();
214
216 ts_time, t_spatial_coords(0), t_spatial_coords(1),
217 t_spatial_coords(2), t_normal_at_pts(0), t_normal_at_pts(1),
218 t_normal_at_pts(2));
219 auto t_grad_sdf = gradSurfaceDistanceFunction(
220 ts_time, t_spatial_coords(0), t_spatial_coords(1),
221 t_spatial_coords(2), t_normal_at_pts(0), t_normal_at_pts(1),
222 t_normal_at_pts(2));
223
224 auto t_hess_sdf = hessSurfaceDistanceFunction(
225 ts_time, t_spatial_coords(0), t_spatial_coords(1),
226 t_spatial_coords(2), t_normal_at_pts(0), t_normal_at_pts(1),
227 t_normal_at_pts(2));
228
229 auto tn = t_traction(i) * t_grad_sdf(i);
230 auto c = constrain(sdf, tn);
231
233 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
235 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
236
238 t_disp_e(i) = t_disp(i) - ContactOps::cn_contact * t_traction(i);
239
241 t_res_dU(i, j) =
242
243 -c * sdf * t_hess_sdf(i, j) +
244 c * (t_hess_sdf(i, j) * t_grad_sdf(k) * t_disp(k) +
245 t_grad_sdf(i) * t_hess_sdf(k, j) * t_disp(k))
246
247 +
248
249 t_cQ(i, j)
250
251 -
252
253 c * (t_hess_sdf(i, j) * t_grad_sdf(k) * t_disp_e(k) +
254 t_grad_sdf(i) * t_hess_sdf(k, j) * t_disp_e(k));
255
256 size_t rr = 0;
257 for (; rr != nb_rows / 3; ++rr) {
258
259 auto t_mat = getFTensor2FromArray<3, 3, 3>(locMat, 3 * rr);
260 const double row_base = t_row_base(i) * t_normal(i);
261 auto t_col_base = colDataPtr->getFTensor0N(gg, 0);
262
263 for (size_t cc = 0; cc != nb_cols / 3; ++cc) {
264 const double beta = alpha * row_base * t_col_base;
265 t_mat(i, j) -= beta * t_res_dU(i, j);
266 ++t_col_base;
267 ++t_mat;
268 }
269
270 ++t_row_base;
271 }
272 for (; rr < nb_face_functions; ++rr)
273 ++t_row_base;
274
275 next();
276 }
277 }
278
280}
Kronecker Delta class.
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
constexpr auto t_kd
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
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
ContactOps::HessSurfaceDistanceFunction hessSurfaceDistanceFunction
MatrixDouble locMat
local entity block matrix

Member Data Documentation

◆ colDataPtr

boost::shared_ptr<EntitiesFieldData::EntData> EshelbianPlasticity::OpConstrainBoundaryLhs_dU::colDataPtr
private

Definition at line 66 of file EshelbianContact.hpp.

◆ commonDataPtr

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

Definition at line 65 of file EshelbianContact.hpp.

◆ gradSurfaceDistanceFunction

ContactOps::GradSurfaceDistanceFunction EshelbianPlasticity::OpConstrainBoundaryLhs_dU::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 60 of file EshelbianContact.hpp.

◆ hessSurfaceDistanceFunction

ContactOps::HessSurfaceDistanceFunction EshelbianPlasticity::OpConstrainBoundaryLhs_dU::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 62 of file EshelbianContact.hpp.

◆ surfaceDistanceFunction

ContactOps::SurfaceDistanceFunction EshelbianPlasticity::OpConstrainBoundaryLhs_dU::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 58 of file EshelbianContact.hpp.


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