130 {
132
133 const size_t nb_gauss_pts = getGaussPts().size2();
134 const size_t nb_dofs = data.
getIndices().size();
135
136 if (nb_dofs) {
137
138 auto t_normal = getFTensor1Normal();
139 const double ls = sqrt(t_normal(
i) * t_normal(
i));
141
142 auto t_w = getFTensor0IntegrationWeight();
143 auto t_disp = getFTensor1FromMat<3>(*(
commonDataPtr->mDispPtr));
144 auto t_traction =
146 auto t_coords = getFTensor1CoordsAtGaussPts();
147
148 size_t nb_base_functions = data.
getN().size2() / 3;
150
151 auto t_contact_normal =
153 auto t_gap = getFTensor0FromVec(*(
commonDataPtr->contactGapPtr));
154
155 for (size_t gg = 0; gg != nb_gauss_pts; ++gg) {
156
157 auto t_nf = getFTensor1FromArray<3, 3>(locF);
158
159 const double alpha = t_w * getMeasure();
160 if (getNormalsAtGaussPts().size1() == nb_gauss_pts) {
162 auto t_n = getFTensor1FromPtr<3>(&*
n.data().begin());
163 t_normal(
i) = t_n(
i) / sqrt(t_n(
j) * t_n(
j));
164 }
165 Tensor2<double, 3, 3> t_P;
166 t_P(
i,
j) = t_contact_normal(
i) * t_contact_normal(
j);
167
168 Tensor2<double, 3, 3> t_Q;
170
171 const double gap_0 =
gap0(t_gap, t_disp, t_contact_normal);
173 t_rhs_constrains(
i) =
174 t_contact_normal(
i) *
177
179 t_rhs_tangent_disp(
i) = t_Q(
i,
j) * t_disp(
j);
180 t_rhs_tangent_traction(
i) = (*cache).cn_cont * t_Q(
i,
j) * t_traction(
j);
181
182 size_t bb = 0;
183 for (; bb != nb_dofs / 3; ++bb) {
184 const double beta =
alpha * (t_base(
i) * t_normal(
i));
185
186 t_nf(
i) -= beta * t_rhs_constrains(
i);
187 t_nf(
i) -= beta * t_rhs_tangent_disp(
i);
188 t_nf(
i) += beta * t_rhs_tangent_traction(
i);
189
190 ++t_nf;
191 ++t_base;
192 }
193 for (; bb < nb_base_functions; ++bb)
194 ++t_base;
195
196 ++t_contact_normal;
197 ++t_gap;
198 ++t_disp;
199 ++t_traction;
200 ++t_coords;
201 ++t_w;
202 }
203
204 }
205
207}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
FTensor::Index< 'n', SPACE_DIM > n
FTensor::Index< 'i', SPACE_DIM > i
FTensor::Index< 'j', 3 > j
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
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.