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

#include <users_modules/tutorials/adv-1/src/ContactOps.hpp>

Inheritance diagram for ContactOps::OpConstrainBoundaryLhs_dU:
[legend]
Collaboration diagram for ContactOps::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 (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 180 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryLhs_dU()

ContactOps::OpConstrainBoundaryLhs_dU::OpConstrainBoundaryLhs_dU ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr 
)
Examples
ContactOps.hpp.

Definition at line 347 of file ContactOps.hpp.

350 : AssemblyBoundaryEleOp(row_field_name, col_field_name,
352 commonDataPtr(common_data_ptr) {
353 sYmm = false;
354}
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: contact.cpp:53
boost::shared_ptr< CommonData > commonDataPtr
Definition: ContactOps.hpp:188
@ OPROWCOL
operator doWork is executed on FE rows &columns

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode ContactOps::OpConstrainBoundaryLhs_dU::iNtegrate ( EntitiesFieldData::EntData &  row_data,
EntitiesFieldData::EntData &  col_data 
)
Examples
ContactOps.hpp.

Definition at line 357 of file ContactOps.hpp.

358 {
360
361 const size_t nb_gauss_pts = getGaussPts().size2();
362 auto &locMat = AssemblyBoundaryEleOp::locMat;
363
364 auto t_normal = getFTensor1Normal();
365 t_normal(i) /= sqrt(t_normal(j) * t_normal(j));
366
367 auto t_disp = getFTensor1FromMat<SPACE_DIM>(commonDataPtr->contactDisp);
368 auto t_traction =
369 getFTensor1FromMat<SPACE_DIM>(commonDataPtr->contactTraction);
370 auto t_coords = getFTensor1CoordsAtGaussPts();
371
372 auto t_w = getFTensor0IntegrationWeight();
373 auto t_row_base = row_data.getFTensor1N<3>();
374 size_t nb_face_functions = row_data.getN().size2() / 3;
375
376 constexpr auto t_kd = FTensor::Kronecker_Delta<int>();
377
378 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
379
380 const double alpha = t_w * getMeasure();
381
382 FTensor::Tensor1<double, 3> t_spatial_coords{0., 0., 0.};
383 t_spatial_coords(i) = t_coords(i) + t_disp(i);
384
385 auto sdf =
386 surface_distance_function(getTStime(), t_spatial_coords, t_traction);
387 auto t_grad_sdf = grad_surface_distance_function(
388 getTStime(), t_spatial_coords, t_traction);
389
390 auto tn = -t_traction(i) * t_grad_sdf(i);
391 auto c = constrain(sdf, tn);
392
394 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
396 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
397
399 t_res_dU(i, j) =
400 kronecker_delta(i, j) + t_cP(i, j);
401
402 if(c>0) {
403 auto t_hess_sdf = hess_surface_distance_function(
404 getTStime(), t_spatial_coords, t_traction);
405 t_res_dU(i, j) +=
406 (c * cn) * (t_hess_sdf(i, j) * (t_grad_sdf(k) * t_traction(k)) +
407 t_grad_sdf(i) * t_hess_sdf(k, j) * t_traction(k)) +
408 c * sdf * t_hess_sdf(i, j);
409 }
410
411 size_t rr = 0;
412 for (; rr != AssemblyBoundaryEleOp::nbRows / SPACE_DIM; ++rr) {
413
414 auto t_mat = getFTensor2FromArray<SPACE_DIM, SPACE_DIM, SPACE_DIM>(
415 locMat, SPACE_DIM * rr);
416
417 const double row_base = t_row_base(i) * t_normal(i);
418
419 auto t_col_base = col_data.getFTensor0N(gg, 0);
420 for (size_t cc = 0; cc != AssemblyBoundaryEleOp::nbCols / SPACE_DIM;
421 ++cc) {
422 const double beta = alpha * row_base * t_col_base;
423
424 t_mat(i, j) -= beta * t_res_dU(i, j);
425
426 ++t_col_base;
427 ++t_mat;
428 }
429
430 ++t_row_base;
431 }
432 for (; rr < nb_face_functions; ++rr)
433 ++t_row_base;
434
435 ++t_disp;
436 ++t_traction;
437 ++t_coords;
438 ++t_w;
439 }
440
442}
constexpr int SPACE_DIM
Kronecker Delta class.
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
constexpr auto t_kd
const double c
speed of light (cm/ns)
FTensor::Index< 'k', SPACE_DIM > k
Definition: ContactOps.hpp:168
FTensor::Tensor1< double, 3 > grad_surface_distance_function(double t, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, SPACE_DIM > &t_traction)
Definition: ContactOps.hpp:221
FTensor::Index< 'j', SPACE_DIM > j
Definition: ContactOps.hpp:167
FTensor::Index< 'i', SPACE_DIM > i
[Common data]
Definition: ContactOps.hpp:166
FTensor::Tensor2_symmetric< double, 3 > hess_surface_distance_function(double t, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, SPACE_DIM > &t_traction)
Definition: ContactOps.hpp:239
double surface_distance_function(double t, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, SPACE_DIM > &t_traction)
Definition: ContactOps.hpp:204
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.
Definition: sdf.py:1

Member Data Documentation

◆ commonDataPtr

boost::shared_ptr<CommonData> ContactOps::OpConstrainBoundaryLhs_dU::commonDataPtr
private
Examples
ContactOps.hpp.

Definition at line 188 of file ContactOps.hpp.


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