2702{
2703 LOG_SCOPE ("project_interiors","GenericProjector");
2704
2706
2707
2708 for (const auto & elem : range)
2709 {
2710 unsigned char dim = cast_int<unsigned char>(elem->dim());
2711
2713
2714
2715
2717 {
2719
2720 if (!variable.active_on_subdomain(elem->subdomain_id()))
2721 continue;
2722
2723 const FEType & base_fe_type = variable.
type();
2724
2725 if (base_fe_type.family ==
SCALAR)
2726 continue;
2727
2728 FEGenericBase<typename FFunctor::RealType> * fe = nullptr;
2730
2731 FEType fe_type = base_fe_type;
2732 const bool add_p_level = fe_type.p_refinement;
2733
2734
2735 fe_type.order = fe_type.order + add_p_level * elem->p_level();
2736
2737 const unsigned int var_component =
2739
2740
2741
2742
2744 {
2745 if (fe_type.order > 1)
2746 {
2747 const unsigned int first_interior_node =
2748 (elem->n_vertices() +
2749 ((elem->dim() > 2) * elem->n_edges()) +
2750 ((elem->dim() > 1) * elem->n_sides()));
2751 const unsigned int n_nodes = elem->n_nodes();
2752
2753
2754 for (
unsigned int n = first_interior_node; n <
n_nodes; ++n)
2755 {
2756 const Node & interior_node = elem->node_ref(n);
2757
2758 FValue fval =
f.eval_at_point
2759 (
context, var_component, interior_node,
2762 interior_node.processor_id();
2763
2765 {
2766
2767 for (unsigned int i = 0; i < elem->dim(); ++i)
2768 {
2769 const dof_id_type dof_id = interior_node.dof_number(sys_num, var, i);
2770
2771
2772
2773 const auto insert_val =
2774 raw_value<typename ProjectionAction::InsertInput>(fval, i);
2775
2777 }
2778 }
2779 else
2780 {
2782 interior_node.dof_number(sys_num, var, 0);
2784 }
2785 }
2786 }
2787 continue;
2788 }
2789
2790#ifdef LIBMESH_ENABLE_AMR
2792 {
2793 std::vector<Point> fine_points;
2794
2795 std::unique_ptr<FEGenericBase<typename FFunctor::RealType>> fine_fe
2797
2798 std::unique_ptr<QBase> qrule
2799 (base_fe_type.default_quadrature_rule(
dim));
2800 fine_fe->attach_quadrature_rule(qrule.get());
2801
2802 const std::vector<Point> & child_xyz =
2803 fine_fe->get_xyz();
2804
2805 for (auto & child : elem->child_ref_range())
2806 {
2807 fine_fe->reinit(&child);
2808 fine_points.insert(fine_points.end(),
2809 child_xyz.begin(),
2810 child_xyz.end());
2811 }
2812
2813 std::vector<Point> fine_qp;
2815
2817 }
2818 else
2819#endif
2821
2822 const std::vector<dof_id_type> & dof_indices =
2824
2825 const unsigned int n_dofs =
2826 cast_int<unsigned int>(dof_indices.size());
2827
2828 std::vector<unsigned int> all_dofs(n_dofs);
2829 std::iota(all_dofs.begin(), all_dofs.end(), 0);
2830
2832 (dof_indices, all_dofs, var_component,
2833 nullptr, *fe);
2834 }
2835 }
2836}
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.
virtual void pre_fe_reinit(const System &, const Elem *e)
Reinitializes local data vectors/matrices on the current geometric element.
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)
const std::vector< unsigned int > & variables
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 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