deal.II version GIT relicensing-6834-g5b78e6bcdf 2026-10-01 11:20: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\}}\)
Loading...
Searching...
No Matches
cell_weights.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception OR LGPL-2.1-or-later
4// Copyright (C) 2018 - 2026 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Detailed license information governing the source code and contributions
9// can be found in LICENSE.md and CONTRIBUTING.md at the top level directory.
10//
11// -----------------------------------------------------------------------------
12
13#ifndef dealii_distributed_cell_weights_h
14#define dealii_distributed_cell_weights_h
15
16#include <deal.II/base/config.h>
17
19
21
22#include <deal.II/fe/fe.h>
23
25#include <deal.II/grid/tria.h>
26
27#include <boost/signals2/connection.hpp>
28
29#include <functional>
30#include <vector>
31
32
34
35namespace parallel
36{
121 template <int dim, int spacedim = dim>
123 {
124 public:
135 using WeightingFunction = std::function<
136 unsigned int(const typename DoFHandler<dim, spacedim>::cell_iterator &,
138
150 static WeightingFunction
151 constant_weighting(const unsigned int factor = 1);
152
165 static WeightingFunction
166 ndofs_weighting(const std::pair<float, float> &coefficients);
167
180 static WeightingFunction
181 ndofs_weighting(const std::vector<std::pair<float, float>> &coefficients);
182
193 static std::vector<unsigned int>
195 const WeightingFunction &weighting_function);
196
206 CellWeights() = default;
207
216 CellWeights(const DoFHandler<dim, spacedim> &dof_handler,
217 const WeightingFunction &weighting_function);
218
229 CellWeights(const DoFHandler<dim, spacedim> &dof_handler,
230 const std::vector<unsigned int> &precomputed_weights);
231
237 ~CellWeights();
238
245 void
246 reinit(const DoFHandler<dim, spacedim> &dof_handler,
247 const WeightingFunction &weighting_function);
248
258 void
259 reinit(const DoFHandler<dim, spacedim> &dof_handler,
260 const std::vector<unsigned int> &precomputed_weights);
261
270 static std::function<unsigned int(
271 const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
272 const CellStatus status)>
274 const WeightingFunction &weighting_function);
275
284 static std::function<unsigned int(
285 const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
286 const CellStatus status)>
288 const DoFHandler<dim, spacedim> &dof_handler,
289 const std::vector<unsigned int> &precomputed_weights);
290
291 private:
296 boost::signals2::connection connection;
297
305 static unsigned int
307 const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
308 const CellStatus status,
309 const DoFHandler<dim, spacedim> &dof_handler,
311 const WeightingFunction &weighting_function);
312
320 static unsigned int
322 const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
323 const CellStatus status,
324 const DoFHandler<dim, spacedim> &dof_handler,
326 const std::vector<unsigned int> &precomputed_weights);
327 };
328} // namespace parallel
329
330
332
333#endif
CellStatus
Definition cell_status.h:29
static unsigned int weighting_callback(const typename ::Triangulation< dim, spacedim >::cell_iterator &cell, const CellStatus status, const DoFHandler< dim, spacedim > &dof_handler, const parallel::TriangulationBase< dim, spacedim > &triangulation, const WeightingFunction &weighting_function)
static WeightingFunction constant_weighting(const unsigned int factor=1)
std::function< unsigned int(const typename DoFHandler< dim, spacedim >::cell_iterator &, const FiniteElement< dim, spacedim > &)> WeightingFunction
static WeightingFunction ndofs_weighting(const std::pair< float, float > &coefficients)
void reinit(const DoFHandler< dim, spacedim > &dof_handler, const WeightingFunction &weighting_function)
static std::function< unsigned int(const typename ::Triangulation< dim, spacedim >::cell_iterator &cell, const CellStatus status)> make_weighting_callback(const DoFHandler< dim, spacedim > &dof_handler, const WeightingFunction &weighting_function)
boost::signals2::connection connection
static std::vector< unsigned int > precompute_weights(const hp::FECollection< dim, spacedim > &fe_collection, const WeightingFunction &weighting_function)
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
typename ActiveSelector::cell_iterator cell_iterator