v0.14.0
Public Member Functions | Public Attributes | Private Attributes | List of all members
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp > Struct Template Reference

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

Inheritance diagram for ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >:
[legend]
Collaboration diagram for ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >:
[legend]

Public Member Functions

 OpConstrainBoundaryLhs_dTractionImpl (const std::string row_field_name, const std::string col_field_name, boost::shared_ptr< CommonData > common_data_ptr, bool is_axisymmetric=false)
 
MoFEMErrorCode iNtegrate (EntitiesFieldData::EntData &row_data, EntitiesFieldData::EntData &col_data)
 

Public Attributes

SurfaceDistanceFunction surfaceDistanceFunction = surface_distance_function
 
GradSurfaceDistanceFunction gradSurfaceDistanceFunction
 

Private Attributes

boost::shared_ptr< CommonDatacommonDataPtr
 
bool isAxisymmetric
 

Detailed Description

template<int DIM, typename AssemblyBoundaryEleOp>
struct ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >

Definition at line 531 of file ContactOps.hpp.

Constructor & Destructor Documentation

◆ OpConstrainBoundaryLhs_dTractionImpl()

template<int DIM, typename AssemblyBoundaryEleOp >
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::OpConstrainBoundaryLhs_dTractionImpl ( const std::string  row_field_name,
const std::string  col_field_name,
boost::shared_ptr< CommonData common_data_ptr,
bool  is_axisymmetric = false 
)

Definition at line 1077 of file ContactOps.hpp.

1080  : AssemblyBoundaryEleOp(row_field_name, col_field_name,
1081  AssemblyBoundaryEleOp::OPROWCOL),
1082  commonDataPtr(common_data_ptr), isAxisymmetric(is_axisymmetric) {
1083  AssemblyBoundaryEleOp::sYmm = false;
1084 }

Member Function Documentation

◆ iNtegrate()

template<int DIM, typename AssemblyBoundaryEleOp >
MoFEMErrorCode ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::iNtegrate ( EntitiesFieldData::EntData row_data,
EntitiesFieldData::EntData col_data 
)

Definition at line 1089 of file ContactOps.hpp.

1090  {
1092 
1096 
1097  const size_t nb_gauss_pts = AssemblyBoundaryEleOp::getGaussPts().size2();
1098  auto &locMat = AssemblyBoundaryEleOp::locMat;
1099 
1100  auto t_normal_at_pts = AssemblyBoundaryEleOp::getFTensor1NormalsAtGaussPts();
1101  auto t_traction = getFTensor1FromMat<DIM>(commonDataPtr->contactTraction);
1102  auto t_coords = AssemblyBoundaryEleOp::getFTensor1CoordsAtGaussPts();
1103 
1104  auto t_w = AssemblyBoundaryEleOp::getFTensor0IntegrationWeight();
1105  auto t_row_base = row_data.getFTensor1N<3>();
1106  size_t nb_face_functions = row_data.getN().size2() / 3;
1107 
1108  auto m_spatial_coords = get_spatial_coords(
1109  BoundaryEleOp::getFTensor1CoordsAtGaussPts(),
1110  getFTensor1FromMat<DIM>(commonDataPtr->contactDisp), nb_gauss_pts);
1111  auto m_normals_at_pts = get_normalize_normals(
1112  BoundaryEleOp::getFTensor1NormalsAtGaussPts(), nb_gauss_pts);
1113 
1114  auto t_normal = getFTensor1FromMat<3>(m_normals_at_pts);
1115 
1116  auto ts_time = AssemblyBoundaryEleOp::getTStime();
1117  auto ts_time_step = AssemblyBoundaryEleOp::getTStimeStep();
1118 
1119  // placeholder to pass boundary block id to python
1120  int block_id = 0;
1121 
1122  auto v_sdf =
1123  surfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
1124  m_spatial_coords, m_normals_at_pts, block_id);
1125 
1126  auto m_grad_sdf =
1127  gradSurfaceDistanceFunction(ts_time_step, ts_time, nb_gauss_pts,
1128  m_spatial_coords, m_normals_at_pts, block_id);
1129 
1130  auto t_sdf = getFTensor0FromVec(v_sdf);
1131  auto t_grad_sdf = getFTensor1FromMat<3>(m_grad_sdf);
1132 
1133  for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
1134 
1135  double jacobian = 1.;
1136  if (isAxisymmetric) {
1137  jacobian = 2. * M_PI * t_coords(0);
1138  }
1139  const double alpha = t_w * jacobian * AssemblyBoundaryEleOp::getMeasure();
1140 
1141  auto tn = -t_traction(i) * t_grad_sdf(i);
1142  auto c = constrain(t_sdf, tn);
1143 
1145  t_cP(i, j) = (c * t_grad_sdf(i)) * t_grad_sdf(j);
1147  t_cQ(i, j) = kronecker_delta(i, j) - t_cP(i, j);
1148 
1150  t_res_dt(i, j) = -cn_contact * t_cQ(i, j);
1151 
1152  size_t rr = 0;
1153  for (; rr != AssemblyBoundaryEleOp::nbRows / DIM; ++rr) {
1154 
1155  auto t_mat = getFTensor2FromArray<DIM, DIM, DIM>(locMat, DIM * rr);
1156  const double row_base = t_row_base(i) * t_normal(i);
1157 
1158  auto t_col_base = col_data.getFTensor1N<3>(gg, 0);
1159  for (size_t cc = 0; cc != AssemblyBoundaryEleOp::nbCols / DIM; ++cc) {
1160  const double col_base = t_col_base(i) * t_normal(i);
1161  const double beta = alpha * row_base * col_base;
1162 
1163  t_mat(i, j) -= beta * t_res_dt(i, j);
1164 
1165  ++t_col_base;
1166  ++t_mat;
1167  }
1168 
1169  ++t_row_base;
1170  }
1171  for (; rr < nb_face_functions; ++rr)
1172  ++t_row_base;
1173 
1174  ++t_traction;
1175  ++t_coords;
1176  ++t_w;
1177  ++t_normal;
1178  ++t_sdf;
1179  ++t_grad_sdf;
1180  }
1181 
1183 }

