Reference documentation for deal.II version 9.3.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
cell_weights.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2018 - 2021 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_distributed_cell_weights_h
17 #define dealii_distributed_cell_weights_h
18 
19 #include <deal.II/base/config.h>
20 
22 
24 
25 
27 
28 namespace parallel
29 {
90  template <int dim, int spacedim = dim>
92  {
93  public:
104  using WeightingFunction = std::function<
105  unsigned int(const typename DoFHandler<dim, spacedim>::cell_iterator &,
107 
116  CellWeights(const ::DoFHandler<dim, spacedim> &dof_handler,
117  const WeightingFunction & weighting_function);
118 
124  ~CellWeights();
125 
132  void
134  const WeightingFunction & weighting_function);
135 
144  static std::function<unsigned int(
145  const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
146  const typename ::Triangulation<dim, spacedim>::CellStatus status)>
148  const WeightingFunction &weighting_function);
149 
158  static WeightingFunction
159  constant_weighting(const unsigned int factor = 1000);
160 
170  static WeightingFunction
171  ndofs_weighting(const std::pair<float, float> &coefficients);
172 
182  static WeightingFunction
183  ndofs_weighting(const std::vector<std::pair<float, float>> &coefficients);
184 
201  CellWeights(const ::DoFHandler<dim, spacedim> &dof_handler);
202 
208  DEAL_II_DEPRECATED void
209  register_constant_weighting(const unsigned int factor = 1000);
210 
217  DEAL_II_DEPRECATED void
218  register_ndofs_weighting(const unsigned int factor = 1000);
219 
226  DEAL_II_DEPRECATED void
227  register_ndofs_squared_weighting(const unsigned int factor = 1000);
228 
241  DEAL_II_DEPRECATED void
243  const std::function<
244  unsigned int(const FiniteElement<dim, spacedim> &,
246  custom_function);
247 
252  private:
264 
275 
284  boost::signals2::connection connection;
285 
293  static unsigned int
295  const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
296  const typename ::Triangulation<dim, spacedim>::CellStatus status,
299  const WeightingFunction & weighting_function);
300  };
301 } // namespace parallel
302 
303 
305 
306 #endif
boost::signals2::connection connection
Definition: cell_weights.h:284
void register_ndofs_weighting(const unsigned int factor=1000)
CellWeights(const ::DoFHandler< dim, spacedim > &dof_handler, const WeightingFunction &weighting_function)
Definition: cell_weights.cc:28
void reinit(const DoFHandler< dim, spacedim > &dof_handler, const WeightingFunction &weighting_function)
Definition: cell_weights.cc:47
static unsigned int weighting_callback(const typename ::Triangulation< dim, spacedim >::cell_iterator &cell, const typename ::Triangulation< dim, spacedim >::CellStatus status, const DoFHandler< dim, spacedim > &dof_handler, const parallel::TriangulationBase< dim, spacedim > &triangulation, const WeightingFunction &weighting_function)
static std::function< unsigned int(const typename ::Triangulation< dim, spacedim >::cell_iterator &cell, const typename ::Triangulation< dim, spacedim >::CellStatus status)> make_weighting_callback(const DoFHandler< dim, spacedim > &dof_handler, const WeightingFunction &weighting_function)
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:395
std::function< unsigned int(const typename DoFHandler< dim, spacedim >::cell_iterator &, const FiniteElement< dim, spacedim > &)> WeightingFunction
Definition: cell_weights.h:106
void register_ndofs_squared_weighting(const unsigned int factor=1000)
static WeightingFunction ndofs_weighting(const std::pair< float, float > &coefficients)
Definition: cell_weights.cc:77
SmartPointer< const parallel::TriangulationBase< dim, spacedim >, CellWeights > triangulation
Definition: cell_weights.h:274
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:394
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:466
void register_constant_weighting(const unsigned int factor=1000)
#define DEAL_II_DEPRECATED
Definition: config.h:157
SmartPointer< const ::DoFHandler< dim, spacedim >, CellWeights > dof_handler
Definition: cell_weights.h:263
static WeightingFunction constant_weighting(const unsigned int factor=1000)
Definition: cell_weights.cc:65
void register_custom_weighting(const std::function< unsigned int(const FiniteElement< dim, spacedim > &, const typename DoFHandler< dim, spacedim >::cell_iterator &)> custom_function)