2515{
2516 LOG_SCOPE ("project_sides","GenericProjector");
2517
2519
2520 for (const auto & s_pair : range)
2521 {
2522 const Elem & elem = *std::get<0>(s_pair.second);
2523
2524
2525
2526#ifdef LIBMESH_ENABLE_AMR
2527 if (
f.is_grid_projection() &&
2532 continue;
2533#endif
2534
2535 const Node & side_node = *s_pair.first;
2536 const int dim = elem.dim();
2537 const var_set & side_vars = std::get<2>(s_pair.second);
2538
2539 const unsigned int side_num = std::get<1>(s_pair.second);
2540 unsigned short node_num = elem.n_vertices()+side_num;
2541
2544 {
2545 if (!elem.is_face(n))
2546 continue;
2547
2548 if (elem.is_node_on_side(n, side_num))
2549 {
2550 node_num = n;
2551 break;
2552 }
2553 }
2554
2557
2559
2560
2561
2562 for (const auto & var : side_vars)
2563 {
2565 const FEType & base_fe_type = variable.
type();
2566 const unsigned int var_component =
2568
2569 if (base_fe_type.family ==
SCALAR)
2570 continue;
2571
2572 FEType fe_type = base_fe_type;
2573 const bool add_p_level = base_fe_type.p_refinement;
2574
2575
2576 fe_type.order = fe_type.order + add_p_level*elem.p_level();
2577
2578
2579
2580
2582 {
2583
2584
2585
2586
2587
2588 if (fe_type.order > 1 &&
2589 side_node.n_comp(sys_num, var))
2590 {
2592 side_node.processor_id();
2593 FValue fval =
f.eval_at_point
2595 false);
2596
2598 {
2599
2601 {
2602 const dof_id_type dof_id = side_node.dof_number(sys_num, var, i);
2603
2604
2605
2606 const auto insert_val =
2607 raw_value<typename ProjectionAction::InsertInput>(fval, i);
2608
2610 }
2611 }
2612 else
2613 {
2615 side_node.dof_number(sys_num, var, 0);
2617 }
2618 }
2619 continue;
2620 }
2621
2622#ifdef LIBMESH_ENABLE_AMR
2623
2624
2629 continue;
2630#endif
2631
2632
2633 FEGenericBase<typename FFunctor::RealType> * fe = nullptr;
2635 FEGenericBase<typename FFunctor::RealType> * side_fe = nullptr;
2637
2638
2639
2640 const FEGenericBase<typename FFunctor::RealType> & proj_fe =
2641#ifdef LIBMESH_ENABLE_AMR
2643 *fe :
2644#endif
2645 *side_fe;
2646
2647#ifdef LIBMESH_ENABLE_AMR
2649 {
2650 std::vector<Point> fine_points;
2651
2652 std::unique_ptr<FEGenericBase<typename FFunctor::RealType>> fine_fe
2654
2655 std::unique_ptr<QBase> qrule
2656 (base_fe_type.default_quadrature_rule(1));
2657 fine_fe->attach_quadrature_rule(qrule.get());
2658
2659 const std::vector<Point> & child_xyz =
2660 fine_fe->get_xyz();
2661
2662 for (unsigned int c = 0, nc = elem.n_children();
2663 c != nc; ++c)
2664 {
2666 continue;
2667
2669 fine_points.insert(fine_points.end(),
2670 child_xyz.begin(),
2671 child_xyz.end());
2672 }
2673
2674 std::vector<Point> fine_qp;
2676
2678 }
2679 else
2680#endif
2682
2683 const std::vector<dof_id_type> & dof_indices =
2685
2686 std::vector<unsigned int> side_dofs;
2689
2691 (dof_indices, side_dofs, var_component,
2692 &side_node, proj_fe);
2693 }
2694 }
2695}
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
static std::unique_ptr< FEGenericBase > build(const unsigned int dim, const FEType &type)
Builds a specific finite element type.
static void dofs_on_side(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int s, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with side s of element elem A...
virtual void side_fe_reinit()
Reinitializes side FE objects on the current geometric element.
void get_side_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge/face (2D/3D) finite element object for variable var for the largest dimension in th...
virtual void pre_fe_reinit(const System &, const Elem *e)
Reinitializes local data vectors/matrices on the current geometric element.
unsigned char side
Current side for side_* to examine.
virtual void elem_fe_reinit(const std::vector< Point > *const pts=nullptr)
Reinitializes interior FE objects on the current geometric element.
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh.
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)
std::set< unsigned int > var_set
unsigned int variable_scalar_number(std::string_view var, unsigned int component) const
unsigned int number() const
const FEType & type() const
void insert_id(dof_id_type id, const InsertInput &val, processor_id_type pid)
void find_dofs_to_send(const Node &node, const Elem &elem, unsigned short node_num, const var_set &vars)
void construct_projection(const std::vector< dof_id_type > &dof_indices_var, const std::vector< unsigned int > &involved_dofs, unsigned int var_component, const Node *node, const FEGenericBase< typename FFunctor::RealType > &fe)
const dof_id_type n_nodes