v0.14.0
Classes | Typedefs | Enumerations | Functions | Variables
EshelbianPlasticity Namespace Reference

Classes

struct  BcDisp
 
struct  BcRot
 
struct  CGGUserPolynomialBase
 
struct  ContactTree
 
struct  DataAtIntegrationPts
 
struct  DynamicRelaxationTimeScale
 
struct  FaceRule
 
struct  FaceUserDataOperatorStabAssembly
 
struct  HMHHencky
 
struct  HMHNeohookean
 
struct  HMHPMooneyRivlinWriggersEq63
 
struct  HMHStVenantKirchhoff
 
struct  isEq
 
struct  OpConstrainBoundaryHDivLhs_dU
 
struct  OpConstrainBoundaryHDivLhs_dU< A, IntegrationType::GAUSS >
 
struct  OpConstrainBoundaryHDivRhs
 
struct  OpConstrainBoundaryHDivRhs< A, IntegrationType::GAUSS >
 
struct  OpConstrainBoundaryL2Lhs_dP
 
struct  OpConstrainBoundaryL2Lhs_dP< A, IntegrationType::GAUSS >
 
struct  OpConstrainBoundaryL2Lhs_dU
 
struct  OpConstrainBoundaryL2Rhs
 
struct  OpGetScale
 
struct  OpHMHH
 
struct  OpMoveNode
 
struct  OpSpatialPhysical
 
struct  OpSpatialPhysical_du_du
 
struct  OpTreeSearch
 
struct  PhysicalEquations
 
struct  SetIntegrationAtFrontFace
 
struct  SetIntegrationAtFrontVolume
 
struct  solve_elastic_setup
 
struct  TensorTypeExtractor
 
struct  TensorTypeExtractor< FTensor::PackPtr< T, I > >
 
struct  TractionBc
 
struct  VolRule
 Set integration rule on element. More...
 
struct  VolUserDataOperatorStabAssembly
 

Typedefs

using MatrixPtr = boost::shared_ptr< MatrixDouble >
 
using VectorPtr = boost::shared_ptr< VectorDouble >
 
using EntData = EntitiesFieldData::EntData
 
using UserDataOperator = ForcesAndSourcesCore::UserDataOperator
 
using VolUserDataOperator = VolumeElementForcesAndSourcesCore::UserDataOperator
 
using FaceUserDataOperator = FaceElementForcesAndSourcesCore::UserDataOperator
 
using EleOnSide = PipelineManager::ElementsAndOpsByDim< SPACE_DIM >::FaceSideEle
 
using SideEleOp = EleOnSide::UserDataOperator
 
typedef std::vector< BcDispBcDispVec
 
typedef std::vector< BcRotBcRotVec
 
typedef std::vector< RangeTractionFreeBc
 
typedef std::vector< TractionBcTractionBcVec
 

Enumerations

enum  SymmetrySelector { SYMMETRIC, NOT_SYMMETRIC, ANIT_SYMMETRIC }
 
enum  RotSelector { SMALL_ROT, MODERATE_ROT, LARGE_ROT, NO_H1_CONFIGURATION }
 
enum  StretchSelector { LINEAR, LOG }
 
enum  MultiPointRhsType { U, P }
 

Functions

MoFEMErrorCode CGG_BubbleBase_MBTET (const int p, const double *N, const double *diffN, FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > &phi, const int gdim)
 Calculate CGGT tonsorial bubble base. More...
 
auto diff_deviator (FTensor::Ddg< double, 3, 3 > &&t_diff_stress)
 
auto diff_tensor ()
 
auto symm_L_tensor ()
 
auto diff_symmetrize ()
 
auto is_eq (const double &a, const double &b)
 
template<int DIM>
auto get_uniq_nb (double *ptr)
 
template<typename A , typename B >
auto sort_eigen_vals (A &eig, B &eigen_vec)
 
auto checkSdf (EntityHandle fe_ent, std::map< int, Range > &sdf_map_range)
 
template<typename OP_PTR >
auto getSdf (OP_PTR op_ptr, MatrixDouble &contact_disp, int block_id, bool eval_hessian)
 
