6 #include <libmesh/cell_c0polyhedron.h> 7 #include <libmesh/dof_map.h> 8 #include <libmesh/elem.h> 9 #include <libmesh/equation_systems.h> 10 #include <libmesh/face_c0polygon.h> 11 #include <libmesh/fe.h> 12 #include <libmesh/fe_base.h> 13 #include <libmesh/fe_interface.h> 14 #include <libmesh/function_base.h> 15 #include <libmesh/mesh.h> 16 #include <libmesh/mesh_generation.h> 17 #include <libmesh/mesh_modification.h> 18 #include <libmesh/numeric_vector.h> 19 #include <libmesh/system.h> 20 #include <libmesh/quadrature_gauss.h> 27 CPPUNIT_TEST( testFEInterface ); \ 28 CPPUNIT_TEST( testU ); \ 29 CPPUNIT_TEST( testPartitionOfUnity ); \ 30 CPPUNIT_TEST( testGradU ); \ 31 CPPUNIT_TEST( testGradUComp ); \ 32 CPPUNIT_TEST( testHessU ); \ 33 CPPUNIT_TEST( testHessUComp ); \ 34 CPPUNIT_TEST( testDualDoesntScreamAndDie ); \ 35 CPPUNIT_TEST( testCustomReinit ); 42 std::unique_ptr<FunctionBase<Real>>
clone ()
const override 43 {
return std::make_unique<SkewFunc>(); }
46 const Real = 0.)
override 47 { libmesh_not_implemented(); }
50 void operator() (
const Point & p,
74 const Real & x = p(0);
75 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
76 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
78 return x + 0.25*y + 0.0625*z;
103 const Real & x = p(0);
104 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
105 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
107 return x*x + 0.5*y*y + 0.25*z*z + 0.125*x*y + 0.0625*x*z + 0.03125*y*z;
116 const Real & x = p(0);
117 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
118 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
120 Gradient grad = 2*x + 0.125*y + 0.0625*z;
122 grad(1) = y + 0.125*x + 0.03125*z;
124 grad(2) = 0.5*z + 0.0625*x + 0.03125*y;
136 const Real & x = p(0);
137 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
138 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
140 return x*(1-x)*(1-x) + x*x*(1-y) + x*(1-y)*(1-z) + y*(1-y)*z + z*(1-z)*(1-z);
149 const Real & x = p(0);
150 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
151 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
153 Gradient grad = 3*x*x-4*x+1 + 2*x*(1-y) + (1-y)*(1-z);
155 grad(1) = -x*x - x*(1-z) + (1-2*y)*z;
157 grad(2) = -x*(1-y) + y*(1-y) + 3*z*z-4*z+1;
169 const Real & x = p(0);
170 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
171 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
173 return x*x*(1-x)*(1-x) + x*x*z*(1-y) + x*(1-x)*(1-y)*(1-z) + (1-x)*y*(1-y)*z + z*z*(1-z)*(1-z);
182 const Real & x = p(0);
183 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
184 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
186 Gradient grad = 4*x*x*x-6*x*x+2*x + 2*x*z*(1-y) + (1-2*x)*(1-y)*(1-z) - y*(1-y)*z;
188 grad(1) = -x*x*z - x*(1-x)*(1-z) + (1-x)*(1-2*y)*z;
190 grad(2) = x*x*(1-y) - x*(1-x)*(1-y) + (1-x)*y*(1-y) + 4*z*z*z-6*z*z+2*z;
208 const Real & x = p(0);
209 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
210 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
216 return (x + 0.25*y + 0.0625*z)/denom;
225 const Real & x = p(0);
226 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
227 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
236 const Real denom = xpoly * ypoly * zpoly;
238 const Real numer = (x + 0.25*y + 0.0625*z);
240 Gradient grad_n = 1, grad_d = xderiv * ypoly * zpoly;
244 grad_d(1) = xpoly * yderiv * zpoly;
249 grad_d(2) = xpoly * ypoly * zderiv;
252 Gradient grad = (grad_n - numer * grad_d / denom) / denom;
258 #define FE_CAN_TEST_CUBIC \ 259 (((family != LAGRANGE && family != L2_LAGRANGE) || \ 260 (elem_type != TRI7 && elem_type != TET14 && \ 261 elem_type != PRISM20 && elem_type != PRISM21 && \ 262 elem_type != PYRAMID18)) && order > 2) 268 template <Order order, FEFamily family, ElemType elem_type,
unsigned int build_nx,
typename CaseName = Default>
277 unsigned int _dim, _nx, _ny,
_nz;
282 std::unique_ptr<EquationSystems>
_es;
283 std::unique_ptr<FEBase>
_fe;
300 else if (FE_CAN_TEST_CUBIC)
304 const Real & x = p(0);
305 const Real & y = (LIBMESH_DIM > 1) ? p(1) : 0;
306 const Real & z = (LIBMESH_DIM > 2) ? p(2) : 0;
308 true_grad =
Gradient(2*x+0.125*y+0.0625*z,
310 0.5*z+0.0625*x+0.03125*y);
313 true_grad =
Gradient(1.0, 0.25, 0.0625);
315 for (
unsigned int d=0; d != LIBMESH_DIM; ++d)
317 CPPUNIT_ASSERT(true_grad(d) ==
329 const Real & x = p(0);
330 const Real & y = LIBMESH_DIM > 1 ? p(1) : 0;
331 const Real & z = LIBMESH_DIM > 2 ? p(2) : 0;
335 { 12*x*x-12*x+2+2*z*(1-y)-2*(1-y)*(1-z), -2*x*z-(1-2*x)*(1-z)-(1-2*y)*z, 2*x*(1-y)-(1-2*x)*(1-y)-y*(1-y),
336 -2*x*z-(1-2*x)*(1-z)-(1-2*y)*z, -2*(1-x)*z, -x*x+x*(1-x)+(1-x)*(1-2*y),
337 2*x*(1-y)-(1-2*x)*(1-y)-y*(1-y), -x*x+x*(1-x)+(1-x)*(1-2*y), 12*z*z-12*z+2 };
338 else if (FE_CAN_TEST_CUBIC)
340 { 6*x-4+2*(1-y), -2*x+z-1, y-1,
341 -2*x+z-1, -2*z, x+1-2*y,
342 y-1, x+1-2*y, 6*z-4 };
347 0.0625, 0.03125, 0.5 };
358 _mesh = std::make_unique<Mesh>(*TestCommWorld);
360 const unsigned int build_ny = (_dim > 1) * build_nx;
361 const unsigned int build_nz = (_dim > 2) * build_nx;
363 unsigned char weight_index = 0;
368 _mesh->add_node_integer(
"buffer integer");
372 const Real default_weight = 1.0;
373 weight_index = cast_int<unsigned char>
374 (_mesh->add_node_datum<
Real>(
"rational_weight",
true,
376 libmesh_assert_not_equal_to(weight_index, 0);
381 _mesh->set_default_mapping_data(weight_index);
390 _mesh->add_point(
Point(0, 0), 0);
391 _mesh->add_point(
Point(1, 0), 1);
396 std::unique_ptr<Elem> polygon = std::make_unique<C0Polygon>(5);
398 polygon->set_node(i, _mesh->node_ptr(i));
399 polygon->set_id() = 0;
401 _mesh->add_elem(std::move(polygon));
402 _mesh->prepare_for_use();
413 _mesh->add_point(
Point(0, 0, 0), 0);
414 _mesh->add_point(
Point(1, 0, 0), 1);
415 _mesh->add_point(
Point(1, 1, 0), 2);
416 _mesh->add_point(
Point(0, 1, 0), 3);
417 _mesh->add_point(
Point(0, 0, 1), 4);
418 _mesh->add_point(
Point(1, 0, 1), 5);
419 _mesh->add_point(
Point(1, 1, 1), 6);
420 _mesh->add_point(
Point(0, 1, 1), 7);
423 std::vector<std::vector<unsigned int>> nodes_on_side;
424 if (_case_name ==
"Default")
425 nodes_on_side = { {0, 1, 2, 3},
431 else if (_case_name ==
"MidNode")
432 nodes_on_side = { {0, 1, 2, 3},
439 libmesh_error_msg(
"Unknown case name: " + _case_name);
442 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
446 const auto & nodes_on_s = nodes_on_side[s];
447 sides[s] = std::make_shared<C0Polygon>(nodes_on_s.size());
449 sides[s]->set_node(i, _mesh->node_ptr(nodes_on_s[i]));
452 std::unique_ptr<libMesh::Node> mid_elem_node;
453 std::unique_ptr<Elem> polyhedron = std::make_unique<C0Polyhedron>(sides, mid_elem_node);
454 _mesh->add_elem(std::move(polyhedron));
456 _mesh->add_node(std::move(mid_elem_node));
457 _mesh->prepare_for_use();
462 build_nx, build_ny, build_nz,
463 0., 1., 0., 1., 0., 1.,
471 for (
dof_id_type i = 0; i != _mesh->max_elem_id(); ++i)
473 Elem * elem = _mesh->query_elem_ptr(i);
474 if (elem && elem->
id())
475 _mesh->delete_elem(elem);
477 _mesh->prepare_for_use();
478 CPPUNIT_ASSERT_EQUAL(_mesh->n_elem(),
dof_id_type(1));
495 8*(_dim>2), 16*(_dim>2));
504 for (
auto elem : _mesh->active_element_ptr_range())
506 const unsigned int nv = elem->n_vertices();
507 const unsigned int nn = elem->n_nodes();
510 const unsigned int n_edges =
511 (elem->type() ==
EDGE3) ? 1 : elem->n_edges();
512 const unsigned int n_faces =
513 (elem->type() ==
QUAD9) ? 1 : elem->n_faces();
514 const unsigned int nve = std::min(nv + n_edges, nn);
515 const unsigned int nvef = std::min(nve + n_faces, nn);
517 for (
unsigned int i = 0; i != nv; ++i)
518 elem->node_ref(i).set_extra_datum<
Real>(weight_index, 1.);
519 for (
unsigned int i = nv; i != nve; ++i)
520 elem->node_ref(i).set_extra_datum<
Real>(weight_index,
rational_w);
522 for (
unsigned int i = nve; i != nvef; ++i)
523 elem->node_ref(i).set_extra_datum<
Real>(weight_index, w2);
525 for (
unsigned int i = nvef; i != nn; ++i)
526 elem->node_ref(i).set_extra_datum<
Real>(weight_index, w3);
530 _es = std::make_unique<EquationSystems>(*_mesh);
531 _sys = &(_es->add_system<
System> (
"SimpleSystem"));
545 else if (FE_CAN_TEST_CUBIC)
563 _fe->attach_quadrature_rule(_qrule.get());
565 auto rng = _mesh->active_local_element_ptr_range();
566 this->_elem = rng.begin() == rng.end() ? nullptr : *(rng.begin());
571 _ny = (_dim > 1) ? _nx : 1;
572 _nz = (_dim > 2) ? _nx : 1;
596 #if LIBMESH_ENABLE_SECOND_DERIVATIVES 605 _fe->get_d2phidxdy();
609 _fe->get_d2phidxdz();
610 _fe->get_d2phidydz();
622 template <Order order, FEFamily family, ElemType elem_type,
typename CaseName>
627 template <
typename Functor>
639 #ifdef LIBMESH_ENABLE_EXCEPTIONS 640 for (
unsigned int i=0; i != this->_nx; ++i)
641 for (
unsigned int j=0; j != this->_ny; ++j)
642 for (
unsigned int k=0; k != this->_nz; ++k)
646 p(1) =
Real(j)/this->_ny;
648 p(2) =
Real(k)/this->_nz;
649 if (!this->_elem->contains_point(p))
653 if (this->_elem->local_singular_node(p) !=
invalid_uint)
656 std::vector<Point> master_points
660 this->_fe->reinit(this->_elem, &master_points);
664 #endif // LIBMESH_ENABLE_EXCEPTIONS 672 this->_fe->reinit(this->_elem);
674 bool satisfies_partition_of_unity =
true;
675 for (
const auto qp :
make_range(this->_qrule->n_points()))
678 for (std::size_t d = 0; d != this->_dof_indices.size(); ++d)
679 phi_sum += this->_fe->get_phi()[d][qp];
682 satisfies_partition_of_unity =
false;
687 switch (this->_fe->get_family())
691 switch (this->_fe->get_order())
694 CPPUNIT_ASSERT(satisfies_partition_of_unity);
698 CPPUNIT_ASSERT(!satisfies_partition_of_unity);
707 switch (this->_fe->get_order())
710 CPPUNIT_ASSERT(satisfies_partition_of_unity);
714 CPPUNIT_ASSERT(!satisfies_partition_of_unity);
724 CPPUNIT_ASSERT(!satisfies_partition_of_unity);
733 CPPUNIT_ASSERT(satisfies_partition_of_unity);
738 CPPUNIT_FAIL(
"Uncovered FEFamily");
751 this->_fe->reinit(this->_elem);
753 const FEType fe_type = this->_sys->variable_type(0);
755 unsigned int my_n_dofs = 0;
757 switch (this->_elem->dim())
775 CPPUNIT_ASSERT_EQUAL(
779 CPPUNIT_ASSERT_EQUAL(
781 this->_fe->get_continuity());
783 CPPUNIT_ASSERT_EQUAL(
785 this->_fe->is_hierarchic());
792 auto f = [
this](
Point p)
797 for (std::size_t d = 0; d != this->_dof_indices.size(); ++d)
798 u += this->_fe->get_phi()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
806 else if (FE_CAN_TEST_CUBIC)
809 true_u = p(0)*p(0) + 0.5*p(1)*p(1) + 0.25*p(2)*p(2) +
810 0.125*p(0)*p(1) + 0.0625*p(0)*p(2) + 0.03125*p(1)*p(2);
812 true_u = p(0) + 0.25*p(1) + 0.0625*p(2);
814 LIBMESH_ASSERT_NUMBERS_EQUAL (true_u, u, this->_value_tol);
829 this->_fe->get_dual_phi();
832 this->_fe->reinit(this->_elem);
840 auto f = [
this](
Point p)
845 for (std::size_t d = 0; d != this->_dof_indices.size(); ++d)
846 grad_u += this->_fe->get_dphi()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
850 LIBMESH_ASSERT_NUMBERS_EQUAL
851 (grad_u(0), true_grad(0), this->_grad_tol);
853 LIBMESH_ASSERT_NUMBERS_EQUAL
854 (grad_u(1), true_grad(1), this->_grad_tol);
856 LIBMESH_ASSERT_NUMBERS_EQUAL
857 (grad_u(2), true_grad(2), this->_grad_tol);
867 auto f = [
this](
Point p)
871 Number grad_u_x = 0, grad_u_y = 0, grad_u_z = 0;
872 for (std::size_t d = 0; d != this->_dof_indices.size(); ++d)
874 grad_u_x += this->_fe->get_dphidx()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
876 grad_u_y += this->_fe->get_dphidy()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
879 grad_u_z += this->_fe->get_dphidz()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
885 LIBMESH_ASSERT_NUMBERS_EQUAL(grad_u_x,
886 true_grad(0), this->_grad_tol);
888 LIBMESH_ASSERT_NUMBERS_EQUAL
889 (grad_u_y, true_grad(1), this->_grad_tol);
891 LIBMESH_ASSERT_NUMBERS_EQUAL
892 (grad_u_z, true_grad(2), this->_grad_tol);
907 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 908 auto f = [
this](
Point p)
911 for (std::size_t d = 0; d != this->_dof_indices.size(); ++d)
912 hess_u += this->_fe->get_d2phi()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
920 LIBMESH_ASSERT_NUMBERS_EQUAL
921 (true_hess(0,0), hess_u(0,0), this->_hess_tol);
924 LIBMESH_ASSERT_NUMBERS_EQUAL
925 (hess_u(0,1), hess_u(1,0), this->_hess_tol);
926 LIBMESH_ASSERT_NUMBERS_EQUAL
927 (true_hess(0,1), hess_u(0,1), this->_hess_tol);
928 LIBMESH_ASSERT_NUMBERS_EQUAL
929 (true_hess(1,1), hess_u(1,1), this->_hess_tol);
933 LIBMESH_ASSERT_NUMBERS_EQUAL
934 (hess_u(0,2), hess_u(2,0), this->_hess_tol);
935 LIBMESH_ASSERT_NUMBERS_EQUAL
936 (hess_u(1,2), hess_u(2,1), this->_hess_tol);
937 LIBMESH_ASSERT_NUMBERS_EQUAL
938 (true_hess(0,2), hess_u(0,2), this->_hess_tol);
939 LIBMESH_ASSERT_NUMBERS_EQUAL
940 (true_hess(1,2), hess_u(1,2), this->_hess_tol);
941 LIBMESH_ASSERT_NUMBERS_EQUAL
942 (true_hess(2,2), hess_u(2,2), this->_hess_tol);
947 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES 952 #ifdef LIBMESH_ENABLE_SECOND_DERIVATIVES 959 auto f = [
this](
Point p)
961 Number hess_u_xx = 0, hess_u_xy = 0, hess_u_yy = 0,
962 hess_u_xz = 0, hess_u_yz = 0, hess_u_zz = 0;
963 for (std::size_t d = 0; d != this->_dof_indices.size(); ++d)
965 hess_u_xx += this->_fe->get_d2phidx2()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
967 hess_u_xy += this->_fe->get_d2phidxdy()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
968 hess_u_yy += this->_fe->get_d2phidy2()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
971 hess_u_xz += this->_fe->get_d2phidxdz()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
972 hess_u_yz += this->_fe->get_d2phidydz()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
973 hess_u_zz += this->_fe->get_d2phidz2()[d][0] * (*this->_sys->current_local_solution)(this->_dof_indices[d]);
983 LIBMESH_ASSERT_NUMBERS_EQUAL
984 (true_hess(0,0), hess_u_xx, this->_hess_tol);
987 LIBMESH_ASSERT_NUMBERS_EQUAL
988 (true_hess(0,1), hess_u_xy, this->_hess_tol);
989 LIBMESH_ASSERT_NUMBERS_EQUAL
990 (true_hess(1,1), hess_u_yy, this->_hess_tol);
994 LIBMESH_ASSERT_NUMBERS_EQUAL
995 (true_hess(0,2), hess_u_xz, this->_hess_tol);
996 LIBMESH_ASSERT_NUMBERS_EQUAL
997 (true_hess(1,2), hess_u_yz, this->_hess_tol);
998 LIBMESH_ASSERT_NUMBERS_EQUAL
999 (true_hess(2,2), hess_u_zz, this->_hess_tol);
1004 #endif // LIBMESH_ENABLE_SECOND_DERIVATIVES 1011 std::vector<Point> q_points;
1012 std::vector<Real> weights;
1013 q_points.resize(3); weights.resize(3);
1014 q_points[0](0) = 0.0; q_points[0](1) = 0.0; weights[0] =
Real(1)/6;
1015 q_points[1](0) = 1.0; q_points[1](1) = 0.0; weights[1] = weights[0];
1016 q_points[2](0) = 0.0; q_points[2](1) = 1.0; weights[2] = weights[0];
1018 FEType fe_type = this->_sys->variable_type(0);
1019 std::unique_ptr<FEBase> fe (
FEBase::build(this->_dim, fe_type));
1020 const int extraorder = 3;
1022 fe->attach_quadrature_rule (qrule.get());
1024 const std::vector<Point> & q_pos = fe->get_xyz();
1026 for (
const auto & elem : this->_mesh->active_local_element_ptr_range()) {
1027 fe->reinit (elem, &q_points, &weights);
1028 CPPUNIT_ASSERT_EQUAL(q_points.size(), std::size_t(3));
1029 CPPUNIT_ASSERT_EQUAL(q_pos.size(), std::size_t(3));
1036 #define INSTANTIATE_FETEST_CASE(order, family, elemtype, case_name) \ 1037 class FETest_##order##_##family##_##elemtype##_##case_name : public FETest<order, family, elemtype, case_name> { \ 1039 FETest_##order##_##family##_##elemtype##_##case_name() : \ 1040 FETest<order,family,elemtype,case_name>() { \ 1041 if (unitlog->summarized_logs_enabled()) \ 1042 this->libmesh_suite_name = "FETest"; \ 1044 this->libmesh_suite_name = "FETest_" #order "_" #family "_" #elemtype "_" #case_name; \ 1045 this->_case_name = #case_name; \ 1047 CPPUNIT_TEST_SUITE( FETest_##order##_##family##_##elemtype##_##case_name ); \ 1049 CPPUNIT_TEST_SUITE_END(); \ 1052 CPPUNIT_TEST_SUITE_REGISTRATION( FETest_##order##_##family##_##elemtype##_##case_name ); 1054 #define INSTANTIATE_FETEST(order, family, elemtype) \ 1055 INSTANTIATE_FETEST_CASE(order, family, elemtype, Default)
std::unique_ptr< EquationSystems > _es
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
std::unique_ptr< FunctionBase< Real > > clone() const override
static unsigned int n_dofs(const ElemType t, const Order o)
void testDualDoesntScreamAndDie()
std::string _case_name
Name of the case, can be used in the test to switch cases.
const unsigned int invalid_uint
A number which is used quite often to represent an invalid or uninitialized value for an unsigned int...
This class provides the ability to map between arbitrary, user-defined strings and several data types...
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
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)
Gradient quadratic_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
void resize(const unsigned int n)
Resize the vector.
static const unsigned int type_to_dim_map[INVALID_ELEM]
This array maps the integer representation of the ElemType enum to the geometric dimension of the ele...
This is the base class from which all geometric element types are derived.
Gradient rational_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
Order default_quadrature_order() const
static RealGradient true_gradient(Point p)
This class defines a vector in LIBMESH_DIM dimensional Real or Complex space.
Gradient fe_cubic_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
The libMesh namespace provides an interface to certain functionality in the library.
Gradient fe_quartic_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
Number fe_cubic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
std::vector< dof_id_type > _dof_indices
static const Real rational_w
std::unique_ptr< QBase > default_quadrature_rule(const unsigned int dim, const int extraorder=0) const
std::unique_ptr< FEBase > _fe
Number linear_test(const Point &p, const Parameters &, const std::string &, const std::string &)
Number rational_test(const Point &p, const Parameters &, const std::string &, const std::string &)
static unsigned int n_shape_functions(const unsigned int dim, const FEType &fe_t, const ElemType t)
Manages consistently variables, degrees of freedom, and coefficient vectors.
NumberVectorValue Gradient
static bool is_hierarchic(const FEType &fe_type)
Returns whether or not the input FEType's higher-order shape functions are always hierarchic...
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
static RealTensor true_hessian(Point p)
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.
Number quadratic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
void project_solution(FunctionBase< Number > *f, FunctionBase< Gradient > *g=nullptr, std::optional< ConstElemRange > active_local_range=std::nullopt, std::optional< std::vector< unsigned int >> variable_numbers=std::nullopt) const
Projects arbitrary functions onto the current solution.
static FEContinuity get_continuity(const FEType &fe_type)
Returns the input FEType's FEContinuity based on the underlying FEFamily and potentially the Order...
std::unique_ptr< Mesh > _mesh
const FEType & variable_type(const unsigned int i) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Defines a dense vector for use in Finite Element-type computations.
Number fe_quartic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
Gradient linear_test_grad(const Point &, const Parameters &, const std::string &, const std::string &)
Base class for functors that can be evaluated at a point and (optionally) time.
const DofMap & get_dof_map() const
void testPartitionOfUnity()
A Point defines a location in LIBMESH_DIM dimensional Real space.
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
std::unique_ptr< QGauss > _qrule
This class defines a tensor in LIBMESH_DIM dimensional Real or Complex space.
std::string libmesh_suite_name