Reference documentation for deal.II version GIT 276cfaa7ee 2022-08-16 14:00:01+00:00
\(\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 - 2022 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 {
99  template <int dim, int spacedim = dim>
101  {
102  public:
113  using WeightingFunction = std::function<
114  unsigned int(const typename DoFHandler<dim, spacedim>::cell_iterator &,
116 
125  CellWeights(const ::DoFHandler<dim, spacedim> &dof_handler,
126  const WeightingFunction & weighting_function);
127 
133  ~CellWeights();
134 
141  void
142  reinit(const DoFHandler<dim, spacedim> &dof_handler,
143  const WeightingFunction & weighting_function);
144 
153  static std::function<unsigned int(
154  const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
155  const typename ::Triangulation<dim, spacedim>::CellStatus status)>
157  const WeightingFunction &weighting_function);
158 
167  static WeightingFunction
168  constant_weighting(const unsigned int factor = 1);
169 
179  static WeightingFunction
180  ndofs_weighting(const std::pair<float, float> &coefficients);
181 
191  static WeightingFunction
192  ndofs_weighting(const std::vector<std::pair<float, float>> &coefficients);
193 
198  private:
203  boost::signals2::connection connection;
204 
212  static unsigned int
214  const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
215  const typename ::Triangulation<dim, spacedim>::CellStatus status,
216  const DoFHandler<dim, spacedim> & dof_handler,
218  const WeightingFunction & weighting_function);
219  };
220 } // namespace parallel
221 
222 
224 
225 #endif
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)
static WeightingFunction constant_weighting(const unsigned int factor=1)
Definition: cell_weights.cc:65
std::function< unsigned int(const typename DoFHandler< dim, spacedim >::cell_iterator &, const FiniteElement< dim, spacedim > &)> WeightingFunction
Definition: cell_weights.h:115
static WeightingFunction ndofs_weighting(const std::pair< float, float > &coefficients)
Definition: cell_weights.cc:77
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
boost::signals2::connection connection
Definition: cell_weights.h:203
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation