2017 LOG_SCOPE (
"project_vertices",
"GenericProjector");
2023 std::vector<unsigned short> extra_hanging_dofs;
2026 if (extra_hanging_dofs.size() <= v_num)
2027 extra_hanging_dofs.resize(v_num+1,
false);
2028 extra_hanging_dofs[v_num] =
2032 for (
const auto & v_pair : range)
2034 const Node & vertex = *v_pair.first;
2035 const Elem & elem = *std::get<0>(v_pair.second);
2036 const unsigned int n = std::get<1>(v_pair.second);
2037 const var_set & vertex_vars = std::get<2>(v_pair.second);
2045 for (
const auto & var : vertex_vars)
2048 const FEType & base_fe_type = variable.
type();
2049 const unsigned int var_component =
2052 if (base_fe_type.family ==
SCALAR)
2060 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), 0);
2062 else if (cont ==
C_ZERO ||
2068 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), 0);
2072 const FValue val =
f.eval_at_node
2074 vertex, extra_hanging_dofs[var],
system.
time);
2078 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), elem.dim());
2083 const dof_id_type id = vertex.dof_number(sys_num, var, i);
2087 const auto insert_val =
2088 raw_value<typename ProjectionAction::InsertInput>(val, i);
2090 insert_id(
id, insert_val, vertex.processor_id());
2101 const dof_id_type id = vertex.dof_number(sys_num, var, 0);
2102 insert_id(
id, val, vertex.processor_id());
2105 else if (cont ==
C_ONE)
2108 const dof_id_type first_id = vertex.dof_number(sys_num, var, 0);
2115 const int dim = elem.dim();
2125 libmesh_assert_equal_to(
dim, e.dim());
2128 #ifdef LIBMESH_ENABLE_AMR 2129 bool is_old_vertex =
true;
2132 const int i_am_child =
2135 elem.parent()->is_vertex_on_parent(i_am_child, n);
2138 const bool is_old_vertex =
false;
2142 if (base_fe_type.family ==
HERMITE)
2149 extra_hanging_dofs[var],
2151 insert_id(first_id, val, vertex.processor_id());
2153 typename GFunctor::FunctorValue grad =
2159 extra_hanging_dofs[var],
2168 vertex.processor_id());
2170 if (
dim > 1 && is_old_vertex &&
f.is_grid_projection())
2172 for (
int i = 1; i <
dim; ++i)
2174 vertex.processor_id());
2177 std::vector<FValue> derivs;
2178 f.eval_mixed_derivatives
2179 (
context, var_component,
dim, vertex, derivs);
2182 vertex.processor_id());
2192 Point nxminus = elem.point(n),
2193 nxplus = elem.point(n);
2194 nxminus(0) -= delta_x;
2195 nxplus(0) += delta_x;
2196 typename GFunctor::FunctorValue gxminus =
2202 typename GFunctor::FunctorValue gxplus =
2210 vertex.processor_id());
2213 (grad_component(gxplus, 1) - grad_component(gxminus, 1)) / 2. / delta_x,
2214 vertex.processor_id());
2221 vertex.processor_id());
2224 (grad_component(gxplus, 2) - grad_component(gxminus, 2)) / 2. / delta_x,
2225 vertex.processor_id());
2228 Point nyminus = elem.point(n),
2229 nyplus = elem.point(n);
2230 nyminus(1) -= delta_x;
2231 nyplus(1) += delta_x;
2232 typename GFunctor::FunctorValue gyminus =
2238 typename GFunctor::FunctorValue gyplus =
2246 (grad_component(gyplus, 2) - grad_component(gyminus, 2)) / 2. / delta_x,
2247 vertex.processor_id());
2249 Point nxmym = elem.point(n),
2250 nxmyp = elem.point(n),
2251 nxpym = elem.point(n),
2252 nxpyp = elem.point(n);
2253 nxmym(0) -= delta_x;
2254 nxmym(1) -= delta_x;
2255 nxmyp(0) -= delta_x;
2256 nxmyp(1) += delta_x;
2257 nxpym(0) += delta_x;
2258 nxpym(1) -= delta_x;
2259 nxpyp(0) += delta_x;
2260 nxpyp(1) += delta_x;
2261 typename GFunctor::FunctorValue gxmym =
2267 typename GFunctor::FunctorValue gxmyp =
2273 typename GFunctor::FunctorValue gxpym =
2279 typename GFunctor::FunctorValue gxpyp =
2285 FValue gxzplus = (grad_component(gxpyp, 2) - grad_component(gxmyp, 2))
2287 FValue gxzminus = (grad_component(gxpym, 2) - grad_component(gxmym, 2))
2291 (gxzplus - gxzminus) / 2. / delta_x,
2292 vertex.processor_id());
2294 #endif // LIBMESH_DIM > 2 2296 #endif // LIBMESH_DIM > 1 2303 libmesh_assert_equal_to(
2307 elem.get_node_index(&vertex),
2310 (
unsigned int)(1 +
dim));
2314 vertex, extra_hanging_dofs[var],
2316 insert_id(first_id, val, vertex.processor_id());
2317 typename GFunctor::FunctorValue grad =
2320 vertex, extra_hanging_dofs[var],
2322 g->eval_at_point(
context, var_component, vertex,
2324 for (
int i=0; i!=
dim; ++i)
2325 insert_id(first_id + i + 1, grad.slice(i),
2326 vertex.processor_id());
2330 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
void should_p_refine(unsigned int g, bool p_refine)
Describe whether the given variable group should be p-refined.
const MeshBase & get_mesh() const
void insert_id(dof_id_type id, const InsertInput &val, processor_id_type pid)
unsigned int var_group_from_var_number(unsigned int var_num) const
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
const DofMap & get_dof_map() const
void ErrorVector unsigned int
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.