Reference documentation for deal.II version Git 7439f2b0b4 2021-09-15 12:22:58 +0200
\(\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
133  reinit(const DoFHandler<dim, spacedim> &dof_handler,
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 
189  private:
194  boost::signals2::connection connection;
195 
203  static unsigned int
205  const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
206  const typename ::Triangulation<dim, spacedim>::CellStatus status,
207  const DoFHandler<dim, spacedim> & dof_handler,
209  const WeightingFunction & weighting_function);
210  };
211 } // namespace parallel
212 
213 
215 
216 #endif
boost::signals2::connection connection
Definition: cell_weights.h:194
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:401
std::function< unsigned int(const typename DoFHandler< dim, spacedim >::cell_iterator &, const FiniteElement< dim, spacedim > &)> WeightingFunction
Definition: cell_weights.h:106
static WeightingFunction ndofs_weighting(const std::pair< float, float > &coefficients)
Definition: cell_weights.cc:77
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:400
typename ActiveSelector::cell_iterator cell_iterator
Definition: dof_handler.h:466
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation
static WeightingFunction constant_weighting(const unsigned int factor=1000)
Definition: cell_weights.cc:65