template<typename T1 >
auto multiPoint (std::array< double, 3 > &unit_ray, std::array< double, 3 > &point, std::array< double, 9 > &elem_point_nodes, std::array< double, 9 > &elem_traction_nodes, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
 Calculate points data on contact surfaces. More...
 
template<typename T1 >
auto multiMasterPoint (ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
 
template<typename T1 >
auto multiSlavePoint (ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
 
template<typename T1 >
auto multiGetGap (ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
 
template<typename T1 , typename T2 , typename T3 >
auto multiPointRhs (ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_coords, FTensor::Tensor1< T2, 3 > &t_spatial_coords, FTensor::Tensor1< T3, 3 > &t_master_traction, MultiPointRhsType type, bool debug=false)
 

Variables

constexpr static auto size_symm = (3 * (3 + 1)) / 2
 

Typedef Documentation

◆ BcDispVec

typedef std::vector<BcDisp> EshelbianPlasticity::BcDispVec

Definition at line 424 of file EshelbianPlasticity.hpp.

◆ BcRotVec

typedef std::vector<BcRot> EshelbianPlasticity::BcRotVec

Definition at line 433 of file EshelbianPlasticity.hpp.

◆ EleOnSide

using EshelbianPlasticity::EleOnSide = typedef PipelineManager::ElementsAndOpsByDim<SPACE_DIM>::FaceSideEle

Definition at line 55 of file EshelbianPlasticity.hpp.

◆ EntData

using EshelbianPlasticity::EntData = typedef EntitiesFieldData::EntData

Definition at line 51 of file EshelbianPlasticity.hpp.

◆ FaceUserDataOperator

Examples
NavierStokesElement.hpp.

Definition at line 54 of file EshelbianPlasticity.hpp.

◆ MatrixPtr

using EshelbianPlasticity::MatrixPtr = typedef boost::shared_ptr<MatrixDouble>

Definition at line 48 of file EshelbianPlasticity.hpp.

◆ SideEleOp

Definition at line 56 of file EshelbianPlasticity.hpp.

◆ TractionBcVec

Definition at line 444 of file EshelbianPlasticity.hpp.

◆ TractionFreeBc

Definition at line 435 of file EshelbianPlasticity.hpp.

◆ UserDataOperator

using EshelbianPlasticity::UserDataOperator = typedef ForcesAndSourcesCore::UserDataOperator

Definition at line 52 of file EshelbianPlasticity.hpp.

◆ VectorPtr

using EshelbianPlasticity::VectorPtr = typedef boost::shared_ptr<VectorDouble>

Definition at line 49 of file EshelbianPlasticity.hpp.

◆ VolUserDataOperator

Definition at line 53 of file EshelbianPlasticity.hpp.

Enumeration Type Documentation

◆ MultiPointRhsType

Enumerator

Definition at line 201 of file EshelbianContact.cpp.

201 { U, P };

◆ RotSelector

Enumerator
SMALL_ROT 
MODERATE_ROT 
LARGE_ROT 
NO_H1_CONFIGURATION 
Examples
EshelbianPlasticity.cpp.

Definition at line 45 of file EshelbianPlasticity.hpp.

◆ StretchSelector

Enumerator
LINEAR 
LOG 
Examples
EshelbianPlasticity.cpp.

Definition at line 46 of file EshelbianPlasticity.hpp.

46 { LINEAR, LOG };

◆ SymmetrySelector

Enumerator
SYMMETRIC 
NOT_SYMMETRIC 
ANIT_SYMMETRIC 
Examples
EshelbianPlasticity.cpp.

Definition at line 44 of file EshelbianPlasticity.hpp.

Function Documentation

◆ CGG_BubbleBase_MBTET()

MoFEMErrorCode EshelbianPlasticity::CGG_BubbleBase_MBTET ( const int  p,
const double N,
const double diffN,
FTensor::Tensor2< FTensor::PackPtr< double *, 9 >, 3, 3 > &  phi,
const int  gdim 
)

Calculate CGGT tonsorial bubble base.

See details in [20]

Parameters
ppolynomial order
Nshape functions
diffNdirevatives of shape functions
l2_basebase functions for l2 space
diff_l2_basedirevatives base functions for l2 space
phireturned base functions
gdimnumber of integration points
Returns
MoFEMErrorCode
Examples
EshelbianPlasticity.cpp.

Definition at line 20 of file CGGTonsorialBubbleBase.cpp.

23  {
25 
26  // FIXME: In this implementation symmetry of mix derivatives is not exploited
27 
28  if (p < 1)
30 
36 
37  Tensor1<double, 3> t_diff_n[4];
38  {
39  Tensor1<PackPtr<const double *, 3>, 3> t_diff_n_tmp(&diffN[0], &diffN[1],
40  &diffN[2]);
41  for (int ii = 0; ii != 4; ++ii) {
42  t_diff_n[ii](i) = t_diff_n_tmp(i);
43  ++t_diff_n_tmp;
44  }
45  }
46 
47  Tensor1<double, 3> t_diff_ksi[3];
48  for (int ii = 0; ii != 3; ++ii)
49  t_diff_ksi[ii](i) = t_diff_n[ii + 1](i) - t_diff_n[0](i);
50 
51  int lp = p >= 2 ? p - 2 + 1 : 0;
52  VectorDouble l[3] = {VectorDouble(lp + 1), VectorDouble(lp + 1),
53  VectorDouble(lp + 1)};
54  MatrixDouble diff_l[3] = {MatrixDouble(3, lp + 1), MatrixDouble(3, lp + 1),
55  MatrixDouble(3, lp + 1)};
56  MatrixDouble diff2_l[3] = {MatrixDouble(9, lp + 1), MatrixDouble(9, lp + 1),
57  MatrixDouble(9, lp + 1)};
58 
59  for (int ii = 0; ii != 3; ++ii)
60  diff2_l[ii].clear();
61 
62  for (int gg = 0; gg != gdim; ++gg) {
63 
64  const int node_shift = gg * 4;
65 
66  for (int ii = 0; ii != 3; ++ii) {
67 
68  auto &t_diff_ksi_ii = t_diff_ksi[ii];
69  auto &l_ii = l[ii];
70  auto &diff_l_ii = diff_l[ii];
71  auto &diff2_l_ii = diff2_l[ii];
72 
73  double ksi_ii = N[node_shift + ii + 1] - N[node_shift + 0];
74 
75  CHKERR Legendre_polynomials(lp, ksi_ii, &t_diff_ksi_ii(0),
76  &*l_ii.data().begin(),
77  &*diff_l_ii.data().begin(), 3);
78 
79  for (int l = 1; l < lp; ++l) {
80  const double a = ((2 * (double)l + 1) / ((double)l + 1));
81  const double b = ((double)l / ((double)l + 1));
82  for (int d0 = 0; d0 != 3; ++d0)
83  for (int d1 = 0; d1 != 3; ++d1) {
84  const int r = 3 * d0 + d1;
85  diff2_l_ii(r, l + 1) = a * (t_diff_ksi_ii(d0) * diff_l_ii(d1, l) +
86  t_diff_ksi_ii(d1) * diff_l_ii(d0, l) +
87  ksi_ii * diff2_l_ii(r, l)) -
88  b * diff2_l_ii(r, l - 1);
89  }
90  }
91  }
92 
93  const double n[] = {N[node_shift + 0], N[node_shift + 1], N[node_shift + 2],
94  N[node_shift + 3]};
95 
97  Tensor3<double, 3, 3, 3> t_bk_diff;
98  const int tab[4][4] = {
99  {1, 2, 3, 0}, {2, 3, 0, 1}, {3, 0, 1, 2}, {0, 1, 2, 3}};
100  t_bk(i, j) = 0;
101  t_bk_diff(i, j, k) = 0;
102  for (int ii = 0; ii != 3; ++ii) {
103  const int i0 = tab[ii][0];
104  const int i1 = tab[ii][1];
105  const int i2 = tab[ii][2];
106  const int i3 = tab[ii][3];
107  auto &t_diff_n_i0 = t_diff_n[i0];
108  auto &t_diff_n_i1 = t_diff_n[i1];
109  auto &t_diff_n_i2 = t_diff_n[i2];
110  auto &t_diff_n_i3 = t_diff_n[i3];
112  t_k(i, j) = t_diff_n_i3(i) * t_diff_n_i3(j);
113  const double b = n[i0] * n[i1] * n[i2];
114  t_bk(i, j) += b * t_k(i, j);
115  Tensor1<double, 3> t_diff_b;
116  t_diff_b(i) = t_diff_n_i0(i) * n[i1] * n[i2] +
117  t_diff_n_i1(i) * n[i0] * n[i2] +
118  t_diff_n_i2(i) * n[i0] * n[i1];
119  t_bk_diff(i, j, k) += t_k(i, j) * t_diff_b(k);
120  }
121 
122  int zz = 0;
123  for (int o = p - 2 + 1; o <= p - 2 + 1; ++o) {
124 
125  for (int ii = 0; ii <= o; ++ii)
126  for (int jj = 0; (ii + jj) <= o; ++jj) {
127 
128  const int kk = o - ii - jj;
129 
130  auto get_diff_l = [&](const int y, const int i) {
131  return Tensor1<double, 3>(diff_l[y](0, i), diff_l[y](1, i),
132  diff_l[y](2, i));
133  };
134  auto get_diff2_l = [&](const int y, const int i) {
135  return Tensor2<double, 3, 3>(
136  diff2_l[y](0, i), diff2_l[y](1, i), diff2_l[y](2, i),
137  diff2_l[y](3, i), diff2_l[y](4, i), diff2_l[y](5, i),
138  diff2_l[y](6, i), diff2_l[y](7, i), diff2_l[y](8, i));
139  };
140 
141  auto l_i = l[0][ii];
142  auto t_diff_i = get_diff_l(0, ii);
143  auto t_diff2_i = get_diff2_l(0, ii);
144  auto l_j = l[1][jj];
145  auto t_diff_j = get_diff_l(1, jj);
146  auto t_diff2_j = get_diff2_l(1, jj);
147  auto l_k = l[2][kk];
148  auto t_diff_k = get_diff_l(2, kk);
149  auto t_diff2_k = get_diff2_l(2, kk);
150 
151  Tensor1<double, 3> t_diff_l2;
152  t_diff_l2(i) = t_diff_i(i) * l_j * l_k + t_diff_j(i) * l_i * l_k +
153  t_diff_k(i) * l_i * l_j;
154  Tensor2<double, 3, 3> t_diff2_l2;
155  t_diff2_l2(i, j) =
156  t_diff2_i(i, j) * l_j * l_k + t_diff_i(i) * t_diff_j(j) * l_k +
157  t_diff_i(i) * l_j * t_diff_k(j) +
158 
159  t_diff2_j(i, j) * l_i * l_k + t_diff_j(i) * t_diff_i(j) * l_k +
160  t_diff_j(i) * l_i * t_diff_k(j) +
161 
162  t_diff2_k(i, j) * l_i * l_j + t_diff_k(i) * t_diff_i(j) * l_j +
163  t_diff_k(i) * l_i * t_diff_j(j);
164 
165  for (int dd = 0; dd != 3; ++dd) {
166 
167  Tensor2<double, 3, 3> t_axial_diff;
168  t_axial_diff(i, j) = 0;
169  for (int mm = 0; mm != 3; ++mm)
170  t_axial_diff(dd, mm) = t_diff_l2(mm);
171 
172  Tensor3<double, 3, 3, 3> t_A_diff;
173  t_A_diff(i, j, k) = levi_civita(i, j, m) * t_axial_diff(m, k);
174  Tensor2<double, 3, 3> t_curl_A;
175  t_curl_A(i, j) = levi_civita(j, m, f) * t_A_diff(i, f, m);
176  Tensor3<double, 3, 3, 3> t_curl_A_bK_diff;
177  t_curl_A_bK_diff(i, j, k) = t_curl_A(i, m) * t_bk_diff(m, j, k);
178 
179  Tensor3<double, 3, 3, 3> t_axial_diff2;
180  t_axial_diff2(i, j, k) = 0;
181  for (int mm = 0; mm != 3; ++mm)
182  for (int nn = 0; nn != 3; ++nn)
183  t_axial_diff2(dd, mm, nn) = t_diff2_l2(mm, nn);
184  Tensor4<double, 3, 3, 3, 3> t_A_diff2;
185  t_A_diff2(i, j, k, f) =
186  levi_civita(i, j, m) * t_axial_diff2(m, k, f);
187  Tensor3<double, 3, 3, 3> t_curl_A_diff2;
188  t_curl_A_diff2(i, j, k) =
189  levi_civita(j, m, f) * t_A_diff2(i, f, m, k);
190  Tensor3<double, 3, 3, 3> t_curl_A_diff2_bK;
191  t_curl_A_diff2_bK(i, j, k) = t_curl_A_diff2(i, m, k) * t_bk(m, j);
192 
193  t_phi(i, j) = levi_civita(j, m, f) * (t_curl_A_bK_diff(i, f, m) +
194  t_curl_A_diff2_bK(i, f, m));
195 
196  ++t_phi;
197  ++zz;
198  }
199  }
200  }
201  if (zz != NBVOLUMETET_CCG_BUBBLE(p))
202  SETERRQ2(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
203  "Wrong number of base functions %d != %d", zz,
205  }
206 
208 }

◆ checkSdf()

auto EshelbianPlasticity::checkSdf ( EntityHandle  fe_ent,
std::map< int, Range > &  sdf_map_range 
)

Definition at line 17 of file EshelbianContact.cpp.

17  {
18  for (auto &m_sdf : sdf_map_range) {
19  if (m_sdf.second.find(fe_ent) != m_sdf.second.end())
20  return m_sdf.first;
21  }
22  return -1;
23 }

◆ diff_deviator()

auto EshelbianPlasticity::diff_deviator ( FTensor::Ddg< double, 3, 3 > &&  t_diff_stress)
inline

Definition at line 14 of file EshelbianAux.hpp.

14  {
19 
20  FTensor::Ddg<double, 3, 3> t_diff_deviator;
21  t_diff_deviator(i, j, k, l) = t_diff_stress(i, j, k, l);
22 
23  constexpr double third = boost::math::constants::third<double>();
24 
25  t_diff_deviator(0, 0, 0, 0) -= third;
26  t_diff_deviator(0, 0, 1, 1) -= third;
27 
28  t_diff_deviator(1, 1, 0, 0) -= third;
29  t_diff_deviator(1, 1, 1, 1) -= third;
30 
31  t_diff_deviator(2, 2, 0, 0) -= third;
32  t_diff_deviator(2, 2, 1, 1) -= third;
33 
34  t_diff_deviator(0, 0, 2, 2) -= third;
35  t_diff_deviator(1, 1, 2, 2) -= third;
36  t_diff_deviator(2, 2, 2, 2) -= third;
37 
38  return t_diff_deviator;
39 }

◆ diff_symmetrize()

auto EshelbianPlasticity::diff_symmetrize ( )
inline

Definition at line 69 of file EshelbianAux.hpp.

69  {
70 
75 
77 
78  t_diff(i, j, k, l) = 0;
79  t_diff(0, 0, 0, 0) = 1;
80  t_diff(1, 1, 1, 1) = 1;
81 
82  t_diff(1, 0, 1, 0) = 0.5;
83  t_diff(1, 0, 0, 1) = 0.5;
84 
85  t_diff(0, 1, 0, 1) = 0.5;
86  t_diff(0, 1, 1, 0) = 0.5;
87 
88  if constexpr (SPACE_DIM == 3) {
89  t_diff(2, 2, 2, 2) = 1;
90 
91  t_diff(2, 0, 2, 0) = 0.5;
92  t_diff(2, 0, 0, 2) = 0.5;
93  t_diff(0, 2, 0, 2) = 0.5;
94  t_diff(0, 2, 2, 0) = 0.5;
95 
96  t_diff(2, 1, 2, 1) = 0.5;
97  t_diff(2, 1, 1, 2) = 0.5;
98  t_diff(1, 2, 1, 2) = 0.5;
99  t_diff(1, 2, 2, 1) = 0.5;
100  }
101 
102  return t_diff;
103 }

◆ diff_tensor()

auto EshelbianPlasticity::diff_tensor ( )
inline

Definition at line 43 of file EshelbianAux.hpp.

43  {
50  t_diff(i, j, k, l) = (t_kd(i, k) ^ t_kd(j, l)) / 4.;
51  return t_diff;
52 };

◆ get_uniq_nb()

template<int DIM>
auto EshelbianPlasticity::get_uniq_nb ( double ptr)
inline

Definition at line 124 of file EshelbianAux.hpp.

124  {
125  std::array<double, DIM> tmp;
126  std::copy(ptr, &ptr[DIM], tmp.begin());
127  std::sort(tmp.begin(), tmp.end());
128  isEq::absMax = std::max(std::abs(tmp[0]), std::abs(tmp[DIM - 1]));
129  constexpr double eps = std::numeric_limits<double>::epsilon();
130  isEq::absMax = std::max(isEq::absMax, static_cast<double>(eps));
131  return std::distance(tmp.begin(), std::unique(tmp.begin(), tmp.end(), is_eq));
132 }

◆ getSdf()

template<typename OP_PTR >
auto EshelbianPlasticity::getSdf ( OP_PTR  op_ptr,
MatrixDouble &  contact_disp,
int  block_id,
bool  eval_hessian 
)

Definition at line 26 of file EshelbianContact.cpp.

27  {
28 
29  auto nb_gauss_pts = op_ptr->getGaussPts().size2();
30 
31  auto ts_time = op_ptr->getTStime();
32  auto ts_time_step = op_ptr->getTStimeStep();
35  ts_time_step = EshelbianCore::dynamicStep;
36  }
37 
38  auto m_spatial_coords = ContactOps::get_spatial_coords(
39  op_ptr->getFTensor1CoordsAtGaussPts(),
40  getFTensor1FromMat<3>(contact_disp), nb_gauss_pts);
41  auto m_normals_at_pts = ContactOps::get_normalize_normals(
42  op_ptr->getFTensor1NormalsAtGaussPts(), nb_gauss_pts);
44  ts_time_step, ts_time, nb_gauss_pts, m_spatial_coords, m_normals_at_pts,
45  block_id);
47  ts_time_step, ts_time, nb_gauss_pts, m_spatial_coords, m_normals_at_pts,
48  block_id);
49 
50 #ifndef NDEBUG
51  if (v_sdf.size() != nb_gauss_pts)
53  "Wrong number of integration pts");
54  if (m_grad_sdf.size2() != nb_gauss_pts)
56  "Wrong number of integration pts");
57  if (m_grad_sdf.size1() != 3)
58  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "Should be size of 3");
59 #endif // NDEBUG
60 
61  if (eval_hessian) {
63  ts_time_step, ts_time, nb_gauss_pts, m_spatial_coords, m_normals_at_pts,
64  block_id);
65  return std::make_tuple(block_id, m_normals_at_pts, v_sdf, m_grad_sdf,
66  m_hess_sdf);
67  } else {
68 
69  return std::make_tuple(block_id, m_normals_at_pts, v_sdf, m_grad_sdf,
70  MatrixDouble(6, nb_gauss_pts, 0.));
71  }
72 };

