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

#include <users_modules/multifield_plasticity/src/ContactOperators.hpp>

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

Public Member Functions

 OpConstrainBoundaryLhs_dU (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntData &row_data, EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 52 of file ContactOperators.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryLhs_dU()

OpContactTools::OpConstrainBoundaryLhs_dU::OpConstrainBoundaryLhs_dU ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)

Definition at line 298 of file ContactOperators.hpp.

301 : BoundaryEleOpAssembly(row_field_name, col_field_name, OPROWCOL),
302 commonDataPtr(common_data_ptr) {
303 sYmm = false;
304}
boost::shared_ptr< CommonData > commonDataPtr

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode OpContactTools::OpConstrainBoundaryLhs_dU::iNtegrate ( EntData row_data,
EntData col_data 
)

Definition at line 305 of file ContactOperators.hpp.

306 {
308
309 const size_t nb_gauss_pts = getGaussPts().size2();
310 const size_t row_nb_dofs = row_data.getIndices().size();
311 const size_t col_nb_dofs = col_data.getIndices().size();
312
313 if (row_nb_dofs && col_nb_dofs) {
314
315
316 auto t_normal = getFTensor1Normal();
317 const double ls = sqrt(t_normal(i) * t_normal(i));
318 t_normal(i) /= ls;
319
320 auto t_disp = getFTensor1FromMat<3>(*(commonDataPtr->mDispPtr));
321 auto t_traction =
322 getFTensor1FromMat<3>(*(commonDataPtr->contactTractionPtr));
323 auto t_coords = getFTensor1CoordsAtGaussPts();
324
325 auto t_w = getFTensor0IntegrationWeight();
326 auto t_row_base = row_data.getFTensor1N<3>();
327 size_t nb_face_functions = row_data.getN().size2() / 3;
328
329 auto t_contact_normal =
330 getFTensor1FromMat<3>(*(commonDataPtr->contactNormalPtr));
331 auto t_gap = getFTensor0FromVec(*(commonDataPtr->contactGapPtr));
332 auto t_gap_diff =
333 getFTensor1FromMat<3>(*(commonDataPtr->contactGapDiffPtr));
334 auto t_diff_normal =
335 getFTensor2FromMat<3, 3>(*(commonDataPtr->contactNormalDiffPtr));
337 auto &cn = (*cache).cn_cont;
338
339 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
340
341 const double alpha = t_w * getMeasure();
342
343 if (getNormalsAtGaussPts().size1() == nb_gauss_pts) {
344 VectorDouble n = getNormalsAtGaussPts(gg);
345 auto t_n = getFTensor1FromPtr<3>(&*n.data().begin());
346 t_normal(i) = t_n(i) / sqrt(t_n(j) * t_n(j));
347 }
348
349 Tensor3<double, 3, 3, 3> t_diff_contact_tangent_tensor;
350 t_diff_contact_tangent_tensor(i, j, k) =
351 -t_diff_normal(i, k) * t_contact_normal(j) -
352 t_contact_normal(i) * t_diff_normal(j, k);
353
354 Tensor2<double, 3, 3> t_P;
355 t_P(i, j) = t_contact_normal(i) * t_contact_normal(j);
356
357 Tensor2<double, 3, 3> t_Q;
358 t_Q(i, j) = kronecker_delta(i, j) - t_P(i, j);
359 const double gap_0 = gap0(t_gap, t_disp, t_contact_normal);
360
361 t1(i) = t_contact_normal(i) - 0.5 * t_gap_diff(i) +
362 0.5 * cn * t_traction(j) * t_diff_normal(i, j) +
363 t_disp(j) * t_diff_normal(i, j) +
364 0.5 * sign(t_gap + cn * t_traction(k) * t_contact_normal(k)) *
365 (t_gap_diff(i) + cn * t_traction(j) * t_diff_normal(i, j));
366
367 auto constrain = constraint(
368 gap_0, t_gap, normal_traction(t_traction, t_contact_normal));
369 size_t rr = 0;
370 for (; rr != row_nb_dofs / 3; ++rr) {
371
372 auto t_mat = getFTensor2FromArray<3, 3, 3>(locMat, 3 * rr);
373 const double row_base = t_row_base(i) * t_normal(i);
374
375 auto t_col_base = col_data.getFTensor0N(gg, 0);
376
377 for (size_t cc = 0; cc != col_nb_dofs / 3; ++cc) {
378 const double beta = alpha * row_base * t_col_base;
379
380 // linearisation of t_rhs_constrains(i)
381 t_mat(i, j) -= beta * t_contact_normal(i) * t1(j);
382 t_mat(i, j) -= (beta * constrain) * t_diff_normal(i, j);
383
384 // // linearisation of t_rhs_tangent_disp(i)
385 t_mat(i, j) -= beta * t_Q(i, j);
386 t_mat(i, k) -=
387 beta * t_diff_contact_tangent_tensor(i, j, k) * t_disp(j);
388
389 // // linearisation of t_rhs_tangent_traction(i);
390 t_mat(i, k) += beta * t_diff_contact_tangent_tensor(i, j, k) *
391 (*cache).cn_cont * t_traction(j);
392
393 ++t_col_base;
394 ++t_mat;
395 }
396 ++t_row_base;
397 }
398 for (; rr < nb_face_functions; ++rr)
399 ++t_row_base;
400
401 ++t_contact_normal;
402 ++t_gap;
403 ++t_gap_diff;
404 ++t_diff_normal;
405 ++t_disp;
406 ++t_traction;
407 ++t_coords;
408 ++t_w;
409 }
410
411 }
412
414}
double cn
Definition: contact.cpp:124
#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
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
FTensor::Index< 'k', 3 > k
double constrain(double sdf, double tn)
Definition: ContactOps.hpp:268
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
double constraint(double g0, double g, double &&t)
double gap0(double g, FTensor::Tensor1< T, 3 > &t_disp, FTensor::Tensor1< T, 3 > &t_normal)
double normal_traction(Tensor1< T1, 3 > &t_traction, Tensor1< T2, 3 > &t_normal)
double sign(double x)
FTensor::Tensor0< FTensor::PackPtr< double *, 1 > > getFTensor0N(const FieldApproximationBase base)
Get base function as Tensor0.
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
FTensor::Tensor1< FTensor::PackPtr< double *, Tensor_Dim >, Tensor_Dim > getFTensor1N(FieldApproximationBase base)
Get base functions for Hdiv/Hcurl spaces.
const VectorInt & getIndices() const
Get global indices of dofs on entity.

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> OpContactTools::OpConstrainBoundaryLhs_dU::commonDataPtr
private

Definition at line 60 of file ContactOperators.hpp.


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