Reference documentation for deal.II version 9.5.0
\(\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
evaluation_template_factory_internal.h
Go to the documentation of this file.
1// ---------------------------------------------------------------------
2//
3// Copyright (C) 2020 - 2022 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
17#ifndef dealii_matrix_free_evaluation_template_factory_internal_h
18#define dealii_matrix_free_evaluation_template_factory_internal_h
19
20
21#include <deal.II/base/config.h>
22
23#ifndef FE_EVAL_FACTORY_DEGREE_MAX
24# define FE_EVAL_FACTORY_DEGREE_MAX 6
25#endif
26
28
29namespace internal
30{
31 template <int degree, typename EvaluatorType, typename... Args>
32 bool
33 instantiation_helper_run(const unsigned int given_degree,
34 const unsigned int n_q_points_1d,
35 Args &...args)
36 {
37 if (given_degree == degree)
38 {
39 if (n_q_points_1d == degree + 1)
40 return EvaluatorType::template run<degree, degree + 1>(args...);
41 else if (n_q_points_1d == degree + 2)
42 return EvaluatorType::template run<degree, degree + 2>(args...);
43 else if (n_q_points_1d == degree)
44 return EvaluatorType::template run<degree, degree>(args...);
45 else if (n_q_points_1d == (3 * degree) / 2 + 1)
46 return EvaluatorType::template run<degree, (3 * degree) / 2 + 1>(
47 args...);
48 else if ((n_q_points_1d == (2 * degree)) && (degree <= 4))
49 return EvaluatorType::template run<degree, (2 * degree)>(args...);
50 else
51 // slow path
52 return EvaluatorType::template run<-1, 0>(args...);
53 }
54 else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
56 (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
57 EvaluatorType>(given_degree, n_q_points_1d, args...);
58 else
59 // slow path
60 return EvaluatorType::template run<-1, 0>(args...);
61 }
62
63 template <int degree, typename EvaluatorType, typename... Args>
64 bool
65 instantiation_helper_degree_run(const unsigned int given_degree,
66 Args &...args)
67 {
68 if (given_degree == degree)
69 {
70 return EvaluatorType::template run<degree, degree + 1>(args...);
71 }
72 else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
74 (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
75 EvaluatorType>(given_degree, args...);
76 else
77 // slow path
78 return EvaluatorType::template run<-1, 0>(args...);
79 }
80
81} // end of namespace internal
82
84
85#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:472
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:473
#define FE_EVAL_FACTORY_DEGREE_MAX
bool instantiation_helper_degree_run(const unsigned int given_degree, Args &...args)
bool instantiation_helper_run(const unsigned int given_degree, const unsigned int n_q_points_1d, Args &...args)