◆ is_eq()

auto EshelbianPlasticity::is_eq ( const double a,
const double b 
)
inline

Definition at line 120 of file EshelbianAux.hpp.

120  {
121  return isEq::check(a, b);
122 };

◆ multiGetGap()

template<typename T1 >
auto EshelbianPlasticity::multiGetGap ( ContactTree::FaceData face_data_ptr,
FTensor::Tensor1< T1, 3 > &  t_spatial_coords 
)

Evaluate gap and tractions between master and slave points

Definition at line 177 of file EshelbianContact.cpp.

178  {
179 
180  auto [t_slave_point_current, t_slave_traction_current, t_slave_normal] =
181  multiSlavePoint(face_data_ptr, t_spatial_coords);
182  auto [t_master_point_current, t_master_traction_current, t_master_normal] =
183  multiMasterPoint(face_data_ptr, t_spatial_coords);
184 
186 
188  t_normal(i) = t_master_normal(i) - t_slave_normal(i);
189  t_normal.normalize();
190 
191  auto gap = t_normal(i) * (t_slave_point_current(i) - t_spatial_coords(i));
192  auto tn_master = t_master_traction_current(i) * t_normal(i);
193  auto tn_slave = t_slave_traction_current(i) * t_normal(i);
194  auto tn = std::max(-tn_master, tn_slave);
195 
196  return std::make_tuple(gap, tn_master, tn_slave,
197  ContactOps::constrain(gap, tn),
198  t_master_traction_current, t_slave_traction_current);
199 };

