Reference documentation for deal.II version GIT f8d87ffe95 2022-08-04 17:30:02+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\}}\)
evaluation_template_factory_internal.h
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
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 
29 namespace 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
49  // slow path
50  return EvaluatorType::template run<-1, 0>(args...);
51  }
52  else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
54  (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
55  EvaluatorType>(given_degree, n_q_points_1d, args...);
56  else
57  // slow path
58  return EvaluatorType::template run<-1, 0>(args...);
59  }
60 
61  template <int degree, typename EvaluatorType, typename... Args>
62  bool
63  instantiation_helper_degree_run(const unsigned int given_degree,
64  Args &...args)
65  {
66  if (given_degree == degree)
67  {
68  return EvaluatorType::template run<degree, degree + 1>(args...);
69  }
70  else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
72  (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
73  EvaluatorType>(given_degree, args...);
74  else
75  // slow path
76  return EvaluatorType::template run<-1, 0>(args...);
77  }
78 
79 } // end of namespace internal
80 
82 
83 #endif
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:442
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:443
#define FE_EVAL_FACTORY_DEGREE_MAX
void run(const Iterator &begin, const typename identity< Iterator >::type &end, Worker worker, Copier copier, const ScratchData &sample_scratch_data, const CopyData &sample_copy_data, const unsigned int queue_length, const unsigned int chunk_size)
Definition: work_stream.h:474
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)