2349{
2350 LOG_SCOPE ("project_edges","GenericProjector");
2351
2353
2354 for (const auto & e_pair : range)
2355 {
2356 const Elem & elem = *std::get<0>(e_pair.second);
2357
2358
2359
2360#ifdef LIBMESH_ENABLE_AMR
2361 if (
f.is_grid_projection() &&
2366 continue;
2367#endif
2368
2369 const Node & edge_node = *e_pair.first;
2370 const int dim = elem.dim();
2371 const var_set & edge_vars = std::get<2>(e_pair.second);
2372
2373 const unsigned short edge_num = std::get<1>(e_pair.second);
2374 const unsigned short node_num = elem.n_vertices() + edge_num;
2377
2379
2380
2381
2382 for (const auto & var : edge_vars)
2383 {
2385 const FEType & base_fe_type = variable.
type();
2386 const unsigned int var_component =
2388
2389 if (base_fe_type.family ==
SCALAR)
2390 continue;
2391
2392 FEType fe_type = base_fe_type;
2393
2394
2395 fe_type.order = fe_type.order + elem.p_level();
2396
2397
2398
2399
2401 {
2402 if (fe_type.order > 1)
2403 {
2405 edge_node.processor_id();
2406 FValue fval =
f.eval_at_point
2408 false);
2410 {
2411
2413 {
2415 edge_node.dof_number(sys_num, var, i);
2416
2417
2418
2419 const auto insert_val =
2420 raw_value<typename ProjectionAction::InsertInput>(fval, i);
2421
2423 }
2424 }
2425 else
2426 {
2428 edge_node.dof_number(sys_num, var, 0);
2430 }
2431 }
2432 continue;
2433 }
2434
2435#ifdef LIBMESH_ENABLE_AMR
2436
2437
2442 continue;
2443#endif
2444
2445
2446 FEGenericBase<typename FFunctor::RealType> * fe = nullptr;
2448 FEGenericBase<typename FFunctor::RealType> * edge_fe = nullptr;
2450
2451
2452
2453 const FEGenericBase<typename FFunctor::RealType> & proj_fe =
2454#ifdef LIBMESH_ENABLE_AMR
2456 *fe :
2457#endif
2458 *edge_fe;
2459
2460#ifdef LIBMESH_ENABLE_AMR
2462 {
2463 std::vector<Point> fine_points;
2464
2465 std::unique_ptr<FEGenericBase<typename FFunctor::RealType>> fine_fe
2467
2468 std::unique_ptr<QBase> qrule
2469 (base_fe_type.default_quadrature_rule(1));
2470 fine_fe->attach_quadrature_rule(qrule.get());
2471
2472 const std::vector<Point> & child_xyz =
2473 fine_fe->get_xyz();
2474
2475 for (unsigned int c = 0, nc = elem.n_children();
2476 c != nc; ++c)
2477 {
2479 continue;
2480
2481 fine_fe->edge_reinit(elem.child_ptr(c),
context.
edge);
2482 fine_points.insert(fine_points.end(),
2483 child_xyz.begin(),
2484 child_xyz.end());
2485 }
2486
2487 std::vector<Point> fine_qp;
2489
2491 }
2492 else
2493#endif
2495
2496 const std::vector<dof_id_type> & dof_indices =
2498
2499 std::vector<unsigned int> edge_dofs;
2502
2504 (dof_indices, edge_dofs, var_component,
2505 &edge_node, proj_fe);
2506 }
2507 }
2508}
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_edge(const Elem *const elem, const unsigned int dim, const FEType &fe_t, unsigned int e, std::vector< unsigned int > &di, const bool add_p_level=true)
Fills the vector di with the local degree of freedom indices associated with edge e of element elem A...
unsigned char edge
Current edge for edge_* to examine.
void get_edge_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for edge (3D only!) finite element object for variable var.
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.
virtual void edge_fe_reinit()
Reinitializes edge FE objects on the current geometric element.
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)