◆ multiMasterPoint()

template<typename T1 >
auto EshelbianPlasticity::multiMasterPoint ( ContactTree::FaceData face_data_ptr,
FTensor::Tensor1< T1, 3 > &  t_spatial_coords 
)

Definition at line 148 of file EshelbianContact.cpp.

153  {
154 
155  return multiPoint(face_data_ptr->unitRay, face_data_ptr->masterPoint,
156  face_data_ptr->masterPointNodes,
157  face_data_ptr->masterTractionNodes, t_spatial_coords);
158 };

◆ multiPoint()

template<typename T1 >
auto EshelbianPlasticity::multiPoint ( std::array< double, 3 > &  unit_ray,
std::array< double, 3 > &  point,
std::array< double, 9 > &  elem_point_nodes,
std::array< double, 9 > &  elem_traction_nodes,
FTensor::Tensor1< T1, 3 > &  t_spatial_coords 
)

Calculate points data on contact surfaces.

Template Parameters
T1
Parameters
unit_ray
point
elem_point_nodes
elem_traction_nodes
t_spatial_coords
Returns
auto

Definition at line 86 of file EshelbianContact.cpp.

93  {
95 
96  auto t_unit_ray = getFTensor1FromPtr<3>(unit_ray.data());
97  auto t_point = getFTensor1FromPtr<3>(point.data());
98 
99  auto get_normal = [](auto &ele_coords) {
101  Tools::getTriNormal(ele_coords.data(), &t_normal(0));
102  return t_normal;
103  };
104 
105  auto t_normal = get_normal(elem_point_nodes);
106  t_normal(i) /= t_normal.l2();
107 
108  auto sn = t_normal(i) * t_point(i);
109  auto nm = t_normal(i) * t_spatial_coords(i);
110  auto nr = t_normal(i) * t_unit_ray(i);
111 
112  auto gamma = (sn - nm) / nr;
113 
114  FTensor::Tensor1<T1, 3> t_point_current;
115  t_point_current(i) = t_spatial_coords(i) + gamma * t_unit_ray(i);
116 
117  auto get_local_point_shape_functions = [&](auto &&t_elem_coords,
118  auto &t_point) {
119  std::array<T1, 2> loc_coords;
121  Tools::getLocalCoordinatesOnReferenceThreeNodeTri(
122  &t_elem_coords(0, 0), &t_point(0), 1, loc_coords.data()),
123  "get local coords");
124  return FTensor::Tensor1<T1, 3>{N_MBTRI0(loc_coords[0], loc_coords[1]),
125  N_MBTRI1(loc_coords[0], loc_coords[1]),
126  N_MBTRI2(loc_coords[0], loc_coords[1])};
127  };
128 
129  auto eval_position = [&](auto &&t_field, auto &t_shape_fun) {
132  FTensor::Tensor1<T1, 3> t_point_out;
133  t_point_out(i) = t_shape_fun(j) * t_field(j, i);
134  return t_point_out;
135  };
136 
137  auto t_shape_fun = get_local_point_shape_functions(
138  getFTensor2FromPtr<3, 3>(elem_point_nodes.data()), t_point_current);
139  auto t_slave_point_updated = eval_position(
140  getFTensor2FromPtr<3, 3>(elem_point_nodes.data()), t_shape_fun);
141  auto t_traction_updated = eval_position(
142  getFTensor2FromPtr<3, 3>(elem_traction_nodes.data()), t_shape_fun);
143 
144  return std::make_tuple(t_slave_point_updated, t_traction_updated, t_normal);
145 };