Member Data Documentation

◆ commonDataPtr

template<int DIM, typename AssemblyBoundaryEleOp >
boost::shared_ptr<CommonData> ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::commonDataPtr
private

Definition at line 545 of file ContactOps.hpp.

◆ gradSurfaceDistanceFunction

template<int DIM, typename AssemblyBoundaryEleOp >
GradSurfaceDistanceFunction ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::gradSurfaceDistanceFunction
Initial value:

Definition at line 541 of file ContactOps.hpp.

◆ isAxisymmetric

template<int DIM, typename AssemblyBoundaryEleOp >
bool ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::isAxisymmetric
private

Definition at line 546 of file ContactOps.hpp.

◆ surfaceDistanceFunction

template<int DIM, typename AssemblyBoundaryEleOp >
SurfaceDistanceFunction ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::surfaceDistanceFunction = surface_distance_function

Definition at line 540 of file ContactOps.hpp.


The documentation for this struct was generated from the following file:
ContactOps::get_spatial_coords
auto get_spatial_coords(FTensor::Tensor1< T1, DIM1 > &&t_coords, FTensor::Tensor1< T2, DIM2 > &&t_disp, size_t nb_gauss_pts)
Definition: ContactOps.hpp:414
ContactOps::constrain
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:603
is_axisymmetric
PetscBool is_axisymmetric
Definition: contact.cpp:93
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::surfaceDistanceFunction
SurfaceDistanceFunction surfaceDistanceFunction
Definition: ContactOps.hpp:540
FTensor::Tensor2
Definition: Tensor2_value.hpp:16
c
const double c
speed of light (cm/ns)
Definition: initial_diffusion.cpp:39
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::commonDataPtr
boost::shared_ptr< CommonData > commonDataPtr
Definition: ContactOps.hpp:545
ContactOps::get_normalize_normals
auto get_normalize_normals(FTensor::Tensor1< T1, DIM1 > &&t_normal_at_pts, size_t nb_gauss_pts)
Definition: ContactOps.hpp:431
MoFEM::getFTensor0FromVec
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
Definition: Templates.hpp:135
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::gradSurfaceDistanceFunction
GradSurfaceDistanceFunction gradSurfaceDistanceFunction
Definition: ContactOps.hpp:541
ContactOps::AssemblyBoundaryEleOp
FormsIntegrators< BoundaryEleOp >::Assembly< A >::OpBase AssemblyBoundaryEleOp
Definition: EshelbianContact.hpp:18
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
FTensor::Index< 'i', DIM >
ContactOps::cn_contact
double cn_contact
Definition: contact.cpp:100
ContactOps::OpConstrainBoundaryLhs_dTractionImpl< DIM, GAUSS, AssemblyBoundaryEleOp >::isAxisymmetric
bool isAxisymmetric
Definition: ContactOps.hpp:546
FTensor::kronecker_delta
Tensor2_Expr< Kronecker_Delta< T >, T, Dim0, Dim1, i, j > kronecker_delta(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
Rank 2.
Definition: Kronecker_Delta.hpp:81
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
ContactOps::grad_surface_distance_function
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:281
k
FTensor::Index< 'k', 3 > k
Definition: matrix_function.cpp:20
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359