2027 LOG_SCOPE (
"project_vertices",
"GenericProjector");
2033 std::vector<unsigned short> extra_hanging_dofs;
2036 if (extra_hanging_dofs.size() <= v_num)
2037 extra_hanging_dofs.resize(v_num+1,
false);
2038 extra_hanging_dofs[v_num] =
2042 for (
const auto & v_pair : range)
2044 const Node & vertex = *v_pair.first;
2045 const Elem & elem = *std::get<0>(v_pair.second);
2046 const unsigned int n = std::get<1>(v_pair.second);
2047 const var_set & vertex_vars = std::get<2>(v_pair.second);
2055 for (
const auto & var : vertex_vars)
2058 const FEType & base_fe_type = variable.
type();
2059 const unsigned int var_component =
2062 if (base_fe_type.family ==
SCALAR)
2070 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), 0);
2072 else if (cont ==
C_ZERO ||
2078 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), 0);
2082 const FValue val =
f.eval_at_node
2084 vertex, extra_hanging_dofs[var],
system.
time);
2088 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), elem.dim());
2093 const dof_id_type id = vertex.dof_number(sys_num, var, i);
2097 const auto insert_val =
2098 raw_value<typename ProjectionAction::InsertInput>(val, i);
2100 insert_id(
id, insert_val, vertex.processor_id());
2111 const dof_id_type id = vertex.dof_number(sys_num, var, 0);
2112 insert_id(
id, val, vertex.processor_id());
2115 else if (cont ==
C_ONE)
2118 const dof_id_type first_id = vertex.dof_number(sys_num, var, 0);
2125 const int dim = elem.dim();
2135 libmesh_assert_equal_to(
dim, e.dim());
2138 #ifdef LIBMESH_ENABLE_AMR 2139 bool is_old_vertex =
true;
2142 const int i_am_child =
2145 elem.parent()->is_vertex_on_parent(i_am_child, n);
2148 const bool is_old_vertex =
false;
2152 if (base_fe_type.family ==
HERMITE)
2159 extra_hanging_dofs[var],
2161 insert_id(first_id, val, vertex.processor_id());
2163 typename GFunctor::FunctorValue grad =
2169 extra_hanging_dofs[var],
2178 vertex.processor_id());
2180 if (
dim > 1 && is_old_vertex &&
f.is_grid_projection())
2182 for (
int i = 1; i <
dim; ++i)
2184 vertex.processor_id());
2187 std::vector<FValue> derivs;
2188 f.eval_mixed_derivatives
2189 (
context, var_component,
dim, vertex, derivs);
2192 vertex.processor_id());
2202 Point nxminus = elem.point(n),
2203 nxplus = elem.point(n);
2204 nxminus(0) -= delta_x;
2205 nxplus(0) += delta_x;
2206 typename GFunctor::FunctorValue gxminus =
2212 typename GFunctor::FunctorValue gxplus =
2220 vertex.processor_id());
2223 (grad_component(gxplus, 1) - grad_component(gxminus, 1)) / 2. / delta_x,
2224 vertex.processor_id());
2231 vertex.processor_id());
2234 (grad_component(gxplus, 2) - grad_component(gxminus, 2)) / 2. / delta_x,
2235 vertex.processor_id());
2238 Point nyminus = elem.point(n),
2239 nyplus = elem.point(n);
2240 nyminus(1) -= delta_x;
2241 nyplus(1) += delta_x;
2242 typename GFunctor::FunctorValue gyminus =
2248 typename GFunctor::FunctorValue gyplus =
2256 (grad_component(gyplus, 2) - grad_component(gyminus, 2)) / 2. / delta_x,
2257 vertex.processor_id());
2259 Point nxmym = elem.point(n),
2260 nxmyp = elem.point(n),
2261 nxpym = elem.point(n),
2262 nxpyp = elem.point(n);
2263 nxmym(0) -= delta_x;
2264 nxmym(1) -= delta_x;
2265 nxmyp(0) -= delta_x;
2266 nxmyp(1) += delta_x;
2267 nxpym(0) += delta_x;
2268 nxpym(1) -= delta_x;
2269 nxpyp(0) += delta_x;
2270 nxpyp(1) += delta_x;
2271 typename GFunctor::FunctorValue gxmym =
2277 typename GFunctor::FunctorValue gxmyp =
2283 typename GFunctor::FunctorValue gxpym =
2289 typename GFunctor::FunctorValue gxpyp =
2295 FValue gxzplus = (grad_component(gxpyp, 2) - grad_component(gxmyp, 2))
2297 FValue gxzminus = (grad_component(gxpym, 2) - grad_component(gxmym, 2))
2301 (gxzplus - gxzminus) / 2. / delta_x,
2302 vertex.processor_id());
2304 #endif // LIBMESH_DIM > 2 2306 #endif // LIBMESH_DIM > 1 2313 libmesh_assert_equal_to(
2317 elem.get_node_index(&vertex),
2318 base_fe_type.p_refinement),
2319 (
unsigned int)(1 +
dim));
2323 vertex, extra_hanging_dofs[var],
2325 insert_id(first_id, val, vertex.processor_id());
2326 typename GFunctor::FunctorValue grad =
2329 vertex, extra_hanging_dofs[var],
2331 g->eval_at_point(
context, var_component, vertex,
2333 for (
int i=0; i!=
dim; ++i)
2334 insert_id(first_id + i + 1, grad.slice(i),
2335 vertex.processor_id());
2339 libmesh_error_msg(
"Unknown continuity " << cont);
Real time
For time-dependent problems, this is the time t at the beginning of the current timestep.
const Elem * parent() const
unsigned int variable_scalar_number(std::string_view var, unsigned int component) const
const Variable & variable(unsigned int var) const
Return a constant reference to Variable var.
virtual void pre_fe_reinit(const System &, const Elem *e)
Reinitializes local data vectors/matrices on the current geometric element.
NodesToElemMap * nodes_to_elem
static constexpr Real TOLERANCE
const MeshBase & get_mesh() const
void insert_id(dof_id_type id, const InsertInput &val, processor_id_type pid)
std::unique_ptr< GFunctor > g
unsigned int number() const
static bool extra_hanging_dofs(const FEType &fe_t)
std::vector< FEFieldType > field_types
const std::vector< unsigned int > & variables
unsigned int which_child_am_i(const Elem *e) const
static unsigned int n_dofs_at_node(const unsigned int dim, const FEType &fe_t, const ElemType t, const unsigned int n)
void find_dofs_to_send(const Node &node, const Elem &elem, unsigned short node_num, const var_set &vars)
GenericProjector & projector
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEContinuity
defines an enum for finite element types to libmesh_assert a certain level (or type? Hcurl?) of continuity.
virtual const Elem & elem_ref(const dof_id_type i) const
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...
std::set< unsigned int > var_set
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::vector< FEContinuity > conts
const FEType & type() const
FEFieldType
defines an enum for finite element field types - i.e.