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

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

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

Public Member Functions

 OpConstrainBoundaryRhs (const std::string field_name, boost::shared_ptr< CommonData > common_data_ptr)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &data)
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 

Detailed Description

Definition at line 171 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryRhs()

ContactOps::OpConstrainBoundaryRhs::OpConstrainBoundaryRhs ( const std::string  field_name,
boost::shared_ptr< CommonData common_data_ptr 
)
Examples
ContactOps.hpp.

Definition at line 273 of file ContactOps.hpp.

276 commonDataPtr(common_data_ptr) {}
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: contact.cpp:53
constexpr auto field_name
boost::shared_ptr< CommonData > commonDataPtr
Definition: ContactOps.hpp:177
@ OPROW
operator doWork function is executed on FE rows

Member Function Documentation

◆ iNtegrate()

MoFEMErrorCode ContactOps::OpConstrainBoundaryRhs::iNtegrate ( EntitiesFieldData::EntData &  data)
Examples
ContactOps.hpp.

Definition at line 279 of file ContactOps.hpp.

279 {
281
282 const size_t nb_gauss_pts = AssemblyBoundaryEleOp::getGaussPts().size2();
283
284 auto &nf = AssemblyBoundaryEleOp::locF;
285
286 auto t_normal = getFTensor1Normal();
287 t_normal(i) /= sqrt(t_normal(j) * t_normal(j));
288
289 auto t_w = getFTensor0IntegrationWeight();
290 auto t_disp = getFTensor1FromMat<SPACE_DIM>(commonDataPtr->contactDisp);
291 auto t_traction =
292 getFTensor1FromMat<SPACE_DIM>(commonDataPtr->contactTraction);
293 auto t_coords = getFTensor1CoordsAtGaussPts();
294
295 size_t nb_base_functions = data.getN().size2() / 3;
296 auto t_base = data.getFTensor1N<3>();
297 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
298
299 auto t_nf = getFTensor1FromPtr<SPACE_DIM>(&nf[0]);
300 const double alpha = t_w * getMeasure();
301
302 FTensor::Tensor1<double, 3> t_spatial_coords{0., 0., 0.};
303 t_spatial_coords(i) = t_coords(i) + t_disp(i);
304
305 auto sdf =
306 surface_distance_function(getTStime(), t_spatial_coords, t_traction);
307 auto t_grad_sdf = grad_surface_distance_function(
308 getTStime(), t_spatial_coords, t_traction);
309 auto tn = -t_traction(i) * t_grad_sdf(i);
310 auto c = constrain(sdf, tn);
311
313 t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
315 t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
316
318 t_rhs(i) =
319
320 t_cQ(i, j) * (t_disp(j) - cn * t_traction(j))
321
322 +
323
324 t_cP(i, j) * t_disp(j) +
325 c * (sdf * t_grad_sdf(i)); // add gap0 displacements
326
327 size_t bb = 0;
328 for (; bb != AssemblyBoundaryEleOp::nbRows / SPACE_DIM; ++bb) {
329 const double beta = alpha * (t_base(i) * t_normal(i));
330 t_nf(i) -= beta * t_rhs(i);
331
332 ++t_nf;
333 ++t_base;
334 }
335 for (; bb < nb_base_functions; ++bb)
336 ++t_base;
337
338 ++t_disp;
339 ++t_traction;
340 ++t_coords;
341 ++t_w;
342 }
343
345}
constexpr int SPACE_DIM
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
const double c
speed of light (cm/ns)
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
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::OpConstrainBoundaryRhs::commonDataPtr
private
Examples
ContactOps.hpp.

Definition at line 177 of file ContactOps.hpp.


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