230 {
234
237
238 pipeline_mng->getSkeletonRhsFE().reset();
239
242
243 auto op_loop_side =
245
247 op_loop_side->getOpPtrVector(), {H1}, "GEOMETRY");
248
249
250 auto common_ptr = HookeOps::commonDataFactory<SPACE_DIM, GAUSS, DomainEle>(
251 mField, op_loop_side->getOpPtrVector(),
"U",
"MAT_ELASTIC", Sev::verbose);
252
253 auto mat_jump_ptr = boost::make_shared<MatrixDouble>();
255 "U", common_ptr->getMatCauchyStress(), mat_jump_ptr));
256
258 op_ptr->doWorkRhsHook = [&](DataOperator *base_op_ptr, int side,
260 EntitiesFieldData::EntData &data) {
264 auto fe_ent = op_ptr->getFEEntityHandle();
265
266 auto t_jump = getFTensor1FromMat<SPACE_DIM>(*mat_jump_ptr);
267 auto t_w = op_ptr->getFTensor0IntegrationWeight();
268 double err_int = 0;
269 const auto nb_gauss_pts = op_ptr->getGaussPts().size2();
270 for (auto gg = 0; gg != nb_gauss_pts; ++gg) {
271 err_int += t_w * (t_jump(
i) * t_jump(
i));
272 ++t_jump;
273 ++t_w;
274 }
275 double err_measure = sqrt(err_int);
277 &err_measure);
278
280 };
281
282 pipeline_mng->getOpSkeletonRhsPipeline().push_back(op_loop_side);
283 pipeline_mng->getOpSkeletonRhsPipeline().push_back(op_ptr);
284
287 double zero = 0;
289
291 pipeline_mng->getSkeletonRhsFE());
292
293 pipeline_mng->getSkeletonRhsFE().reset();
294
295 Range domain_ents_part;
297
298 ParallelComm *pcomm =
301 CHKERR pcomm->reduce_tags(th_error_ind, MPI_SUM, empty_range);
302
303 std::array<double, 3> error_indic_loc = {0.0, 0.0, 0.0};
304
305 for (auto domain_ent : domain_ents_part) {
308 &domain_ent, 1,
SPACE_DIM - 1,
true, face_ents, moab::Interface::UNION);
309
310 double err_indic_sum = 0;
311 for (auto face_ent : face_ents) {
312 double err_indic = 0;
314 &err_indic);
315 err_indic_sum += err_indic;
316 }
318 &err_indic_sum);
319
321
323 int vert_num;
325 true);
326 std::vector<double> vpos(3 * vert_num);
328 double vol = Tools::tetVolume(vpos.data());
329
331 }
332
334
336 static_cast<double>(domain_ents_part.size());
337
338 std::array<double, 3> error_indic_glob = {0.0, 0.0, 0.0};
339
340 MPI_Allreduce(&error_indic_loc[0], &error_indic_glob[0], 3, MPI_DOUBLE,
342
345
346 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Global error indicator (norm): "
350
352}
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