223#ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS
242 if (!infinite_elem || !infinite_elem->
infinite())
243 libmesh_error_msg(
"Error setting Elem pointer.");
261 inf_fe->attach_quadrature_rule(&qrule);
262 fe->attach_quadrature_rule(&qrule);
263 fe2->attach_quadrature_rule(&qrule);
266 unsigned int side_num=7;
269 Point side_pt = infinite_elem->
side_ptr(0)->vertex_average();
272 for(
unsigned int i=0; i<finite_elem->
n_sides(); ++i)
274 if (finite_elem->
side_ptr(i)->contains_point(side_pt))
292 const std::vector<Point>& i_qpoint = inf_fe->get_xyz();
293 const std::vector<Real> & i_weight = inf_fe->get_Sobolev_weight();
294 const std::vector<Real> & i_JxW = inf_fe->get_JxWxdecay_sq();
295 const std::vector<std::vector<Real> >& i_phi = inf_fe->get_phi();
296 const std::vector<Point> & i_normal = inf_fe->get_normals();
297 const std::vector<std::vector<Point> >& i_tangents = inf_fe->get_tangents();
299 const std::vector<Point>& f_qpoint = fe->get_xyz();
300 const std::vector<Real> & f_weight = fe->get_Sobolev_weight();
301 const std::vector<Real> & f_JxW = fe->get_JxWxdecay_sq();
302 const std::vector<std::vector<Real> >& f_phi = fe->get_phi();
303 const std::vector<Point> & f_normal = fe->get_normals();
304 const std::vector<std::vector<Point> >& f_tangents = fe->get_tangents();
306 const std::vector<Point>& s_qpoint = fe2->get_xyz();
307 const std::vector<Real> & s_JxW = fe2->get_JxWxdecay_sq();
308 const std::vector<std::vector<Real> >& s_phi = fe2->get_phi();
311 inf_fe->reinit(infinite_elem, (
unsigned)0);
312 fe->reinit(finite_elem, side_num);
313 fe2->reinit(&side_elem);
315 LIBMESH_ASSERT_FP_EQUAL(i_weight.size(), f_weight.size(),
TOLERANCE);
316 for(
unsigned int qp =0 ; qp < i_weight.size() ; ++qp)
318 LIBMESH_ASSERT_FP_EQUAL(i_qpoint[qp](0), f_qpoint[qp](0),
TOLERANCE);
319 LIBMESH_ASSERT_FP_EQUAL(i_qpoint[qp](1), f_qpoint[qp](1),
TOLERANCE);
320 LIBMESH_ASSERT_FP_EQUAL(i_qpoint[qp](2), f_qpoint[qp](2),
TOLERANCE);
322 LIBMESH_ASSERT_FP_EQUAL(s_qpoint[qp](0), f_qpoint[qp](0),
TOLERANCE);
323 LIBMESH_ASSERT_FP_EQUAL(s_qpoint[qp](1), f_qpoint[qp](1),
TOLERANCE);
324 LIBMESH_ASSERT_FP_EQUAL(s_qpoint[qp](2), f_qpoint[qp](2),
TOLERANCE);
326 LIBMESH_ASSERT_FP_EQUAL(i_weight[qp], f_weight[qp],
TOLERANCE);
327 LIBMESH_ASSERT_FP_EQUAL(i_JxW[qp] , f_JxW[qp] ,
TOLERANCE);
328 LIBMESH_ASSERT_FP_EQUAL(s_JxW[qp] , f_JxW[qp] ,
TOLERANCE);
331 unsigned int inf_index[] ={0, 1, 2, 6, 7, 8};
332 unsigned int fe_index[] ={0, 2, 1, 8, 7, 6};
333 unsigned int s_index[] ={0, 1, 2, 3, 4, 5};
334 for (
unsigned int i=0; i<6; ++i)
336 LIBMESH_ASSERT_FP_EQUAL(i_phi[inf_index[i]][qp], f_phi[fe_index[i]][qp],
TOLERANCE);
337 LIBMESH_ASSERT_FP_EQUAL(i_phi[inf_index[i]][qp], s_phi[s_index[i]][qp],
TOLERANCE);
341 LIBMESH_ASSERT_FP_EQUAL(i_normal[qp](0), f_normal[qp](0),
TOLERANCE);
342 LIBMESH_ASSERT_FP_EQUAL(i_normal[qp](1), f_normal[qp](1),
TOLERANCE);
343 LIBMESH_ASSERT_FP_EQUAL(i_normal[qp](2), f_normal[qp](2),
TOLERANCE);
345 for (
unsigned int i=0; i< i_tangents[0].size(); ++i)
347 LIBMESH_ASSERT_FP_EQUAL(i_tangents[qp][i](0), f_tangents[qp][i](0),
TOLERANCE);
348 LIBMESH_ASSERT_FP_EQUAL(i_tangents[qp][i](1), f_tangents[qp][i](1),
TOLERANCE);
349 LIBMESH_ASSERT_FP_EQUAL(i_tangents[qp][i](2), f_tangents[qp][i](2),
TOLERANCE);
486#if defined(LIBMESH_ENABLE_INFINITE_ELEMENTS) && defined(LIBMESH_ENABLE_AMR)
509 true, libmesh_nullptr);
513 if (!infinite_elem || !infinite_elem->
infinite())
514 libmesh_error_msg(
"Error setting Elem pointer.");
516 for (
unsigned int n=8; n<12; ++n)
521 *node -= 0.1*(*node-infinite_elem->
origin()).unit();
535 unsigned int num_pt=10;
536 std::vector<Point> points(2*num_pt);
537 points[0]=
Point(-0.7, -0.5, -0.9);
538 points[1]=
Point(-0.1, 0.9, -0.9);
539 points[2]=
Point(-0.7, -0.5, -0.4);
540 points[3]=
Point(-0.1, 0.9, -0.4);
541 points[4]=
Point(-0.7, -0.5, -0.2);
542 points[5]=
Point(-0.1, 0.9, -0.2);
543 points[6]=
Point(-0.7, -0.5, 0.1);
544 points[7]=
Point(-0.1, 0.9, 0.1);
545 points[8]=
Point(-0.7, -0.5, 0.6);
546 points[9]=
Point(-0.1, 0.9, 0.6);
549 Point delta(0.,0.,1e-3);
550 for (
unsigned int i=num_pt; i<2*num_pt; ++i)
551 points[i]=points[i-num_pt]+delta;
554 const std::vector<Point> & q_point = inf_fe->get_xyz();
555 const std::vector<Real> & sob_w = inf_fe->get_Sobolev_weightxR_sq();
556 const std::vector<RealGradient> & dsob_w = inf_fe->get_Sobolev_dweightxR_sq();
557 const std::vector<Real> & sob_now = inf_fe->get_Sobolev_weight();
558 const std::vector<RealGradient>& dsob_now = inf_fe->get_Sobolev_dweight();
559 const std::vector<RealGradient>& dphase = inf_fe->get_dphase();
560 const std::vector<std::vector<RealGradient> >& dphi = inf_fe->get_dphi();
561 const std::vector<std::vector<Real> >& phi = inf_fe->get_phi();
562 const std::vector<std::vector<RealGradient> >& dphi_w = inf_fe->get_dphi_over_decayxR();
563 const std::vector<std::vector<Real> >& phi_w = inf_fe->get_phi_over_decayxR();
564 inf_fe->reinit(infinite_elem,&points);
567 libmesh_assert_equal_to(q_point.size(), sob_w.size());
568 libmesh_assert_equal_to(q_point.size(), dsob_w.size());
569 libmesh_assert_equal_to(q_point.size(), sob_now.size());
570 libmesh_assert_equal_to(q_point.size(), dsob_now.size());
571 libmesh_assert_equal_to(q_point.size(), dphase.size());
572 libmesh_assert_equal_to(phi.size(), phi_w.size());
573 libmesh_assert_equal_to(phi.size(), dphi.size());
574 libmesh_assert_equal_to(phi.size(), dphi_w.size());
575 libmesh_assert_equal_to(q_point.size(), phi[0].size());
576 libmesh_assert_equal_to(q_point.size(), phi_w[0].size());
577 libmesh_assert_equal_to(q_point.size(), dphi[0].size());
578 libmesh_assert_equal_to(q_point.size(), dphi_w[0].size());
580 for(
unsigned int qp =0 ; qp < num_pt ; ++qp)
582 const Point dxyz(q_point[qp+num_pt]-q_point[qp]);
586 LIBMESH_ASSERT_FP_EQUAL((b_i-b_o).norm_sq(), 0,
TOLERANCE);
589 Real weight_o = b_o.
norm_sq()/(q_point[qp+num_pt]-infinite_elem->
origin()).norm_sq();
590 const Real phase_i = (q_point[qp]-infinite_elem->
origin()).norm() - b_i.
norm();
591 const Real phase_o = (q_point[qp+num_pt]-infinite_elem->
origin()).norm() - b_o.
norm();
593 Real tolerance = std::abs((dphase[qp+num_pt]-dphase[qp])*dxyz)+1e-10;
594 Real deriv_mean = (dphase[qp]*dxyz + dphase[qp+num_pt]*dxyz)*0.5;
595 LIBMESH_ASSERT_FP_EQUAL(phase_o - phase_i, deriv_mean, tolerance*.5);
597 tolerance = std::abs((dsob_now[qp+num_pt]-dsob_now[qp])*dxyz)+1e-10;
598 deriv_mean = (dsob_now[qp]*dxyz + dsob_now[qp+num_pt]*dxyz)* 0.5;
599 LIBMESH_ASSERT_FP_EQUAL(sob_now[qp+num_pt] - sob_now[qp], deriv_mean, tolerance*.5);
601 LIBMESH_ASSERT_FP_EQUAL(sob_w[qp+num_pt]*weight_o - sob_w[qp]*weight_i, dsob_w[qp]*dxyz*weight_i, tolerance);
603 for (
unsigned int i=0; i< phi.size(); ++i)
605 tolerance = std::abs((dphi[i][qp+num_pt]-dphi[i][qp])*dxyz)+1e-10;
606 deriv_mean = (dphi[i][qp]*dxyz + dphi[i][qp+num_pt]*dxyz)*0.5;
607 LIBMESH_ASSERT_FP_EQUAL(phi[i][qp+num_pt] - phi[i][qp], deriv_mean, tolerance*.5);
609 deriv_mean = 0.5*(dphi_w[i][qp]*dxyz*sqrt(weight_i) +dphi_w[i][qp+num_pt]*dxyz*sqrt(weight_o));
610 LIBMESH_ASSERT_FP_EQUAL(phi_w[i][qp+num_pt]*sqrt(weight_o) - phi_w[i][qp]*sqrt(weight_i),
611 deriv_mean, tolerance*.5);
617 points[0 ]=
Point(-0.7, -0.5, -0.9);
618 points[2 ]=
Point(-0.1, 0.9, -0.9);
619 points[4 ]=
Point(-0.7, -0.5, -0.4);
620 points[6 ]=
Point(-0.1, 0.9, -0.4);
621 points[8 ]=
Point(-0.7, -0.5, -0.2);
622 points[10]=
Point(-0.1, 0.9, -0.2);
623 points[12]=
Point(-0.7, -0.5, 0.1);
624 points[14]=
Point(-0.1, 0.9, 0.1);
625 points[16]=
Point(-0.7, -0.5, 0.6);
626 points[18]=
Point(-0.1, 0.9, 0.6);
628 delta =
Point(1.2e-4,-2.7e-4,0.);
629 for (
unsigned int i=0; i<2*num_pt; i+=2)
630 points[i+1]=points[i]+delta;
632 const std::vector<Real>& dzetadx = inf_fe->get_dzetadx();
633 const std::vector<Real>& dzetady = inf_fe->get_dzetady();
634 const std::vector<Real>& dzetadz = inf_fe->get_dzetadz();
636 inf_fe->reinit(infinite_elem,&points);
638 for(
unsigned int qp =0 ; qp < 2*num_pt ; qp+=2)
640 const Point dxyz(q_point[qp+1]-q_point[qp]);
645 const Real phase_i = (q_point[qp]-infinite_elem->
origin()).norm() - b_i.
norm();
646 const Real phase_o = (q_point[qp+1]-infinite_elem->
origin()).norm() - b_o.
norm();
648 LIBMESH_ASSERT_FP_EQUAL(weight_o ,weight_i,
TOLERANCE);
650 Point normal(dzetadx[qp],
654 Real a_i= (q_point[qp]-infinite_elem->
origin()).norm()*0.5*(1.-points[qp](2));
660 Real err_direct = 1.5*std::abs(dxyz*normal)/(dxyz.
norm()*normal.
norm());
662 Real tolerance = std::abs((dphase[qp+1]-dphase[qp])*dxyz)*0.5 + err_direct*dxyz.
norm()*dphase[qp].norm();
663 Real deriv_mean = (dphase[qp] + dphase[qp+1])*dxyz*0.5;
664 LIBMESH_ASSERT_FP_EQUAL(phase_o - phase_i, deriv_mean, tolerance );
668 tolerance = std::abs((dsob_now[qp+1]-dsob_now[qp])*dxyz)*.5+1e-10 + err_direct*dxyz.
norm()*dsob_now[qp].norm();
669 deriv_mean = (dsob_now[qp]*dxyz + dsob_now[qp+1]*dxyz)*0.5;
670 LIBMESH_ASSERT_FP_EQUAL(sob_now[qp+1] - sob_now[qp], deriv_mean, tolerance);
672 deriv_mean = (dsob_w[qp]*dxyz*weight_i +dsob_w[qp+1]*dxyz*weight_o)*0.5;
673 LIBMESH_ASSERT_FP_EQUAL(sob_w[qp+1]*weight_o - sob_w[qp]*weight_i, deriv_mean, tolerance);
675 for (
unsigned int i=0; i< phi.size(); ++i)
677 tolerance = std::abs((dphi[i][qp+1]-dphi[i][qp])*dxyz)*0.5+1e-10 + err_direct*dxyz.norm()*dphi[i][qp].norm();
678 deriv_mean = (dphi[i][qp]*dxyz + dphi[i][qp+1]*dxyz)*.5;
679 LIBMESH_ASSERT_FP_EQUAL(phi[i][qp+1] - phi[i][qp], deriv_mean, tolerance);
977 {0,9,0.0550016}, {1,5,0.41674}, {2,8,0.0147376}, {3,7,0.111665},
978 {4,6,0.0737011}, {5,1,0.0803773}, {6,11,0.275056}, {7,15,0.021537}
983 {0,3,0.0425633}, {1,6,0.0343526}, {2,2,0.158848}, {3,7,0.128206},
984 {4,12,0.220829}, {5,5,-0.136549}, {6,0,0.0149032}, {7,10,-0.0334936},
985 {8,16,0.00399329}, {9,18,-0.00209733}, {10,2,0.0556194}, {11,17,-0.000561977}
990 {12,9,0.136657}, {13,6,0.175034}, {14,20,-0.0011016}, {15,15,0.0428935}
995 {16,3,0.00826618}, {17,10,-0.547813}, {18,14,0.311004}, {19,27,-0.00192085}
1003 {0,9,
Point(-0.0429458,-0.0115073,0.)},
1004 {1,5,
Point(0.177013,-0.177013,-0.483609)},
1005 {2,8,
Point(0.0115073,0.0115073,0.00842393)},
1006 {3,7,
Point(-0.177013,0.0474305,0.)},
1007 {4,6,
Point(-0.031305,-0.116832,0.10025)},
1008 {5,1,
Point(0.0474191,-0.0474191,0.872917)},
1009 {6,11,
Point(0.0575466,0.0575466,-0.11251)},
1010 {7,15,
Point(-0.00353805,0.000948017,0.000111572)},
1015 {0,3,
Point(-0.0959817, -0.0959817, 0.0702635)},
1016 {1,6,
Point(0.0625228, -0.0625228, 0.0457699)},
1017 {2,2,
Point(0.358209, 0.0959817, 0.)},
1018 {3,7,
Point(-0.233338, 0.0625228, 0.)},
1019 {4,12,
Point(-0.0323071, -0.0323071, -0.0729771)},
1020 {5,5,
Point(0.248523, 0.0665915, -0.245097)},
1021 {6,0,
Point(0.0336072, -0.00900502, 0.288589)},
1022 {7,10,
Point(-0.0396234, 0.0396234, -0.0290064)},
1023 {8,16,
Point(0.000443217, 0.000443217, 0.000333678)},
1024 {9,18,
Point(-0.000232783, -6.23741e-05, 9.35433e-05)},
1025 {10,2,
Point(-0.0336072, 0.0336072, 0.985214)},
1026 {11,17,
Point(6.23741e-05, -6.23741e-05, -2.05961e-05)},
1031 {12,9,
Point(0.0536552, 0.200244, -0.0849541)},
1032 {13,6,
Point(-0.0921697, 0.0921697, 0.461056)},
1033 {14,20,
Point(2.35811e-05, -8.80059e-05, 3.58959e-05)},
1034 {15,15,
Point(-0.0386352, 0.0103523, -0.0197323)},
1039 {16,3,
Point(-0.0190603, 0.0051072, 0.308529)},
1040 {17,10,
Point(0.244125, -0.244125, 0.140907)},
1041 {18,14,
Point(-0.0985844, 0.0985844, -0.502591)},
1042 {19,27,
Point(0.000115647, -3.09874e-05, 4.30775e-05)}
1051 {0,9,0.0550016}, {1,5,0.41674}, {2,8,0.0147376}, {3,7,0.111665},
1053 {4,6,0.147402}, {5,1,0.160755}, {6,11,0.550112}, {7,15,0.043074}
1059 {0,3,0.0425633}, {1,6,0.0343526}, {2,2,0.158848}, {3,7,0.128206},
1061 {4,12,0.441658}, {5,5,-0.193445}, {6,0,0.0298063}, {7,10,-0.0279114},
1062 {8,16,0.00798659}, {9,18,0.0320146}, {10,2,0.111239}, {11,17,0.00857829}
1067 {12,9,0.0837876}, {13,6,0.350068}, {14,20,0.0244336}, {15,15,0.0181532}
1072 {16,3,0.0165324}, {17,10,-0.720085}, {18,14,0.0777511}, {19,27,0.0453842}
1081 {0,9,
Point(-0.0429458, -0.0115073, 0.)},
1082 {1,5,
Point(0.177013, -0.177013, -0.483609)},
1083 {2,8,
Point(0.0115073, 0.0115073, 0.00842393)},
1084 {3,7,
Point(-0.177013, 0.0474305, 0.)},
1086 {4,6,
Point(-0.0626101, -0.233664, 0.2005)},
1087 {5,1,
Point(0.0948382, -0.0948382, 1.74583)},
1088 {6,11,
Point(0.115093, 0.115093, -0.22502)},
1089 {7,15,
Point(-0.0070761, 0.00189603, 0.000223144)}
1095 {0,3,
Point(-0.0959817, -0.0959817, 0.0702635)},
1096 {1,6,
Point(0.0625228, -0.0625228, 0.0457699)},
1097 {2,2,
Point(0.358209, 0.0959817, 0.)},
1098 {3,7,
Point(-0.233338, 0.0625228, 0.)},
1100 {4,12,
Point(-0.0646142, -0.0646142, -0.145954)},
1101 {5,5,
Point(0.352076, 0.0943384, -0.233431)},
1102 {6,0,
Point(0.0672144, -0.01801, 0.577179)},
1103 {7,10,
Point(-0.0330195, 0.0330195, 0.00373942)},
1104 {8,16,
Point(0.000886435, 0.000886435, 0.000667355)},
1105 {9,18,
Point(0.00355332, 0.000952108, 0.000319882)},
1106 {10,2,
Point(-0.0672144, 0.0672144, 1.97043)},
1107 {11,17,
Point(-0.000952108, 0.000952108, 0.000782704)}
1112 {12,9,
Point(0.0328972,0.122774,-0.222472)},
1113 {13,6,
Point(-0.184339,0.184339,0.922112)},
1114 {14,20,
Point(-0.000523034,0.00195199,0.000121819)},
1115 {15,15,
Point(-0.016351,0.00438123,0.0404817)}
1120 {16,3,
Point(-0.0381206,0.0102144,0.617059)},
1121 {17,10,
Point(0.320895,-0.320895,0.641729)},
1122 {18,14,
Point(-0.0246461,0.0246461,-0.300588)},
1123 {19,27,
Point(-0.0027324,0.000732145,0.000328402)}
1132 {0,9,0.0550016}, {1,5,0.41674}, {2,8,0.0147376}, {3,7,0.111665},
1134 {4,6,0.184253}, {5,1,0.200943}, {6,11,0.68764}, {7,15,0.0538426}
1140 {0,3,0.0425633}, {1,6,0.0343526}, {2,2,0.158848}, {3,7,0.128206},
1142 {4,12,0.552072}, {5,5,-0.211652}, {6,0,0.0372579}, {7,10,-0.0167468},
1143 {8,16,0.00998323}, {9,18,0.0597236}, {10,2,0.139049}, {11,17,0.0160029}
1148 {12,9,0.0469849}, {13,6,0.437585}, {14,20,0.0450821}, {15,15,0.0469849}
1153 {16,3,0.0206655}, {17,10,-0.748341}, {18,14,0}, {19,27,0.115995}
1162 {0,9,
Point(-0.0429458, -0.0115073, 0.)},
1163 {1,5,
Point(0.177013, -0.177013, -0.483609)},
1164 {2,8,
Point(0.0115073, 0.0115073, 0.00842393)},
1165 {3,7,
Point(-0.177013, 0.0474305, 0.)},
1167 {4,6,
Point(-0.0782626,-0.29208,0.250625)},
1168 {5,1,
Point(0.118548,-0.118548,2.18229)},
1169 {6,11,
Point(0.143866,0.143866,-0.281275)},
1170 {7,15,
Point(-0.00884512,0.00237004,0.00027893)}
1176 {0,3,
Point(-0.0959817, -0.0959817, 0.0702635)},
1177 {1,6,
Point(0.0625228, -0.0625228, 0.0457699)},
1178 {2,2,
Point(0.358209, 0.0959817, 0.)},
1179 {3,7,
Point(-0.233338, 0.0625228, 0.)},
1181 {4,12,
Point(-0.0807678,-0.0807678,-0.182443)},
1182 {5,5,
Point(0.385213,0.103218,-0.175079)},
1183 {6,0,
Point(0.0840179,-0.0225125,0.721474)},
1184 {7,10,
Point(-0.0198117,0.0198117,0.0357373)},
1185 {8,16,
Point(0.00110804,0.00110804,0.000834194)},
1186 {9,18,
Point(0.00662875,0.00177617,0.000482244)},
1187 {10,2,
Point(-0.0840179,0.0840179,2.46303)},
1188 {11,17,
Point(-0.00177617,0.00177617,0.00142946)},
1193 {12,9,
Point(0.0184475,0.0688471,-0.254748)},
1194 {13,6,
Point(-0.230424,0.230424,1.15264)},
1195 {14,20,
Point(-0.000965042,0.00360159,0.000183379)},
1196 {15,15,
Point(-0.0423204,0.0113397,0.12514)}
1201 {16,3,
Point(-0.0476508,0.012768,0.771323)},
1202 {17,10,
Point(0.333487,-0.333487,1.01421)},
1203 {18,14,
Point(0,0,0)},
1204 {19,27,
Point(-0.00698362,0.00187126,0.000667664)},