Reference documentation for deal.II version 9.4.1
Searching...
No Matches
mg_transfer_global_coarsening.cc
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2020 - 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
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#include <deal.II/multigrid/mg_transfer_global_coarsening.templates.h>
17
19
21{
22 unsigned int
24 const unsigned int previous_fe_degree,
25 const PolynomialCoarseningSequenceType &p_sequence)
26 {
27 switch (p_sequence)
28 {
30 return std::max(previous_fe_degree / 2, 1u);
32 return std::max(previous_fe_degree - 1, 1u);
34 return 1u;
35 default:
37 return 1u;
38 }
39 }
40
41
42
43 std::vector<unsigned int>
45 const unsigned int max_degree,
46 const PolynomialCoarseningSequenceType &p_sequence)
47 {
48 std::vector<unsigned int> degrees{max_degree};
49
50 while (degrees.back() > 1)
51 degrees.push_back(
52 create_next_polynomial_coarsening_degree(degrees.back(), p_sequence));
53
54 std::reverse(degrees.begin(), degrees.end());
55
56 return degrees;
57 }
58} // namespace MGTransferGlobalCoarseningTools
59
60#include "mg_transfer_global_coarsening.inst"
61
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
static ::ExceptionBase & ExcNotImplemented()
#define Assert(cond, exc)
Definition: exceptions.h:1473
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 > &)