17 #include <deal.II/distributed/cell_weights.h> 19 #include <deal.II/dofs/dof_accessor.h> 22 DEAL_II_NAMESPACE_OPEN
26 template <
int dim,
int spacedim>
29 : dof_handler(&dof_handler, typeid(*this).name())
45 std::placeholders::_1,
46 std::placeholders::_2));
52 "parallel::CellWeights requires a parallel::Triangulation object."));
56 template <
int dim,
int spacedim>
59 tria_listener.disconnect();
64 template <
int dim,
int spacedim>
67 const unsigned int factor)
72 ->
unsigned int {
return factor; };
76 template <
int dim,
int spacedim>
79 const unsigned int factor)
88 template <
int dim,
int spacedim>
91 const unsigned int factor)
102 template <
int dim,
int spacedim>
105 const std::function<
unsigned int(
110 weighting_function = custom_function;
115 template <
int dim,
int spacedim>
123 Assert(&(*triangulation) == &(dof_handler->get_triangulation()),
125 "Triangulation associated with the DoFHandler has changed!"));
130 *cell_, dof_handler);
140 fe_index = cell->future_fe_index();
145 std::set<unsigned int> fe_indices_children;
146 for (
unsigned int child_index = 0;
147 child_index < GeometryInfo<dim>::max_children_per_cell;
149 fe_indices_children.insert(
150 cell->child(child_index)->future_fe_index());
152 Assert(dof_handler->get_fe_collection().find_dominating_fe_extended(
153 fe_indices_children, 0) !=
156 "No FiniteElement has been found in your FECollection " 157 "that dominates all children of a cell you are trying " 168 return weighting_function(dof_handler->get_fe(fe_index), cell);
174 #include "cell_weights.inst" 176 DEAL_II_NAMESPACE_CLOSE
static const unsigned int invalid_unsigned_int
void register_ndofs_weighting(const unsigned int factor=1000)
SmartPointer< const parallel::Triangulation< dim, spacedim >, CellWeights > triangulation
static ::ExceptionBase & ExcMessage(std::string arg1)
CellWeights(const ::hp::DoFHandler< dim, spacedim > &dof_handler)
typename ActiveSelector::cell_iterator cell_iterator
#define Assert(cond, exc)
boost::signals2::connection tria_listener
unsigned int weight_callback(const typename Triangulation< dim, spacedim >::cell_iterator &cell, const typename Triangulation< dim, spacedim >::CellStatus status)
const unsigned int dofs_per_cell
void register_ndofs_squared_weighting(const unsigned int factor=1000)
const Triangulation< dim, spacedim > & get_triangulation() const
void register_constant_weighting(const unsigned int factor=1000)
void register_custom_weighting(const std::function< unsigned int(const FiniteElement< dim, spacedim > &, const typename hp::DoFHandler< dim, spacedim >::cell_iterator &)> custom_function)
static ::ExceptionBase & ExcInternalError()