Loading [MathJax]/extensions/TeX/newcommand.js
 deal.II version GIT relicensing-3075-gc235bd4825 2025-04-15 08:10:00+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\}}
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
cell_weights.h
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2018 - 2024 by the deal.II authors
5//
6// This file is part of the deal.II library.
7//
8// Part of the source code is dual licensed under Apache-2.0 WITH
9// LLVM-exception OR LGPL-2.1-or-later. Detailed license information
10// governing the source code and code contributions can be found in
11// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II.
12//
13// ------------------------------------------------------------------------
14
15#ifndef dealii_distributed_cell_weights_h
16#define dealii_distributed_cell_weights_h
17
18#include <deal.II/base/config.h>
19
21
23
24#include <boost/signals2/connection.hpp>
25
26
28
29namespace parallel
30{
104 template <int dim, int spacedim = dim>
106 {
107 public:
118 using WeightingFunction = std::function<
119 unsigned int(const typename DoFHandler<dim, spacedim>::cell_iterator &,
121
127 CellWeights() = default;
128
137 CellWeights(const DoFHandler<dim, spacedim> &dof_handler,
138 const WeightingFunction &weighting_function);
139
145 ~CellWeights();
146
153 void
154 reinit(const DoFHandler<dim, spacedim> &dof_handler,
155 const WeightingFunction &weighting_function);
156
165 static std::function<unsigned int(
166 const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
167 const CellStatus status)>
169 const WeightingFunction &weighting_function);
170
179 static WeightingFunction
180 constant_weighting(const unsigned int factor = 1);
181
191 static WeightingFunction
192 ndofs_weighting(const std::pair<float, float> &coefficients);
193
203 static WeightingFunction
204 ndofs_weighting(const std::vector<std::pair<float, float>> &coefficients);
205
210 private:
215 boost::signals2::connection connection;
216
224 static unsigned int
226 const typename ::Triangulation<dim, spacedim>::cell_iterator &cell,
227 const CellStatus status,
228 const DoFHandler<dim, spacedim> &dof_handler,
230 const WeightingFunction &weighting_function);
231 };
232} // namespace parallel
233
234
236
237#endif
CellStatus
Definition cell_status.h:31
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
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:35
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:36
typename ActiveSelector::cell_iterator cell_iterator
const ::parallel::distributed::Triangulation< dim, spacedim > * triangulation