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
evaluation_template_factory_internal.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) 2021 - 2023 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
14#ifndef dealii_matrix_free_evaluation_template_factory_internal_h
15#define dealii_matrix_free_evaluation_template_factory_internal_h
16
17
18#include <deal.II/base/config.h>
19
20#ifndef FE_EVAL_FACTORY_DEGREE_MAX
21# define FE_EVAL_FACTORY_DEGREE_MAX 6
22#endif
23
25
26namespace internal
27{
34 {
35 template <int fe_degree, int n_q_points_1d>
36 static bool
38 {
39 return fe_degree != -1;
40 }
41 };
42
43 template <int degree, typename EvaluatorType, typename... Args>
44 bool
45 instantiation_helper_run(const unsigned int given_degree,
46 const unsigned int n_q_points_1d,
47 Args &...args)
48 {
49 if (given_degree == degree)
50 {
51 if (n_q_points_1d == degree + 1)
52 return EvaluatorType::template run<degree, degree + 1>(args...);
53 else if (n_q_points_1d == degree + 2)
54 return EvaluatorType::template run<degree, degree + 2>(args...);
55 else if (n_q_points_1d == degree)
56 return EvaluatorType::template run<degree, degree>(args...);
57 else if (n_q_points_1d == (3 * degree) / 2 + 1)
58 return EvaluatorType::template run<degree, (3 * degree) / 2 + 1>(
59 args...);
60 else if ((n_q_points_1d == (2 * degree)) && (degree <= 4))
61 return EvaluatorType::template run<degree, (2 * degree)>(args...);
62 else
63 // slow path
64 return EvaluatorType::template run<-1, 0>(args...);
65 }
66 else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
68 (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
69 EvaluatorType>(given_degree, n_q_points_1d, args...);
70 else
71 // slow path
72 return EvaluatorType::template run<-1, 0>(args...);
73 }
74
75 template <int degree, typename EvaluatorType, typename... Args>
76 bool
77 instantiation_helper_degree_run(const unsigned int given_degree,
78 Args &...args)
79 {
80 if (given_degree == degree)
81 {
82 return EvaluatorType::template run<degree>(args...);
83 }
84 else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
86 (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
87 EvaluatorType>(given_degree, args...);
88 else
89 // slow path
90 return EvaluatorType::template run<-1>(args...);
91 }
92
93} // end of namespace internal
94
96
97#endif
#define DEAL_II_NAMESPACE_OPEN
Definition config.h:38
#define DEAL_II_NAMESPACE_CLOSE
Definition config.h:39
#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)