◆ multiPointRhs()

template<typename T1 , typename T2 , typename T3 >
auto EshelbianPlasticity::multiPointRhs ( ContactTree::FaceData face_data_ptr,
FTensor::Tensor1< T1, 3 > &  t_coords,
FTensor::Tensor1< T2, 3 > &  t_spatial_coords,
FTensor::Tensor1< T3, 3 > &  t_master_traction,
MultiPointRhsType  type,
bool  debug = false 
)

Caluclate rhs term for contact

Definition at line 206 of file EshelbianContact.cpp.

213  {
216 
218  t_u(i) = t_spatial_coords(i) - t_coords(i);
219 
221 
222  switch (type) {
223  case MultiPointRhsType::U: {
224 
225  auto [t_slave_point_current, t_slave_traction_current, t_slave_normal] =
226  multiSlavePoint(face_data_ptr, t_spatial_coords);
227  auto [t_master_point_current, t_master_traction_current, t_master_normal] =
228  multiMasterPoint(face_data_ptr, t_spatial_coords);
229 
230  // average normal surface
232  t_normal(i) = t_master_normal(i) - t_slave_normal(i);
233  t_normal.normalize();
234 
235  // get projection operators
237  t_P(i, j) = t_normal(i) * t_normal(j);
239  t_Q(i, j) = kronecker_delta(i, j) - t_P(i, j);
240 
241  constexpr double beta = 0.5;
242 
243  auto zeta = 1e-8 * face_data_ptr->eleRadius;
244  auto alpha1 = ContactOps::alpha_contact_const;
246 
247  // this is regularised std::min(d,s)
248  auto f_min_gap = [zeta](auto d, auto s) {
249  return 0.5 * (d + s - std::sqrt((d - s) * (d - s) + zeta));
250  };
251  // this derivative of regularised std::min(d,s)
252  auto f_diff_min_gap = [zeta](auto d, auto s) {
253  return 0.5 * (1 - (d - s) / std::sqrt((d - s) * (d - s) + zeta));
254  };
255 
256  // add penalty on penetration side
257  auto f_barrier = [alpha1, alpha2, f_min_gap, f_diff_min_gap](auto g,
258  auto tn) {
259  auto d = alpha1 * g;
260  auto b1 =
261  0.5 * (tn + f_min_gap(d, tn) + f_diff_min_gap(d, tn) * (d - tn));
262  auto b2 = alpha2 * f_min_gap(g, 0) * g;
263  return b1 - b2;
264  };
265 
266  FTensor::Tensor1<T2, 3> t_gap_vec;
267  t_gap_vec(i) = beta * t_spatial_coords(i) +
268  (1 - beta) * t_slave_point_current(i) - t_spatial_coords(i);
270  t_traction_vec(i) =
271  -beta * t_master_traction(i) + (beta - 1) * t_slave_traction_current(i);
272 
273  auto t_gap = t_normal(i) * t_gap_vec(i);
274  auto t_tn = t_normal(i) * t_traction_vec(i);
275  auto barrier = f_barrier(t_gap, t_tn);
276 
278  // add penalty on penetration side
279  t_traction_bar(i) = t_normal(i) * barrier;
280 
281  t_rhs(i) =
282 
283  t_Q(i, j) * t_master_traction(j) +
284 
285  t_P(i, j) * (t_master_traction(j) - t_traction_bar(j));
286 
287  if (debug) {
288  auto is_nan_or_inf = [](double value) -> bool {
289  return std::isnan(value) || std::isinf(value);
290  };
291 
292  double v = std::complex<double>(t_rhs(i) * t_rhs(i)).real();
293  if (is_nan_or_inf(v)) {
294  MOFEM_LOG_CHANNEL("SELF");
295  MOFEM_LOG("SELF", Sev::error) << "t_rhs " << t_rhs;
296  CHK_MOAB_THROW(MOFEM_DATA_INCONSISTENCY, "rhs is nan or inf");
297  }
298  }
299 
300  } break;
302  CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "not implemented");
303  break;
304  }
305 
306  return t_rhs;
307 };

