2004 LOG_SCOPE (
"project_vertices",
"GenericProjector");
2010 std::vector<unsigned short> extra_hanging_dofs;
2013 if (extra_hanging_dofs.size() <= v_num)
2014 extra_hanging_dofs.resize(v_num+1,
false);
2015 extra_hanging_dofs[v_num] =
2019 for (
const auto & v_pair : range)
2021 const Node & vertex = *v_pair.first;
2022 const Elem & elem = *std::get<0>(v_pair.second);
2023 const unsigned int n = std::get<1>(v_pair.second);
2024 const var_set & vertex_vars = std::get<2>(v_pair.second);
2032 for (
const auto & var : vertex_vars)
2035 const FEType & base_fe_type = variable.
type();
2036 const unsigned int var_component =
2039 if (base_fe_type.family ==
SCALAR)
2047 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), 0);
2049 else if (cont ==
C_ZERO ||
2055 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), 0);
2059 const FValue val =
f.eval_at_node
2061 vertex, extra_hanging_dofs[var],
system.
time);
2065 libmesh_assert_equal_to(vertex.n_comp(sys_num, var), elem.dim());
2070 const dof_id_type id = vertex.dof_number(sys_num, var, i);
2074 const auto insert_val =
2075 raw_value<typename ProjectionAction::InsertInput>(val, i);
2077 insert_id(
id, insert_val, vertex.processor_id());
2088 const dof_id_type id = vertex.dof_number(sys_num, var, 0);
2089 insert_id(
id, val, vertex.processor_id());
2092 else if (cont ==
C_ONE)
2095 const dof_id_type first_id = vertex.dof_number(sys_num, var, 0);
2102 const int dim = elem.dim();
2112 libmesh_assert_equal_to(
dim, e.dim());
2115 #ifdef LIBMESH_ENABLE_AMR 2116 bool is_old_vertex =
true;
2119 const int i_am_child =
2122 elem.parent()->is_vertex_on_parent(i_am_child, n);
2125 const bool is_old_vertex =
false;
2129 if (base_fe_type.family ==
HERMITE)
2136 extra_hanging_dofs[var],
2138 insert_id(first_id, val, vertex.processor_id());
2140 typename GFunctor::FunctorValue grad =
2146 extra_hanging_dofs[var],
2155 vertex.processor_id());
2157 if (
dim > 1 && is_old_vertex &&
f.is_grid_projection())
2159 for (
int i = 1; i <
dim; ++i)
2161 vertex.processor_id());
2164 std::vector<FValue> derivs;
2165 f.eval_mixed_derivatives
2166 (
context, var_component,
dim, vertex, derivs);
2169 vertex.processor_id());
2179 Point nxminus = elem.point(n),
2180 nxplus = elem.point(n);
2181 nxminus(0) -= delta_x;
2182 nxplus(0) += delta_x;
2183 typename GFunctor::FunctorValue gxminus =
2189 typename GFunctor::FunctorValue gxplus =
2197 vertex.processor_id());
2200 (grad_component(gxplus, 1) - grad_component(gxminus, 1)) / 2. / delta_x,
2201 vertex.processor_id());
2208 vertex.processor_id());
2211 (grad_component(gxplus, 2) - grad_component(gxminus, 2)) / 2. / delta_x,
2212 vertex.processor_id());
2215 Point nyminus = elem.point(n),
2216 nyplus = elem.point(n);
2217 nyminus(1) -= delta_x;
2218 nyplus(1) += delta_x;
2219 typename GFunctor::FunctorValue gyminus =
2225 typename GFunctor::FunctorValue gyplus =
2233 (grad_component(gyplus, 2) - grad_component(gyminus, 2)) / 2. / delta_x,
2234 vertex.processor_id());
2236 Point nxmym = elem.point(n),
2237 nxmyp = elem.point(n),
2238 nxpym = elem.point(n),
2239 nxpyp = elem.point(n);
2240 nxmym(0) -= delta_x;
2241 nxmym(1) -= delta_x;
2242 nxmyp(0) -= delta_x;
2243 nxmyp(1) += delta_x;
2244 nxpym(0) += delta_x;
2245 nxpym(1) -= delta_x;
2246 nxpyp(0) += delta_x;
2247 nxpyp(1) += delta_x;
2248 typename GFunctor::FunctorValue gxmym =
2254 typename GFunctor::FunctorValue gxmyp =
2260 typename GFunctor::FunctorValue gxpym =
2266 typename GFunctor::FunctorValue gxpyp =
2272 FValue gxzplus = (grad_component(gxpyp, 2) - grad_component(gxmyp, 2))
2274 FValue gxzminus = (grad_component(gxpym, 2) - grad_component(gxmym, 2))
2278 (gxzplus - gxzminus) / 2. / delta_x,
2279 vertex.processor_id());
2281 #endif // LIBMESH_DIM > 2 2283 #endif // LIBMESH_DIM > 1 2290 libmesh_assert_equal_to(
2294 elem.get_node_index(&vertex),
2297 (
unsigned int)(1 +
dim));
2301 vertex, extra_hanging_dofs[var],
2303 insert_id(first_id, val, vertex.processor_id());
2304 typename GFunctor::FunctorValue grad =
2307 vertex, extra_hanging_dofs[var],
2309 g->eval_at_point(
context, var_component, vertex,
2311 for (
int i=0; i!=
dim; ++i)
2312 insert_id(first_id + i + 1, grad.slice(i),
2313 vertex.processor_id());
2317 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.
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
std::unordered_map< dof_id_type, std::vector< dof_id_type > > * nodes_to_elem
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.