30 int nb_gauss_pts_1tri;
34 gaussPts_1tri.resize(3, nb_gauss_pts_1tri,
false);
36 &gaussPts_1tri(0, 0), 1);
38 &gaussPts_1tri(1, 0), 1);
40 &gaussPts_1tri(2, 0), 1);
41 dataH1.dataOnEntities[MBVERTEX][0].getN(
NOBASE).resize(nb_gauss_pts_1tri, 3,
44 &*dataH1.dataOnEntities[MBVERTEX][0].getN(
NOBASE).data().begin();
50 numeredEntFiniteElementPtr->getEnt();
51 typedef ContactSearchKdTree::ContactCommonData_multiIndex::index<
53 ItMultIndexPrism it_mult_index_prism =
58 Range range_poly_tris;
59 range_poly_tris.clear();
60 range_poly_tris = it_mult_index_prism->get()->commonIntegratedTriangle;
66 int nb_gauss_pts = nb_gauss_pts_1tri * range_poly_tris.size();
67 gaussPtsMaster.resize(3, nb_gauss_pts,
false);
68 gaussPtsSlave.resize(3, nb_gauss_pts,
false);
71 int num_nodes_prism = 0;
78 coords_prism.resize(18,
false);
80 &*coords_prism.data().begin());
84 v_elem_coords_master.resize(9,
false);
85 v_elem_coords_master = subrange(coords_prism, 0, 9);
86 v_elem_coords_slave.resize(9,
false);
87 v_elem_coords_slave = subrange(coords_prism, 9, 18);
88 auto t_elem_coords_master = get_tensor_vec(v_elem_coords_master);
89 auto t_elem_coords_slave = get_tensor_vec(v_elem_coords_slave);
100 m_rot.resize(3, 3,
false);
103 &m_rot(0, 0), &m_rot(0, 1), &m_rot(0, 2), &m_rot(1, 0), &m_rot(1, 1),
104 &m_rot(1, 2), &m_rot(2, 0), &m_rot(2, 1), &m_rot(2, 2)};
108 CHKERR contact_problem_mulit_index.rotationMatrix(m_rot, v_elem_coords_slave);
110 VectorDouble v_elem_coords_master_new, v_elem_coords_slave_new;
111 v_elem_coords_master_new.resize(9,
false);
112 v_elem_coords_slave_new.resize(9,
false);
113 auto t_elem_coords_master_new = get_tensor_vec(v_elem_coords_master_new);
114 auto t_elem_coords_slave_new = get_tensor_vec(v_elem_coords_slave_new);
117 VectorDouble v_elem_coords_master_2d, v_elem_coords_slave_2d;
118 v_elem_coords_master_2d.resize(6,
false);
119 v_elem_coords_slave_2d.resize(6,
false);
121 &v_elem_coords_master_2d(0), &v_elem_coords_master_2d(1), 2};
124 &v_elem_coords_slave_2d(0), &v_elem_coords_slave_2d(1), 2};
127 for (
int ii = 0; ii != 3; ++ii) {
128 t_elem_coords_slave_new(
i) = t_m_rot(
i,
j) * t_elem_coords_slave(
j);
129 t_elem_coords_master_new(
i) = t_m_rot(
i,
j) * t_elem_coords_master(
j);
131 t_elem_coords_master_2d(0) = t_elem_coords_master_new(0);
132 t_elem_coords_master_2d(1) = t_elem_coords_master_new(1);
134 t_elem_coords_slave_2d(0) = t_elem_coords_slave_new(0);
135 t_elem_coords_slave_2d(1) = t_elem_coords_slave_new(1);
137 ++t_elem_coords_slave_new;
138 ++t_elem_coords_slave;
139 ++t_elem_coords_master_new;
140 ++t_elem_coords_master;
142 ++t_elem_coords_master_2d;
143 ++t_elem_coords_slave_2d;
148 v_coords_integration_tri.resize(9,
false);
152 v_coords_integration_tri_new.resize(9,
false);
155 loc_coords_master.resize(2,
false);
156 double n_input[3] = {1, 0, 0};
161 loc_coords_slave.resize(2,
false);
166 v_glob_coords.resize(2,
false);
168 auto t_gaussPtsMaster = getFTensor1FromMat<3>(gaussPtsMaster);
169 auto t_gaussPtsSlave = getFTensor1FromMat<3>(gaussPtsSlave);
171 for (Range::iterator it_tri = range_poly_tris.begin();
172 it_tri != range_poly_tris.end(); ++it_tri) {
181 conn_face, num_nodes_tri, &*v_coords_integration_tri.data().begin());
184 auto t_coords_integration_tri = get_tensor_vec(v_coords_integration_tri);
185 auto t_coords_integration_tri_new =
186 get_tensor_vec(v_coords_integration_tri_new);
188 for (
int ii = 0; ii != 3; ++ii) {
189 t_coords_integration_tri_new(
i) =
190 t_m_rot(
i,
j) * t_coords_integration_tri(
j);
191 t_coords_integration_tri_new(2) = 0;
192 ++t_coords_integration_tri;
193 ++t_coords_integration_tri_new;
199 double diff_n_tri[6];
211 coords_integration_tri_loc_slave;
212 coords_integration_tri_loc_master.resize(6,
false);
213 coords_integration_tri_loc_slave.resize(6,
false);
215 &coords_integration_tri_loc_master(0),
216 &coords_integration_tri_loc_master(1), 2};
218 &coords_integration_tri_loc_slave(0),
219 &coords_integration_tri_loc_slave(1), 2};
221 auto t_coords_integration_tri_new_2 =
222 get_tensor_vec(v_coords_integration_tri_new);
224 for (
int ii = 0; ii != 3; ++ii) {
226 double glob_coords_tri[2];
227 glob_coords_tri[0] = t_coords_integration_tri_new_2(0);
228 glob_coords_tri[1] = t_coords_integration_tri_new_2(1);
231 double loc_coords_tri_master[2] = {0, 0};
233 &v_elem_coords_master_2d(0), glob_coords_tri,
234 loc_coords_tri_master);
236 t_coords_integration_tri_loc_master(0) = loc_coords_tri_master[0];
237 t_coords_integration_tri_loc_master(1) = loc_coords_tri_master[1];
240 double loc_coords_tri_slave[2] = {0, 0};
242 glob_coords_tri, loc_coords_tri_slave);
244 t_coords_integration_tri_loc_slave(0) = loc_coords_tri_slave[0];
245 t_coords_integration_tri_loc_slave(1) = loc_coords_tri_slave[1];
247 ++t_coords_integration_tri_loc_master;
248 ++t_coords_integration_tri_loc_slave;
249 ++t_coords_integration_tri_new_2;
255 double area_integration_tri_master_loc, area_integration_tri_slave_loc;
256 area_integration_tri_master_loc =
257 std::abs(
area2D(&coords_integration_tri_loc_master(0),
258 &coords_integration_tri_loc_master(2),
259 &coords_integration_tri_loc_master(4)));
261 area_integration_tri_slave_loc =
262 std::abs(
area2D(&coords_integration_tri_loc_slave(0),
263 &coords_integration_tri_loc_slave(2),
264 &coords_integration_tri_loc_slave(4)));
266 auto t_gaussPts_1tri = getFTensor1FromMat<3>(gaussPts_1tri);
272 for (
int gg = 0; gg != nb_gauss_pts_1tri; ++gg) {
274 t_gaussPtsMaster(2) =
275 t_gaussPts_1tri(2) * area_integration_tri_master_loc *
278 t_gaussPts_1tri(2) * area_integration_tri_slave_loc * 2;
282 N_tri.resize(1, 3,
false);
291 &v_coords_integration_tri_new(0), &v_coords_integration_tri_new(3),
292 &v_coords_integration_tri_new(6), 1};
294 v_glob_coords(0) = t_N_tri(
i) * t_coords_integration_tri_new(
i);
295 ++t_coords_integration_tri_new;
296 v_glob_coords(1) = t_N_tri(
i) * t_coords_integration_tri_new(
i);
301 n_input, diff_n_tri, &v_elem_coords_master_2d(0),
302 &*v_glob_coords.data().begin(), &loc_coords_master(0));
304 t_gaussPtsMaster(0) = loc_coords_master(0);
305 t_gaussPtsMaster(1) = loc_coords_master(1);
309 &*v_glob_coords.data().begin(),
310 &loc_coords_slave(0));
312 t_gaussPtsSlave(0) = loc_coords_slave[0];
313 t_gaussPtsSlave(1) = loc_coords_slave[1];