50 Range all_boundary_ents;
54 Range domain_ents_part;
56 Range domain_faces, boundary_faces;
59 moab::Interface::UNION);
60 boundary_faces = intersect(domain_faces, all_boundary_ents);
65 for (
auto &face_ent : boundary_faces) {
68 adj_tet, moab::Interface::UNION);
69 if (adj_tet.size() != 1)
72 "There should be only one ent adjacent to the boundary ent");
74 std::variant<int, double> data;
85 "Wrong data type %d for tag",
type);
152 CHKERR PetscOptionsGetReal(PETSC_NULLPTR,
"",
"-ref_adapt_threshold",
155 Tag th_error_ind, th_order;
159 std::vector<Range> refinement_levels(ref_level + 2);
161 Range domain_ents_part;
164 for (
auto ent : domain_ents_part) {
165 double err_indic = 0;
176 for (
int ll = refinement_levels.size() - 1; ll > 1; ll--) {
177 CHKERR comm->synchroniseEntities(refinement_levels[ll]);
182 moab::Interface::UNION);
185 moab::Interface::UNION);
186 tets = subtract(tets, refinement_levels[ll]);
187 refinement_levels[ll - 1].merge(tets);
190 for (
int ll = 1; ll < refinement_levels.size(); ll++) {
192 if (
oRder + ll > 8) {
194 <<
"setting approximation order higher than 8 is not currently "
199 for (
auto ent : refinement_levels[ll]) {
204 Range ents_to_refine;
205 ents_to_refine.merge(refinement_levels[ll]);
207 Range lower_dim_ents;
210 moab::Interface::UNION);
211 ents_to_refine.merge(lower_dim_ents);
214 CHKERR comm->synchroniseEntities(ents_to_refine);
222 CHKERR comm->synchroniseFieldEntities(
"U");
238 pipeline_mng->getSkeletonRhsFE().reset();
240 auto integration_rule = [](int, int,
int p_data) {
return 2 * p_data + 1; };
247 op_loop_side->getOpPtrVector(), {H1},
"GEOMETRY");
250 auto common_ptr = HookeOps::commonDataFactory<SPACE_DIM, GAUSS, DomainEle>(
251 mField, op_loop_side->getOpPtrVector(),
"U",
"MAT_ELASTIC", Sev::verbose);
253 auto mat_jump_ptr = boost::make_shared<MatrixDouble>();
255 "U", common_ptr->getMatCauchyStress(), mat_jump_ptr));
258 op_ptr->doWorkRhsHook = [&](DataOperator *base_op_ptr,
int side,
260 EntitiesFieldData::EntData &data) {
264 auto fe_ent = op_ptr->getFEEntityHandle();
266 auto t_jump = getFTensor1FromMat<SPACE_DIM>(*mat_jump_ptr);
267 auto t_w = op_ptr->getFTensor0IntegrationWeight();
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));
275 double err_measure = sqrt(err_int);
282 pipeline_mng->getOpSkeletonRhsPipeline().push_back(op_loop_side);
283 pipeline_mng->getOpSkeletonRhsPipeline().push_back(op_ptr);
291 pipeline_mng->getSkeletonRhsFE());
293 pipeline_mng->getSkeletonRhsFE().reset();
295 Range domain_ents_part;
298 ParallelComm *pcomm =
301 CHKERR pcomm->reduce_tags(th_error_ind, MPI_SUM, empty_range);
303 std::array<double, 3> error_indic_loc = {0.0, 0.0, 0.0};
305 for (
auto domain_ent : domain_ents_part) {
308 &domain_ent, 1,
SPACE_DIM - 1,
true, face_ents, moab::Interface::UNION);
310 double err_indic_sum = 0;
311 for (
auto face_ent : face_ents) {
312 double err_indic = 0;
315 err_indic_sum += err_indic;
326 std::vector<double> vpos(3 * vert_num);
328 double vol = Tools::tetVolume(vpos.data());
336 static_cast<double>(domain_ents_part.size());
338 std::array<double, 3> error_indic_glob = {0.0, 0.0, 0.0};
340 MPI_Allreduce(&error_indic_loc[0], &error_indic_glob[0], 3, MPI_DOUBLE,
346 MOFEM_LOG(
"WORLD", Sev::inform) <<
"Global error indicator (norm): "