2 #include "libmesh/libmesh.h" 3 #include "libmesh/replicated_mesh.h" 4 #include "libmesh/mesh_generation.h" 5 #include "libmesh/inf_elem_builder.h" 6 #include "libmesh/fe_type.h" 7 #include "libmesh/quadrature_gauss.h" 8 #include "libmesh/inf_fe.h" 9 #include "libmesh/fe_interface.h" 10 #include "libmesh/jacobi_polynomials.h" 12 #ifdef LIBMESH_ENABLE_AMR 13 #include "libmesh/equation_systems.h" 14 #include "libmesh/mesh_refinement.h" 15 #include "libmesh/linear_implicit_system.h" 16 #include "libmesh/point_locator_tree.h" 17 #include "libmesh/dof_map.h" 28 #include "libmesh/type_tensor.h" 29 #include "libmesh/fe.h" 31 #include "libmesh/face_tri6.h" 50 CPPUNIT_TEST( testDifferentOrders );
51 CPPUNIT_TEST( testInfQuants );
52 CPPUNIT_TEST( testSides );
53 CPPUNIT_TEST( testInfQuants_numericDeriv );
54 #if defined(LIBMESH_ENABLE_AMR) && !defined(LIBMESH_ENABLE_NODE_CONSTRAINTS) 55 CPPUNIT_TEST( testRefinement );
57 CPPUNIT_TEST_SUITE_END();
63 : i(i_in), qp(qp_in), val(val_in) {}
72 : i(i_in), qp(qp_in), grad(grad_in) {}
80 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 101 const Point xi ( base_elem->point(1) - base_elem->point(0));
102 const Point eta( base_elem->point(2) - base_elem->point(0));
103 const Point zeta( physical_point - o);
106 Point n(xi.cross(eta));
107 Real c_factor = (base_elem->point(0) - o)*n/(zeta*n) - 1.;
114 return Point(0., 0., -2.);
118 intersection.
add_scaled(physical_point,1.+c_factor);
121 if (!base_elem->has_affine_map())
123 unsigned int iter_max = 20;
135 for(
unsigned int it=0; it<iter_max; ++it)
142 Point intersection_guess;
143 for(
unsigned int i=0; i<n_sf; ++i)
147 base_elem->default_order(),
152 base_elem->default_order(),
158 base_elem->default_order(),
164 TypeVector<Real> F(physical_point + c_factor*(physical_point-o) - intersection_guess);
167 J(0,0) = (physical_point-o)(0);
168 J(0,1) = -dxyz_dxi(0);
169 J(0,2) = -dxyz_deta(0);
170 J(1,0) = (physical_point-o)(1);
171 J(1,1) = -dxyz_dxi(1);
172 J(1,2) = -dxyz_deta(1);
173 J(2,0) = (physical_point-o)(2);
174 J(2,1) = -dxyz_dxi(2);
175 J(2,2) = -dxyz_deta(2);
183 if ( delta.
norm() < tol )
186 if (base_elem->contains_point(intersection_guess,
TOLERANCE*0.1))
188 intersection = intersection_guess;
192 err<<
" No! This inverse_map failed!"<<std::endl;
198 c_factor -= delta(0);
199 ref_point(0) -= delta(1);
200 ref_point(1) -= delta(2);
211 return Point(0.,0.,-2.);
212 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS 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);
359 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 390 true, libmesh_nullptr);
394 if (!infinite_elem || !infinite_elem->
infinite())
395 libmesh_error_msg(
"Error setting Elem pointer.");
409 inf_fe->attach_quadrature_rule(&qrule);
411 const std::vector<Point>& _qpoint = inf_fe->get_xyz();
412 const std::vector<Real> & _weight = inf_fe->get_Sobolev_weight();
413 const std::vector<RealGradient>& dweight = inf_fe->get_Sobolev_dweight();
414 const std::vector<Real>& dxidx = inf_fe->get_dxidx();
415 const std::vector<Real>& dxidy = inf_fe->get_dxidy();
416 const std::vector<Real>& dxidz = inf_fe->get_dxidz();
417 const std::vector<Real>& detadx = inf_fe->get_detadx();
418 const std::vector<Real>& detady = inf_fe->get_detady();
419 const std::vector<Real>& detadz = inf_fe->get_detadz();
420 const std::vector<Real>& dzetadx = inf_fe->get_dzetadx();
421 const std::vector<Real>& dzetady = inf_fe->get_dzetady();
422 const std::vector<Real>& dzetadz = inf_fe->get_dzetadz();
423 const std::vector<RealGradient>& dphase = inf_fe->get_dphase();
425 inf_fe->reinit(infinite_elem);
427 for(
unsigned int qp =0 ; qp < _weight.size() ; ++qp)
437 const Point b = base_point(_qpoint[qp], infinite_elem) - infinite_elem->
origin();
438 const Point p = _qpoint[qp] - infinite_elem ->
origin();
445 LIBMESH_ASSERT_FP_EQUAL(again_qp(0), _qpoint[qp](0),
TOLERANCE);
446 LIBMESH_ASSERT_FP_EQUAL(again_qp(1), _qpoint[qp](1),
TOLERANCE);
447 LIBMESH_ASSERT_FP_EQUAL(again_qp(2), _qpoint[qp](2),
TOLERANCE);
449 const Point normal(dzetadx[qp],
455 LIBMESH_ASSERT_FP_EQUAL(normal*dweight[qp], -normal.
norm()*dweight[qp].norm(),
TOLERANCE);
459 LIBMESH_ASSERT_FP_EQUAL(normal*dphase[qp], normal.
norm()*dphase[qp].norm(), 3e-4);
460 else if (rp(2) > .85)
462 LIBMESH_ASSERT_FP_EQUAL(p*dphase[qp]/p.
norm(), dphase[qp].norm(), 1e-4);
472 const Point e_xi(dxidx[qp], dxidy[qp], dxidz[qp]);
473 const Point e_eta(detadx[qp], detady[qp], detadz[qp]);
475 LIBMESH_ASSERT_FP_EQUAL(0., b*e_xi,
TOLERANCE);
476 LIBMESH_ASSERT_FP_EQUAL(0., b*e_eta,
TOLERANCE);
480 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS 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]);
583 const Point b_i= base_point(q_point[qp], infinite_elem) - infinite_elem->
origin();
584 const Point b_o= base_point(q_point[qp+num_pt], infinite_elem) - infinite_elem->
origin();
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]);
641 const Point b_i= base_point(q_point[qp], infinite_elem) - infinite_elem->
origin();
642 const Point b_o= base_point(q_point[qp+1], infinite_elem) - infinite_elem->
origin();
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 );
666 LIBMESH_ASSERT_FP_EQUAL(normal.cross(dsob_now[qp]).norm_sq(), 0.0,
TOLERANCE*
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);
683 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS && LIBMESH_ENABLE_AMR 712 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 737 libmesh_error_msg_if(!infinite_elem || !infinite_elem->
infinite(),
738 "Error setting Elem pointer.");
752 inf_fe->attach_quadrature_rule(&qrule);
753 const std::vector<std::vector<Real>> & phi = inf_fe->get_phi();
754 const std::vector<std::vector<RealGradient>> & dphi = inf_fe->get_dphi();
757 inf_fe->reinit(infinite_elem);
794 tabulated_vals[std::make_pair(radial_order, radial_family)];
796 tabulated_grads[std::make_pair(radial_order, radial_family)];
800 for (
const auto & t : val_table)
801 LIBMESH_ASSERT_FP_EQUAL(t.val, phi[t.i][t.qp],
TOLERANCE);
802 for (
const auto & t : grad_table)
803 LIBMESH_ASSERT_FP_EQUAL(0., (dphi[t.i][t.qp] - t.grad).norm_sq(), 1e-10);
806 libmesh_error_msg_if(val_table.empty(),
"No tabulated values found!");
807 libmesh_error_msg_if(grad_table.empty(),
"No tabulated gradients found!");
809 #endif // LIBMESH_ENABLE_INFINITE_ELEMENTS 812 #ifdef LIBMESH_ENABLE_AMR 815 #ifdef LIBMESH_ENABLE_INFINITE_ELEMENTS 835 for (
unsigned int i=0; i< 8; ++i)
873 std::vector<dof_id_type> dof_indices;
880 const auto n_end =
mesh.nodes_end();
881 auto n_it =
mesh.nodes_begin();
884 for(; n_it != n_end; ++n_it)
886 const Node* node = *n_it;
890 const Elem * some_elem = pt_lctr(*node);
894 FEBase * cfe = libmesh_nullptr;
901 const std::vector<std::vector<Real> >& phi = cfe->
get_phi();
904 std::vector<Point> eval_pt(1, node_internal);
905 cfe->
reinit(some_elem, &eval_pt);
910 std::vector<dof_id_type> reference_indices(dof_indices.size());
911 for (
unsigned int i=0; i< dof_indices.size(); ++i)
913 reference_indices[i]=dof_indices[i];
914 reference_values(i)=phi[i][0];
918 std::set<const libMesh::Elem *> elements;
921 for (
auto const_elem : elements)
923 if (some_elem->
id() == const_elem->id())
934 const std::vector<std::vector<Real> >& phi1 = cfe->
get_phi();
937 cfe->
reinit(elem, &eval_pt);
940 for(
unsigned int i=0; i < phi_values.size(); ++i)
941 phi_values(i) = phi1[i][0];
945 for(
unsigned int i=0; i< dof_indices.size(); ++i)
948 for(
unsigned int gi=0; gi < reference_indices.size(); ++gi)
950 if (reference_indices[gi] == dof_indices[i])
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)},
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
virtual void enable_out_of_mesh_mode() override final
Enables out-of-mesh mode.
This is the EquationSystems class.
The ReplicatedMesh class is derived from the MeshBase class, and is used to store identical copies of...
void add_scaled(const TypeVector< T2 > &, const T &)
Add a scaled value to this vector without creating a temporary.
Order
defines an enum for polynomial orders.
virtual Node *& set_node(const unsigned int i)
A Node is like a Point, but with more information.
auto norm() const -> decltype(std::norm(T()))
virtual Point origin() const
boost::multiprecision::float128 real(const boost::multiprecision::float128 in)
static OutputShape shape(const ElemType t, const Order o, const unsigned int i, const Point &p)
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
libMesh::Parallel::Communicator * TestCommWorld
The definition of the const_element_iterator struct.
static constexpr Real TOLERANCE
static Point inverse_map(const unsigned int dim, const Elem *elem, const Point &p, const Real tolerance=TOLERANCE, const bool secure=true, const bool extra_checks=true)
bool refine_elements()
Only refines the user-requested elements.
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
OrderWrapper radial_order
The approximation order in radial direction of the infinite element.
void set_spatial_dimension(unsigned char d)
Sets the "spatial dimension" of the Mesh.
void prepare_for_use(const bool skip_renumber_nodes_and_elements, const bool skip_find_neighbors)
Prepare a newly ecreated (or read) mesh for use.
This class is for unit testing the "radial" basis function aspects of the InfFE.
This is the base class from which all geometric element types are derived.
std::vector< TabulatedGrad > TabulatedGrads
void set_refinement_flag(const RefinementState rflag)
Sets the value of the refinement flag for the element.
void solve(const TypeVector< T > &b, TypeVector< T > &x) const
Solve the 2x2 or 3x3 system of equations A*x = b for x by directly inverting A and multiplying it by ...
Order default_quadrature_order() const
static OutputShape shape_deriv(const ElemType t, const Order o, const unsigned int i, const unsigned int j, const Point &p)
std::vector< TabulatedVal > TabulatedVals
void testSingleOrder(Order radial_order, FEFamily radial_family)
The libMesh namespace provides an interface to certain functionality in the library.
static std::unique_ptr< const Elem > build_elem(const Elem *inf_elem)
Build the base element of an infinite element.
virtual Node * add_point(const Point &p, const dof_id_type id=DofObject::invalid_id, const processor_id_type proc_id=DofObject::invalid_processor_id)=0
Add a new Node at Point p to the end of the vertex array, with processor_id procid.
The Tri6 is an element in 2D composed of 6 nodes.
This class defines a tensor in LIBMESH_DIM dimensional space of type T.
This class handles the numbering of degrees of freedom on a mesh.
virtual unsigned int n_shape_functions() const override
TabulatedGrad(unsigned int i_in, unsigned int qp_in, Point grad_in)
void testDifferentOrders()
void libmesh_ignore(const Args &...)
auto norm_sq() const -> decltype(std::norm(T()))
std::pair< bool, double > InfElemOriginValue
Useful typedef.
Implements (adaptive) mesh refinement algorithms for a MeshBase.
virtual Elem * add_elem(Elem *e)=0
Add elem e to the end of the element array.
void testInfQuants_numericDeriv()
virtual void reinit()
Handle any mesh changes and reinitialize all the systems on the updated mesh.
void find_point_neighbors(const Point &p, std::set< const Elem *> &neighbor_set) const
This function finds all active elements (including this one) which are in the same manifold as this e...
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
static const dof_id_type invalid_id
An invalid id to distinguish an uninitialized DofObject.
std::map< KeyType, TabulatedGrads > tabulated_grads
virtual void reinit(const Elem *elem, const std::vector< Point > *const pts=nullptr, const std::vector< Real > *const weights=nullptr)=0
This is at the core of this class.
unsigned int add_variable(std::string_view var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
Adds the variable var to the list of variables for this system.
void set_mesh_dimension(unsigned char d)
Resets the logical dimension of the mesh.
Point base_point(const Point physical_point, const Elem *inf_elem)
This class is used to build infinite elements on top of an existing mesh.
virtual const Elem * elem_ptr(const dof_id_type i) const =0
virtual unsigned int n_sides() const =0
const Elem * neighbor_ptr(unsigned int i) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::map< KeyType, TabulatedVals > tabulated_vals
virtual std::unique_ptr< Elem > side_ptr(unsigned int i)=0
const Point build_inf_elem(const bool be_verbose=false)
Build infinite elements atop a volume-based mesh, determine origin automatically. ...
void constrain_element_vector(DenseVector< Number > &rhs, std::vector< dof_id_type > &dofs, bool asymmetric_constraint_rows=true) const
Constrains the element vector.
const Node * node_ptr(const unsigned int i) const
static Point map(const unsigned int dim, const Elem *elem, const Point &reference_point)
static std::unique_ptr< Elem > build_with_id(const ElemType type, dof_id_type id)
Calls the build() method above with a nullptr parent, and additionally sets the newly-created Elem's ...
TabulatedVal(unsigned int i_in, unsigned int qp_in, Real val_in)
void all_second_order(const bool full_ordered=true)
Calls the range-based version of this function with a range consisting of all elements in the mesh...
CPPUNIT_TEST_SUITE_REGISTRATION(InfFERadialTest)
std::pair< Order, FEFamily > KeyType
This class implements specific orders of Gauss quadrature.
unsigned int mesh_dimension() const
static std::unique_ptr< FEGenericBase > build_InfFE(const unsigned int dim, const FEType &type)
Builds a specific infinite element type.
virtual bool infinite() const =0
FEFamily
defines an enum for finite element families.
virtual dof_id_type n_elem() const =0
virtual System & add_system(std::string_view system_type, std::string_view name)
Add the system of type system_type named name to the systems array.
virtual const Node * node_ptr(const dof_id_type i) const =0
const DofMap & get_dof_map() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
This class forms the foundation from which generic finite elements may be derived.
const Elem * child_ptr(unsigned int i) const
const std::vector< std::vector< OutputShape > > & get_phi() const