◆ multiSlavePoint()

template<typename T1 >
auto EshelbianPlasticity::multiSlavePoint ( ContactTree::FaceData face_data_ptr,
FTensor::Tensor1< T1, 3 > &  t_spatial_coords 
)

Definition at line 161 of file EshelbianContact.cpp.

166  {
167 
168  return multiPoint(face_data_ptr->unitRay, face_data_ptr->slavePoint,
169  face_data_ptr->slavePointNodes,
170  face_data_ptr->slaveTractionNodes, t_spatial_coords);
171 };

◆ sort_eigen_vals()

template<typename A , typename B >
auto EshelbianPlasticity::sort_eigen_vals ( A eig,
B &  eigen_vec 
)
inline

Definition at line 135 of file EshelbianAux.hpp.

135  {
136 
137  constexpr int dim = 3;
138 
139  isEq::absMax =
140  std::max(std::max(std::abs(eig(0)), std::abs(eig(1))), std::abs(eig(2)));
141  constexpr double eps = std::numeric_limits<double>::epsilon();
142  isEq::absMax = std::max(isEq::absMax, static_cast<double>(eps));
143 
144  int i = 0, j = 1, k = 2;
145 
146  if (is_eq(eig(0), eig(1))) {
147  i = 0;
148  j = 2;
149  k = 1;
150  } else if (is_eq(eig(0), eig(2))) {
151  i = 0;
152  j = 1;
153  k = 2;
154  } else if (is_eq(eig(1), eig(2))) {
155  i = 1;
156  j = 0;
157  k = 2;
158  }
159 
160  FTensor::Tensor2<double, 3, 3> eigen_vec_c{
161  eigen_vec(i, 0), eigen_vec(i, 1), eigen_vec(i, 2),
162 
163  eigen_vec(j, 0), eigen_vec(j, 1), eigen_vec(j, 2),
164 
165  eigen_vec(k, 0), eigen_vec(k, 1), eigen_vec(k, 2)};
166 
167  FTensor::Tensor1<double, 3> eig_c{eig(i), eig(j), eig(k)};
168 
169  {
170  FTENSOR_INDEX(dim, i);
171  FTENSOR_INDEX(dim, j);
172  eig(i) = eig_c(i);
173  eigen_vec(i, j) = eigen_vec_c(i, j);
174  }
175 }

