2199 {
2201
2202 if (type != MBVERTEX)
2204
2209 }
2212 }
2213
2215 if (nb_dofs == 0)
2217 int nb_gauss_pts = data.
getN().size1();
2218
2219 double def_val = 0.;
2220
2221 Tag th_gap;
2222 CHKERR moabOut.tag_get_handle(
"GAP", 1, MB_TYPE_DOUBLE, th_gap,
2223 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val);
2224
2225 Tag th_lag_mult;
2226 CHKERR moabOut.tag_get_handle(
"LAGMULT", 1, MB_TYPE_DOUBLE, th_lag_mult,
2227 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val);
2228
2229 Tag th_lag_gap_prod;
2230 CHKERR moabOut.tag_get_handle(
"LAG_GAP_PROD", 1, MB_TYPE_DOUBLE,
2231 th_lag_gap_prod, MB_TAG_CREAT | MB_TAG_SPARSE,
2232 &def_val);
2233
2234 int def_val_int = 0;
2235
2236 Tag th_state;
2237 CHKERR moabOut.tag_get_handle(
"STATE", 1, MB_TYPE_INTEGER, th_state,
2238 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val_int);
2239
2240 Tag th_state_side;
2243 "STATE", 1, MB_TYPE_INTEGER, th_state_side,
2244 MB_TAG_CREAT | MB_TAG_SPARSE, &def_val_int);
2245 }
2246
2247 auto get_tag_pos = [&](const std::string name) {
2249 constexpr std::array<double, 3> def_vals = {0, 0, 0};
2251 MB_TAG_CREAT | MB_TAG_SPARSE,
2252 def_vals.data());
2254 };
2255 auto th_pos_master = get_tag_pos("MASTER_SPATIAL_POSITION");
2256 auto th_pos_slave = get_tag_pos("SLAVE_SPATIAL_POSITION");
2257 auto th_master_coords = get_tag_pos("MASTER_GAUSS_PTS_COORDS");
2258
2259
2261
2263
2264 auto t_lagrange_slave =
2266 auto t_lag_gap_prod_slave =
2268 auto t_position_master = getFTensor1FromMat<3>(
2270 auto t_position_slave = getFTensor1FromMat<3>(
2272
2273 auto get_ftensor_coords_at_gauss_pts_slave = [&](auto &coords_at_gauss_pts) {
2274 auto ptr = &*coords_at_gauss_pts.data().begin();
2276 &ptr[2]);
2277 };
2278 auto t_coords_at_gauss_pts_slave =
2279 get_ftensor_coords_at_gauss_pts_slave(getCoordsAtGaussPtsSlave());
2280 auto t_coords_at_gauss_pts_master =
2281 get_ftensor_coords_at_gauss_pts_slave(getCoordsAtGaussPtsMaster());
2282
2283 auto t_state_ptr =
2285
2286 auto set_float_precision = [](const double x) {
2287 if (std::abs(x) < std::numeric_limits<float>::epsilon())
2288 return 0.;
2289 else
2290 return x;
2291 };
2292
2293 std::array<double, 3> pos_vec;
2294
2295 auto get_vec_ptr = [&](
auto t) {
2296 for (
int dd = 0;
dd != 3; ++
dd)
2297 pos_vec[dd] = set_float_precision(
t(dd));
2298 return pos_vec.data();
2299 };
2300
2301 int count_active_pts = 0;
2302
2303 for (int gg = 0; gg != nb_gauss_pts; ++gg) {
2304
2305 int state = 0;
2306 if (t_state_ptr > 0.5) {
2307 state = 1;
2308 ++count_active_pts;
2309 }
2310
2311 bool output_at_gauss_pts = true;
2315 &prism_ent, 1, 2, false, tri_ents, moab::Interface::UNION);
2316 tri_ents = tri_ents.subset_by_type(MBTRI);
2318 output_at_gauss_pts = false;
2319 }
2320
2321 if (output_at_gauss_pts) {
2322 CHKERR moabOut.create_vertex(get_vec_ptr(t_coords_at_gauss_pts_slave),
2323 new_vertex);
2324
2325 double gap_vtk = set_float_precision(t_gap_ptr);
2326 CHKERR moabOut.tag_set_data(th_gap, &new_vertex, 1, &gap_vtk);
2327
2328 double lag_gap_prod_vtk = set_float_precision(t_lag_gap_prod_slave);
2329 CHKERR moabOut.tag_set_data(th_lag_gap_prod, &new_vertex, 1,
2330 &lag_gap_prod_vtk);
2331
2332 double lagrange_slave_vtk = set_float_precision(t_lagrange_slave);
2334 &lagrange_slave_vtk);
2335
2336 CHKERR moabOut.tag_set_data(th_state, &new_vertex, 1, &state);
2337
2339 get_vec_ptr(t_position_master));
2341 get_vec_ptr(t_position_slave));
2342
2343 CHKERR moabOut.tag_set_data(th_master_coords, &new_vertex, 1,
2344 get_vec_ptr(t_coords_at_gauss_pts_master));
2345 }
2346
2347 ++t_gap_ptr;
2348 ++t_lagrange_slave;
2349 ++t_lag_gap_prod_slave;
2350 ++t_position_master;
2351 ++t_position_slave;
2352 ++t_coords_at_gauss_pts_slave;
2353 ++t_coords_at_gauss_pts_master;
2354 ++t_state_ptr;
2355 }
2356
2358 int state_side = 0;
2359 if (count_active_pts >= nb_gauss_pts / 2) {
2360 state_side = 1;
2361 }
2363 &state_side);
2364 }
2365
2367}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#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()
#define CHKERR
Inline error check.
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)
static auto getFTensor0FromVec(ublas::vector< T, A > &data)
Get tensor rank 0 (scalar) form data vector.
constexpr double t
plate stiffness
virtual moab::Interface & get_moab()=0
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
const VectorDouble & getFieldData() const
get dofs values