230 {
234
237
240 auto &skeleton_pipeline = pipeline_mng->getOpSkeletonRhsPipeline();
241
242 if (skeleton_pipeline.empty()) {
243
244 auto op_loop_side =
246
248 op_loop_side->getOpPtrVector(), {H1}, "GEOMETRY");
249
250
251 auto common_ptr = HookeOps::commonDataFactory<SPACE_DIM, GAUSS, DomainEle>(
252 mField, op_loop_side->getOpPtrVector(),
"U",
"MAT_ELASTIC",
253 Sev::verbose);
254
255 auto mat_jump_ptr = boost::make_shared<MatrixDouble>();
257 "U", common_ptr->getMatCauchyStress(), mat_jump_ptr));
258
260 op_ptr->doWorkRhsHook = [this, th_error_ind,
261 mat_jump_ptr](DataOperator *base_op_ptr, int side,
263 EntitiesFieldData::EntData &data) {
267 auto fe_ent = op_ptr->getFEEntityHandle();
268
269 auto t_jump = getFTensor1FromMat<SPACE_DIM>(*mat_jump_ptr);
270 auto t_w = op_ptr->getFTensor0IntegrationWeight();
271 double err_int = 0;
272 const auto nb_gauss_pts = op_ptr->getGaussPts().size2();
273 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
274 err_int += t_w * (t_jump(
i) * t_jump(
i));
275 ++t_jump;
276 ++t_w;
277 }
278 double err_measure = sqrt(err_int);
280 &err_measure);
281
283 };
284
285 skeleton_pipeline.push_back(op_loop_side);
286 skeleton_pipeline.push_back(op_ptr);
287 }
288
291 double zero = 0;
293
295 pipeline_mng->getSkeletonRhsFE());
296
297 Range domain_ents_part;
299
300 ParallelComm *pcomm =
303 CHKERR pcomm->reduce_tags(th_error_ind, MPI_SUM, empty_range);
304
305 std::array<double, 3> error_indic_loc = {0.0, 0.0, 0.0};
306
307 for (auto domain_ent : domain_ents_part) {
310 &domain_ent, 1,
SPACE_DIM - 1,
true, face_ents, moab::Interface::UNION);
311
312 double err_indic_sum = 0;
313 for (auto face_ent : face_ents) {
314 double err_indic = 0;
316 &err_indic);
317 err_indic_sum += err_indic;
318 }
320 &err_indic_sum);
321
323
324 const EntityHandle *vert_conn;
325 int vert_num;
327 true);
328 std::vector<double> vpos(3 * vert_num);
330 double vol = Tools::tetVolume(vpos.data());
331
333 }
334
336
338 static_cast<double>(domain_ents_part.size());
339
340 std::array<double, 3> error_indic_glob = {0.0, 0.0, 0.0};
341
342 MPI_Allreduce(&error_indic_loc[0], &error_indic_glob[0], 3, MPI_DOUBLE,
344
347
348 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Global error indicator (norm): "
352
354}
static MoFEMErrorCode getTagHandle(MoFEM::Interface &m_field, const char *name, DataType type, Tag &tag_handle)
static MoFEMErrorCode getDomainEntsPart(MoFEM::Interface &m_field, Range &domain_ents_part)
static MoFEMErrorCode copyTagOnSkin(MoFEM::Interface &m_field, const char *name, DataType type)
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MOFEM_LOG(channel, severity)
Log.
virtual MPI_Comm & get_comm() const =0