◆ symm_L_tensor()

auto EshelbianPlasticity::symm_L_tensor ( )
inline

Definition at line 54 of file EshelbianAux.hpp.

54  {
59  t_L(i, j, L) = 0;
60  t_L(0, 0, 0) = 1;
61  t_L(1, 1, 3) = 1;
62  t_L(2, 2, 5) = 1;
63  t_L(1, 0, 1) = 1;
64  t_L(2, 0, 2) = 1;
65  t_L(2, 1, 4) = 1;
66  return t_L;
67 }

Variable Documentation

◆ size_symm

constexpr static auto EshelbianPlasticity::size_symm = (3 * (3 + 1)) / 2
staticconstexpr

Definition at line 41 of file EshelbianAux.hpp.

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
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:589
EshelbianPlasticity::is_eq
auto is_eq(const double &a, const double &b)
Definition: EshelbianAux.hpp:120
g
constexpr double g
Definition: shallow_wave.cpp:63
EshelbianPlasticity::LINEAR
@ LINEAR
Definition: EshelbianPlasticity.hpp:46
FTensor::Tensor1< double, 3 >
MOFEM_LOG_CHANNEL
#define MOFEM_LOG_CHANNEL(channel)
Set and reset channel.
Definition: LogManager.hpp:284
ContactOps::hess_surface_distance_function
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:338
ContactOps::constrain
double constrain(double sdf, double tn)
constrain function
Definition: ContactOps.hpp:603
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
FTensor::Tensor1::l2
T l2() const
Definition: Tensor1_value.hpp:84
MoFEM::Types::MatrixDouble
UBlasMatrix< double > MatrixDouble
Definition: Types.hpp:77
FTENSOR_INDEX
#define FTENSOR_INDEX(DIM, I)
Definition: Templates.hpp:2013
EshelbianPlasticity::NO_H1_CONFIGURATION
@ NO_H1_CONFIGURATION
Definition: EshelbianPlasticity.hpp:45
FTensor::levi_civita
constexpr std::enable_if<(Dim0<=2 &&Dim1<=2), Tensor2_Expr< Levi_Civita< T >, T, Dim0, Dim1, i, j > >::type levi_civita(const Index< i, Dim0 > &, const Index< j, Dim1 > &)
levi_civita functions to make for easy adhoc use
Definition: Levi_Civita.hpp:617
zeta
double zeta
Viscous hardening.
Definition: plastic.cpp:130
sdf.r
int r
Definition: sdf.py:8
FTensor::Tensor2< double, 3, 3 >
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:548
FTensor::Tensor3
Definition: Tensor3_value.hpp:12
EshelbianPlasticity::SYMMETRIC
@ SYMMETRIC
Definition: EshelbianPlasticity.hpp:44
SPACE_DIM
constexpr int SPACE_DIM
Definition: child_and_parent.cpp:16
a
constexpr double a
Definition: approx_sphere.cpp:30
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
double
convert.type
type
Definition: convert.py:64
EshelbianPlasticity::P
@ P
Definition: EshelbianContact.cpp:201
EshelbianPlasticity::multiPoint
auto multiPoint(std::array< double, 3 > &unit_ray, std::array< double, 3 > &point, std::array< double, 9 > &elem_point_nodes, std::array< double, 9 > &elem_traction_nodes, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
Calculate points data on contact surfaces.
Definition: EshelbianContact.cpp:86
MoFEM::L
VectorDouble L
Definition: Projection10NodeCoordsOnField.cpp:124
Legendre_polynomials
PetscErrorCode Legendre_polynomials(int p, double s, double *diff_s, double *L, double *diffL, const int dim)
Calculate Legendre approximation basis.
Definition: base_functions.c:15
FTensor::Tensor4
Definition: Tensor4_value.hpp:18
debug
static const bool debug
Definition: dm_create_subdm.cpp:12
EshelbianPlasticity::multiMasterPoint
auto multiMasterPoint(ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
Definition: EshelbianContact.cpp:148
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
t_kd
constexpr auto t_kd
Definition: free_surface.cpp:139
ContactOps::alpha_contact_const
double alpha_contact_const
Definition: EshelbianContact.hpp:21
FTensor::Index< 'i', 3 >
FTensor::Tensor1::normalize
Tensor1< T, Tensor_Dim > normalize()
Definition: Tensor1_value.hpp:77
convert.n
n
Definition: convert.py:82
N_MBTRI0
#define N_MBTRI0(x, y)
triangle shape function
Definition: fem_tools.h:46
N
const int N
Definition: speed_test.cpp:3
v
const double v
phase velocity of light in medium (cm/ns)
Definition: initial_diffusion.cpp:40
EshelbianPlasticity::SMALL_ROT
@ SMALL_ROT
Definition: EshelbianPlasticity.hpp:45
FTensor::dd
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: ddTensor0.hpp:33
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
FTensor::Dg
Definition: Dg_value.hpp:9
EshelbianPlasticity::LARGE_ROT
@ LARGE_ROT
Definition: EshelbianPlasticity.hpp:45
EshelbianPlasticity::LOG
@ LOG
Definition: EshelbianPlasticity.hpp:46
EshelbianCore::dynamicRelaxation
static PetscBool dynamicRelaxation
Definition: EshelbianCore.hpp:20
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
NBVOLUMETET_CCG_BUBBLE
#define NBVOLUMETET_CCG_BUBBLE(P)
Bubble function for CGG H div space.
Definition: CGGTonsorialBubbleBase.hpp:19
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
N_MBTRI1
#define N_MBTRI1(x, y)
triangle shape function
Definition: fem_tools.h:47
j
FTensor::Index< 'j', 3 > j
Definition: matrix_function.cpp:19
eps
static const double eps
Definition: check_base_functions_derivatives_on_tet.cpp:11
FTensor::Ddg< double, 3, 3 >
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
sdf_hertz_2d_axisymm_plane.d
float d
Definition: sdf_hertz_2d_axisymm_plane.py:4
ContactOps::surface_distance_function
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:223
EshelbianPlasticity::multiSlavePoint
auto multiSlavePoint(ContactTree::FaceData *face_data_ptr, FTensor::Tensor1< T1, 3 > &t_spatial_coords)
Definition: EshelbianContact.cpp:161
MoFEM::Types::VectorDouble
UBlasVector< double > VectorDouble
Definition: Types.hpp:68
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
FTensor::Kronecker_Delta_symmetric
Kronecker Delta class symmetric.
Definition: Kronecker_Delta.hpp:49
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
third
constexpr double third
Definition: EshelbianADOL-C.cpp:17
EshelbianCore::dynamicStep
static int dynamicStep
Definition: EshelbianCore.hpp:25
EshelbianPlasticity::NOT_SYMMETRIC
@ NOT_SYMMETRIC
Definition: EshelbianPlasticity.hpp:44
EshelbianPlasticity::ANIT_SYMMETRIC
@ ANIT_SYMMETRIC
Definition: EshelbianPlasticity.hpp:44
EshelbianPlasticity::MODERATE_ROT
@ MODERATE_ROT
Definition: EshelbianPlasticity.hpp:45
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
ContactOps::alpha_contact_quadratic
double alpha_contact_quadratic
Definition: EshelbianContact.hpp:22
EshelbianCore::dynamicTime
static double dynamicTime
Definition: EshelbianCore.hpp:23
EshelbianPlasticity::U
@ U
Definition: EshelbianContact.cpp:201
l
FTensor::Index< 'l', 3 > l
Definition: matrix_function.cpp:21
N_MBTRI2
#define N_MBTRI2(x, y)
triangle shape function
Definition: fem_tools.h:48