deal.II version GIT relicensing-2167-g9622207b8f 2024-11-21 12:40: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\}}\)
Loading...
Searching...
No Matches
mg_transfer_global_coarsening.cc
Go to the documentation of this file.
1// ------------------------------------------------------------------------
2//
3// SPDX-License-Identifier: LGPL-2.1-or-later
4// Copyright (C) 2020 - 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#include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h>
16
18
20{
21 unsigned int
23 const unsigned int previous_fe_degree,
24 const PolynomialCoarseningSequenceType &p_sequence)
25 {
26 switch (p_sequence)
27 {
29 return std::max(previous_fe_degree / 2, 1u);
31 return std::max(previous_fe_degree - 1, 1u);
33 return 1u;
34 default:
36 return 1u;
37 }
38 }
39
40
41
42 std::vector<unsigned int>
44 const unsigned int max_degree,
45 const PolynomialCoarseningSequenceType &p_sequence)
46 {
47 std::vector<unsigned int> degrees{max_degree};
48
49 while (degrees.back() > 1)
50 degrees.push_back(
51 create_next_polynomial_coarsening_degree(degrees.back(), p_sequence));
52
53 std::reverse(degrees.begin(), degrees.end());
54
55 return degrees;
56 }
57} // namespace MGTransferGlobalCoarseningTools
58
59#include "mg_transfer_global_coarsening.inst"
60
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:498
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:499
#define DEAL_II_NOT_IMPLEMENTED()
unsigned int create_next_polynomial_coarsening_degree(const unsigned int degree, const PolynomialCoarseningSequenceType &p_sequence)
std::vector< unsigned int > create_polynomial_coarsening_sequence(const unsigned int max_degree, const PolynomialCoarseningSequenceType &p_sequence)
::VectorizedArray< Number, width > max(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)