357 {
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;
362
363 unsigned char weight_index = 0;
364
366 {
367
368 _mesh->add_node_integer(
"buffer integer");
369
370
371
372 const Real default_weight = 1.0;
373 weight_index = cast_int<unsigned char>
374 (
_mesh->add_node_datum<
Real>(
"rational_weight",
true,
375 &default_weight));
376 libmesh_assert_not_equal_to(weight_index, 0);
377
378
379
380
381 _mesh->set_default_mapping_data(weight_index);
382 }
383
385 {
386
387
388
389
395
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;
400
401 _mesh->add_elem(std::move(polygon));
402 _mesh->prepare_for_use();
403 }
405 {
406
407
408
409
410
411
412
421
422
423 std::vector<std::vector<unsigned int>> nodes_on_side;
425 nodes_on_side = { {0, 1, 2, 3},
426 {0, 1, 5, 4},
427 {2, 6, 5, 1},
428 {2, 3, 7, 6},
429 {0, 4, 7, 3},
430 {5, 6, 7, 4} };
432 nodes_on_side = { {0, 1, 2, 3},
433 {0, 1, 5, 4},
434 {1, 2, 6, 5},
435 {2, 3, 7, 6},
436 {3, 0, 4, 7},
437 {4, 5, 6, 7} };
438 else
439 libmesh_error_msg(
"Unknown case name: " +
_case_name);
440
441
442 std::vector<std::shared_ptr<Polygon>> sides(nodes_on_side.size());
443
445 {
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]));
450 }
451
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));
455 if (mid_elem_node)
456 _mesh->add_node(std::move(mid_elem_node));
457 _mesh->prepare_for_use();
458 }
459 else
460 {
462 build_nx, build_ny, build_nz,
463 0., 1., 0., 1., 0., 1.,
464 elem_type);
465 }
466
467
468
469
470#if 0
472 {
474 if (elem && elem->
id())
475 _mesh->delete_elem(elem);
476 }
477 _mesh->prepare_for_use();
479#endif
480
481
482
483
484
485
486
489 {
491
492
496
499 }
500
501
503 {
504 for (
auto elem :
_mesh->active_element_ptr_range())
505 {
506
508
510 const unsigned int nn = elem->
n_nodes();
511
512
513 const unsigned int n_edges =
514 (elem->
type() ==
EDGE3) ? 1 : elem->n_edges();
515 const unsigned int n_faces =
516 (elem->
type() ==
QUAD9) ? 1 : elem->n_faces();
517 const unsigned int nve = std::min(nv + n_edges, nn);
518 const unsigned int nvef = std::min(nve + n_faces, nn);
519
520 for (unsigned int i = 0; i != nv; ++i)
522 for (unsigned int i = nv; i != nve; ++i)
525 for (unsigned int i = nve; i != nvef; ++i)
528 for (unsigned int i = nvef; i != nn; ++i)
530 }
531 }
532
533 _mesh->complete_preparation();
534 _es = std::make_unique<EquationSystems>(*
_mesh);
538
540 {
542 }
543 else if (order > 3)
544 {
546 }
547
548
549 else if (FE_CAN_TEST_CUBIC)
550 {
552 }
553 else if (order > 1)
554 {
556 }
557 else
558 {
560 }
561
564
565
567 _fe->attach_quadrature_rule(
_qrule.get());
568
569 auto rng =
_mesh->active_local_element_ptr_range();
570 this->
_elem = rng.begin() == rng.end() ? nullptr : *(rng.begin());
571
573
577
579
580
581
582
583
584
586
588
589
593#if LIBMESH_DIM > 1
595#endif
596#if LIBMESH_DIM > 2
598#endif
599
600#if LIBMESH_ENABLE_SECOND_DERIVATIVES
601
602
604 return;
605
608#if LIBMESH_DIM > 1
609 _fe->get_d2phidxdy();
611#endif
612#if LIBMESH_DIM > 2
613 _fe->get_d2phidxdz();
614 _fe->get_d2phidydz();
616#endif
617
618#endif
619 }
std::string _case_name
Name of the case, can be used in the test to switch cases.
std::unique_ptr< EquationSystems > _es
std::unique_ptr< FEBase > _fe
std::unique_ptr< Mesh > _mesh
std::vector< dof_id_type > _dof_indices
std::unique_ptr< QGauss > _qrule
void dof_indices(const Elem *const elem, std::vector< dof_id_type > &di) const
void set_extra_datum(const unsigned int index, const T value)
Sets the value on this object of the extra datum associated with index, which should have been obtain...
This is the base class from which all geometric element types are derived.
virtual unsigned int n_vertices() const =0
const Node & node_ref(const unsigned int i) const
virtual unsigned int n_nodes() const =0
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...
virtual ElemType type() const =0
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
class FEType hides (possibly multiple) FEFamily and approximation orders, thereby enabling specialize...
Order default_quadrature_order() const
A Point defines a location in LIBMESH_DIM dimensional Real space.
Manages consistently variables, degrees of freedom, and coefficient vectors.
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.
const FEType & variable_type(const unsigned int i) const
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.
const DofMap & get_dof_map() const
static const Real rational_w
Number fe_cubic_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 &)
Gradient quadratic_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
Number quadratic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
Gradient fe_quartic_test_grad(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 &)
Number fe_quartic_test(const Point &p, const Parameters &, const std::string &, const std::string &)
Gradient rational_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
Gradient fe_cubic_test_grad(const Point &p, const Parameters &, const std::string &, const std::string &)
Number linear_test(const Point &p, const Parameters &, const std::string &, const std::string &)
auto index_range(const T &sizable)
Helper function that returns an IntRange<std::size_t> representing all the indices of the passed-in v...
static constexpr Real TOLERANCE
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...