hessians_quad,
scratch_data);
}
- else if (shape_info.element_type ==
- internal::MatrixFreeFunctions::tensor_general)
+ else
{
internal::FEEvaluationImpl<
internal::MatrixFreeFunctions::tensor_general,
hessians_quad,
scratch_data);
}
- else
- AssertThrow(false, ExcNotImplemented());
return false;
}
scratch_data,
sum_into_values_array);
}
- else if (shape_info.element_type ==
- internal::MatrixFreeFunctions::tensor_general)
+ else
{
internal::FEEvaluationImpl<
internal::MatrixFreeFunctions::tensor_general,
scratch_data,
sum_into_values_array);
}
- else
- AssertThrow(false, ExcNotImplemented());
return false;
}
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+#ifndef dealii_matrix_free_evaluation_template_factory_h
+#define dealii_matrix_free_evaluation_template_factory_h
+
+
+#include <deal.II/base/config.h>
+
+#include <deal.II/matrix_free/dof_info.h>
+#include <deal.II/matrix_free/evaluation_flags.h>
+#include <deal.II/matrix_free/shape_info.h>
+
+
+DEAL_II_NAMESPACE_OPEN
+
+
+template <int, typename, bool, typename>
+class FEEvaluationBaseData;
+
+
+namespace internal
+{
+ template <int dim,
+ typename Number,
+ typename VectorizedArrayType = VectorizedArray<Number>>
+ struct FEEvaluationFactory
+ {
+ static void
+ evaluate(
+ const unsigned int n_components,
+ const EvaluationFlags::EvaluationFlags evaluation_flag,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &shape_info,
+ VectorizedArrayType *values_dofs_actual,
+ VectorizedArrayType *values_quad,
+ VectorizedArrayType *gradients_quad,
+ VectorizedArrayType *hessians_quad,
+ VectorizedArrayType *scratch_data);
+
+ static void
+ integrate(
+ const unsigned int n_components,
+ const EvaluationFlags::EvaluationFlags integration_flag,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &shape_info,
+ VectorizedArrayType *values_dofs_actual,
+ VectorizedArrayType *values_quad,
+ VectorizedArrayType *gradients_quad,
+ VectorizedArrayType *scratch_data,
+ const bool sum_into_values_array);
+ };
+
+
+
+ template <int dim,
+ typename Number,
+ typename VectorizedArrayType = VectorizedArray<Number>>
+ struct FEFaceEvaluationFactory
+ {
+ static void
+ evaluate(const unsigned int n_components,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ const VectorizedArrayType * values_array,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool evaluate_values,
+ const bool evaluate_gradients,
+ const unsigned int face_no,
+ const unsigned int subface_index,
+ const unsigned int face_orientation,
+ const Table<2, unsigned int> &orientation_map);
+
+ static void
+ integrate(const unsigned int n_components,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ VectorizedArrayType * values_array,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool integrate_values,
+ const bool integrate_gradients,
+ const unsigned int face_no,
+ const unsigned int subface_index,
+ const unsigned int face_orientation,
+ const Table<2, unsigned int> &orientation_map);
+
+ template <std::size_t n_face_orientations>
+ static bool
+ gather_evaluate(
+ const unsigned int n_components,
+ const Number * src_ptr,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ const MatrixFreeFunctions::DoFInfo & dof_info,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool evaluate_values,
+ const bool evaluate_gradients,
+ const unsigned int active_fe_index,
+ const unsigned int first_selected_component,
+ const std::array<unsigned int, n_face_orientations> cells,
+ const std::array<unsigned int, n_face_orientations> face_nos,
+ const unsigned int subface_index,
+ const MatrixFreeFunctions::DoFInfo::DoFAccessIndex dof_access_index,
+ const std::array<unsigned int, n_face_orientations> face_orientations,
+ const Table<2, unsigned int> & orientation_map);
+
+ template <std::size_t n_face_orientations>
+ static bool
+ integrate_scatter(
+ const unsigned int n_components,
+ Number * dst_ptr,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ const MatrixFreeFunctions::DoFInfo & dof_info,
+ VectorizedArrayType * values_array,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool integrate_values,
+ const bool integrate_gradients,
+ const unsigned int active_fe_index,
+ const unsigned int first_selected_component,
+ const std::array<unsigned int, n_face_orientations> cells,
+ const std::array<unsigned int, n_face_orientations> face_nos,
+ const unsigned int subface_index,
+ const MatrixFreeFunctions::DoFInfo::DoFAccessIndex dof_access_index,
+ const std::array<unsigned int, n_face_orientations> face_orientations,
+ const Table<2, unsigned int> & orientation_map);
+ };
+
+
+
+ template <int dim,
+ typename Number,
+ typename VectorizedArrayType = VectorizedArray<Number>>
+ struct CellwiseInverseMassFactory
+ {
+ static void
+ apply(const unsigned int n_components,
+ const unsigned int fe_degree,
+ const FEEvaluationBaseData<dim, Number, false, VectorizedArrayType>
+ & fe_eval,
+ const VectorizedArrayType *in_array,
+ VectorizedArrayType * out_array);
+
+ static void
+ apply(const unsigned int n_components,
+ const unsigned int fe_degree,
+ const AlignedVector<VectorizedArrayType> &inverse_shape,
+ const AlignedVector<VectorizedArrayType> &inverse_coefficients,
+ const VectorizedArrayType * in_array,
+ VectorizedArrayType * out_array);
+
+ static void
+ transform_from_q_points_to_basis(
+ const unsigned int n_components,
+ const unsigned int fe_degree,
+ const AlignedVector<VectorizedArrayType> &inverse_shape,
+ const VectorizedArrayType * in_array,
+ VectorizedArrayType * out_array);
+ };
+
+} // end of namespace internal
+
+DEAL_II_NAMESPACE_CLOSE
+
+#endif
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+#ifndef dealii_matrix_free_evaluation_template_factory_templates_h
+#define dealii_matrix_free_evaluation_template_factory_templates_h
+
+
+#include <deal.II/base/config.h>
+
+#include <deal.II/matrix_free/evaluation_kernels.h>
+#include <deal.II/matrix_free/evaluation_selector.h>
+#include <deal.II/matrix_free/evaluation_template_factory.h>
+#include <deal.II/matrix_free/fe_evaluation.h>
+
+#ifndef FE_EVAL_FACTORY_DEGREE_MAX
+# define FE_EVAL_FACTORY_DEGREE_MAX 6
+#endif
+
+DEAL_II_NAMESPACE_OPEN
+
+namespace internal
+{
+ template <int degree, typename EvaluatorType, typename... Args>
+ bool
+ instantiation_helper_run(const unsigned int given_degree,
+ const unsigned int n_q_points_1d,
+ Args &... args)
+ {
+ if (given_degree == degree)
+ {
+ if (n_q_points_1d == degree + 1)
+ return EvaluatorType::template run<degree, degree + 1>(args...);
+ else if (n_q_points_1d == degree + 2)
+ return EvaluatorType::template run<degree, degree + 2>(args...);
+ else if (n_q_points_1d == degree)
+ return EvaluatorType::template run<degree, degree>(args...);
+ else
+ // slow path
+ return EvaluatorType::template run<-1, 0>(args...);
+ }
+ else if (degree < FE_EVAL_FACTORY_DEGREE_MAX)
+ return instantiation_helper_run<
+ (degree < FE_EVAL_FACTORY_DEGREE_MAX ? degree + 1 : degree),
+ EvaluatorType>(given_degree, n_q_points_1d, args...);
+ else
+ // slow path
+ return EvaluatorType::template run<-1, 0>(args...);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ FEEvaluationFactory<dim, Number, VectorizedArrayType>::evaluate(
+ const unsigned int n_components,
+ const EvaluationFlags::EvaluationFlags evaluation_flag,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &shape_info,
+ VectorizedArrayType *values_dofs_actual,
+ VectorizedArrayType *values_quad,
+ VectorizedArrayType *gradients_quad,
+ VectorizedArrayType *hessians_quad,
+ VectorizedArrayType *scratch_data)
+ {
+ instantiation_helper_run<
+ 1,
+ FEEvaluationImplEvaluateSelector<dim, VectorizedArrayType>>(
+ shape_info.data[0].fe_degree,
+ shape_info.data[0].n_q_points_1d,
+ n_components,
+ evaluation_flag,
+ shape_info,
+ values_dofs_actual,
+ values_quad,
+ gradients_quad,
+ hessians_quad,
+ scratch_data);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ FEEvaluationFactory<dim, Number, VectorizedArrayType>::integrate(
+ const unsigned int n_components,
+ const EvaluationFlags::EvaluationFlags integration_flag,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &shape_info,
+ VectorizedArrayType *values_dofs_actual,
+ VectorizedArrayType *values_quad,
+ VectorizedArrayType *gradients_quad,
+ VectorizedArrayType *scratch_data,
+ const bool sum_into_values_array)
+ {
+ instantiation_helper_run<
+ 1,
+ FEEvaluationImplIntegrateSelector<dim, VectorizedArrayType>>(
+ shape_info.data[0].fe_degree,
+ shape_info.data[0].n_q_points_1d,
+ n_components,
+ integration_flag,
+ shape_info,
+ values_dofs_actual,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ sum_into_values_array);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::evaluate(
+ const unsigned int n_components,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ const VectorizedArrayType * values_array,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool evaluate_values,
+ const bool evaluate_gradients,
+ const unsigned int face_no,
+ const unsigned int subface_index,
+ const unsigned int face_orientation,
+ const Table<2, unsigned int> &orientation_map)
+ {
+ instantiation_helper_run<
+ 1,
+ FEFaceEvaluationImplEvaluateSelector<dim, VectorizedArrayType>>(
+ data.data[0].fe_degree,
+ data.data[0].n_q_points_1d,
+ n_components,
+ data,
+ values_array,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ evaluate_values,
+ evaluate_gradients,
+ face_no,
+ subface_index,
+ face_orientation,
+ orientation_map);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::integrate(
+ const unsigned int n_components,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ VectorizedArrayType * values_array,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool integrate_values,
+ const bool integrate_gradients,
+ const unsigned int face_no,
+ const unsigned int subface_index,
+ const unsigned int face_orientation,
+ const Table<2, unsigned int> &orientation_map)
+ {
+ instantiation_helper_run<
+ 1,
+ FEFaceEvaluationImplIntegrateSelector<dim, VectorizedArrayType>>(
+ data.data[0].fe_degree,
+ data.data[0].n_q_points_1d,
+ n_components,
+ data,
+ values_array,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ integrate_values,
+ integrate_gradients,
+ face_no,
+ subface_index,
+ face_orientation,
+ orientation_map);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ template <std::size_t n_face_orientations>
+ bool
+ FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::gather_evaluate(
+ const unsigned int n_components,
+ const Number * src_ptr,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ const MatrixFreeFunctions::DoFInfo & dof_info,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool evaluate_values,
+ const bool evaluate_gradients,
+ const unsigned int active_fe_index,
+ const unsigned int first_selected_component,
+ const std::array<unsigned int, n_face_orientations> cells,
+ const std::array<unsigned int, n_face_orientations> face_nos,
+ const unsigned int subface_index,
+ const MatrixFreeFunctions::DoFInfo::DoFAccessIndex dof_access_index,
+ const std::array<unsigned int, n_face_orientations> face_orientations,
+ const Table<2, unsigned int> & orientation_map)
+ {
+ return instantiation_helper_run<
+ 1,
+ FEFaceEvaluationImplGatherEvaluateSelector<dim,
+ Number,
+ VectorizedArrayType>>(
+ data.data[0].fe_degree,
+ data.data[0].n_q_points_1d,
+ n_components,
+ src_ptr,
+ data,
+ dof_info,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ evaluate_values,
+ evaluate_gradients,
+ active_fe_index,
+ first_selected_component,
+ cells,
+ face_nos,
+ subface_index,
+ dof_access_index,
+ face_orientations,
+ orientation_map);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ template <std::size_t n_face_orientations>
+ bool
+ FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::integrate_scatter(
+ const unsigned int n_components,
+ Number * dst_ptr,
+ const MatrixFreeFunctions::ShapeInfo<VectorizedArrayType> &data,
+ const MatrixFreeFunctions::DoFInfo & dof_info,
+ VectorizedArrayType * values_array,
+ VectorizedArrayType * values_quad,
+ VectorizedArrayType * gradients_quad,
+ VectorizedArrayType * scratch_data,
+ const bool integrate_values,
+ const bool integrate_gradients,
+ const unsigned int active_fe_index,
+ const unsigned int first_selected_component,
+ const std::array<unsigned int, n_face_orientations> cells,
+ const std::array<unsigned int, n_face_orientations> face_nos,
+ const unsigned int subface_index,
+ const MatrixFreeFunctions::DoFInfo::DoFAccessIndex dof_access_index,
+ const std::array<unsigned int, n_face_orientations> face_orientations,
+ const Table<2, unsigned int> & orientation_map)
+ {
+ return instantiation_helper_run<
+ 1,
+ FEFaceEvaluationImplIntegrateScatterSelector<dim,
+ Number,
+ VectorizedArrayType>>(
+ data.data[0].fe_degree,
+ data.data[0].n_q_points_1d,
+ n_components,
+ dst_ptr,
+ data,
+ dof_info,
+ values_array,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ integrate_values,
+ integrate_gradients,
+ active_fe_index,
+ first_selected_component,
+ cells,
+ face_nos,
+ subface_index,
+ dof_access_index,
+ face_orientations,
+ orientation_map);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::apply(
+ const unsigned int n_components,
+ const unsigned int fe_degree,
+ const FEEvaluationBaseData<dim, Number, false, VectorizedArrayType>
+ & fe_eval,
+ const VectorizedArrayType *in_array,
+ VectorizedArrayType * out_array)
+ {
+ instantiation_helper_run<
+ 1,
+ CellwiseInverseMassMatrixImplBasic<dim, VectorizedArrayType>>(
+ fe_degree, fe_degree + 1, n_components, fe_eval, in_array, out_array);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::apply(
+ const unsigned int n_components,
+ const unsigned int fe_degree,
+ const AlignedVector<VectorizedArrayType> &inverse_shape,
+ const AlignedVector<VectorizedArrayType> &inverse_coefficients,
+ const VectorizedArrayType * in_array,
+ VectorizedArrayType * out_array)
+ {
+ instantiation_helper_run<
+ 1,
+ CellwiseInverseMassMatrixImplFlexible<dim, VectorizedArrayType>>(
+ fe_degree,
+ fe_degree + 1,
+ n_components,
+ inverse_shape,
+ inverse_coefficients,
+ in_array,
+ out_array);
+ }
+
+
+
+ template <int dim, typename Number, typename VectorizedArrayType>
+ void
+ CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::
+ transform_from_q_points_to_basis(
+ const unsigned int n_components,
+ const unsigned int fe_degree,
+ const AlignedVector<VectorizedArrayType> &inverse_shape,
+ const VectorizedArrayType * in_array,
+ VectorizedArrayType * out_array)
+ {
+ instantiation_helper_run<
+ 1,
+ CellwiseInverseMassMatrixImplTransformFromQPoints<dim,
+ VectorizedArrayType>>(
+ fe_degree,
+ fe_degree + 1,
+ n_components,
+ inverse_shape,
+ in_array,
+ out_array);
+ }
+
+} // end of namespace internal
+
+DEAL_II_NAMESPACE_CLOSE
+
+#endif
#include <deal.II/matrix_free/evaluation_flags.h>
#include <deal.II/matrix_free/evaluation_kernels.h>
#include <deal.II/matrix_free/evaluation_selector.h>
+#include <deal.II/matrix_free/evaluation_template_factory.h>
#include <deal.II/matrix_free/mapping_data_on_the_fly.h>
#include <deal.II/matrix_free/matrix_free.h>
#include <deal.II/matrix_free/shape_info.h>
*
* @ingroup matrixfree
*/
-template <int dim,
- typename Number,
- bool is_face = false,
- typename VectorizedArrayType = VectorizedArray<Number>>
+template <int dim, typename Number, bool is_face, typename VectorizedArrayType>
class FEEvaluationBaseData
{
static_assert(
evaluate(const VectorizedArrayType * values_array,
const EvaluationFlags::EvaluationFlags evaluation_flags)
{
- SelectEvaluator<dim, fe_degree, n_q_points_1d, VectorizedArrayType>::evaluate(
- n_components,
- evaluation_flags,
- *this->data,
- const_cast<VectorizedArrayType *>(values_array),
- this->values_quad,
- this->gradients_quad,
- this->hessians_quad,
- this->scratch_data);
+ if (fe_degree > -1)
+ SelectEvaluator<dim, fe_degree, n_q_points_1d, VectorizedArrayType>::
+ evaluate(n_components,
+ evaluation_flags,
+ *this->data,
+ const_cast<VectorizedArrayType *>(values_array),
+ this->values_quad,
+ this->gradients_quad,
+ this->hessians_quad,
+ this->scratch_data);
+ else
+ internal::FEEvaluationFactory<dim, Number, VectorizedArrayType>::evaluate(
+ n_components,
+ evaluation_flags,
+ *this->data,
+ const_cast<VectorizedArrayType *>(values_array),
+ this->values_quad,
+ this->gradients_quad,
+ this->hessians_quad,
+ this->scratch_data);
# ifdef DEBUG
if (evaluation_flags & EvaluationFlags::values)
dof_info->component_dof_indices_offset[active_fe_index]
[first_selected_component] *
VectorizedArrayType::size());
- SelectEvaluator<dim, fe_degree, n_q_points_1d, VectorizedArrayType>::
- integrate(n_components,
- integration_flag,
- *data,
- vec_values,
- values_quad,
- gradients_quad,
- scratch_data,
- true);
+ if (fe_degree > -1)
+ SelectEvaluator<dim, fe_degree, n_q_points_1d, VectorizedArrayType>::
+ integrate(n_components,
+ integration_flag,
+ *data,
+ vec_values,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ true);
+ else
+ FEEvaluationFactory<dim, Number, VectorizedArrayType>::integrate(
+ n_components,
+ integration_flag,
+ *data,
+ vec_values,
+ values_quad,
+ gradients_quad,
+ scratch_data,
+ true);
+
return true;
}
}
} // namespace internal
+
+
template <int dim,
int fe_degree,
int n_q_points_1d,
ExcMessage(
"Only EvaluationFlags::values and EvaluationFlags::gradients are supported."));
- SelectEvaluator<dim, fe_degree, n_q_points_1d, VectorizedArrayType>::
- integrate(n_components,
- integration_flag,
- *this->data,
- values_array,
- this->values_quad,
- this->gradients_quad,
- this->scratch_data,
- false);
+ if (fe_degree > -1)
+ SelectEvaluator<dim, fe_degree, n_q_points_1d, VectorizedArrayType>::
+ integrate(n_components,
+ integration_flag,
+ *this->data,
+ values_array,
+ this->values_quad,
+ this->gradients_quad,
+ this->scratch_data,
+ false);
+ else
+ internal::FEEvaluationFactory<dim, Number, VectorizedArrayType>::integrate(
+ n_components,
+ integration_flag,
+ *this->data,
+ values_array,
+ this->values_quad,
+ this->gradients_quad,
+ this->scratch_data,
+ false);
# ifdef DEBUG
this->dof_values_initialized = true;
!(evaluation_flag & EvaluationFlags::gradients))
return;
- internal::FEFaceEvaluationImplEvaluateSelector<dim, VectorizedArrayType>::
- template run<fe_degree, n_q_points_1d>(
- n_components,
- *this->data,
- values_array,
- this->begin_values(),
- this->begin_gradients(),
- this->scratch_data,
- evaluation_flag & EvaluationFlags::values,
- evaluation_flag & EvaluationFlags::gradients,
- this->face_no,
- this->subface_index,
- this->face_orientation,
- this->mapping_data->descriptor[this->active_fe_index].face_orientations);
+ if (fe_degree > -1)
+ internal::FEFaceEvaluationImplEvaluateSelector<dim, VectorizedArrayType>::
+ template run<fe_degree, n_q_points_1d>(
+ n_components,
+ *this->data,
+ values_array,
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->face_no,
+ this->subface_index,
+ this->face_orientation,
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations);
+ else
+ internal::FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::
+ evaluate(n_components,
+ *this->data,
+ values_array,
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->face_no,
+ this->subface_index,
+ this->face_orientation,
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations);
# ifdef DEBUG
if (evaluation_flag & EvaluationFlags::values)
!(evaluation_flag & EvaluationFlags::gradients))
return;
- internal::FEFaceEvaluationImplIntegrateSelector<dim, VectorizedArrayType>::
- template run<fe_degree, n_q_points_1d>(
- n_components,
- *this->data,
- values_array,
- this->begin_values(),
- this->begin_gradients(),
- this->scratch_data,
- evaluation_flag & EvaluationFlags::values,
- evaluation_flag & EvaluationFlags::gradients,
- this->face_no,
- this->subface_index,
- this->face_orientation,
- this->mapping_data->descriptor[this->active_fe_index].face_orientations);
+ if (fe_degree > -1)
+ internal::FEFaceEvaluationImplIntegrateSelector<dim, VectorizedArrayType>::
+ template run<fe_degree, n_q_points_1d>(
+ n_components,
+ *this->data,
+ values_array,
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->face_no,
+ this->subface_index,
+ this->face_orientation,
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations);
+ else
+ internal::FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::
+ integrate(n_components,
+ *this->data,
+ values_array,
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->face_no,
+ this->subface_index,
+ this->face_orientation,
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations);
}
}
else
{
- return internal::FEFaceEvaluationImplGatherEvaluateSelector<
- dim,
- Number,
- VectorizedArrayType>::
- template run<fe_degree, n_q_points_1d, 1>(
- n_components,
- internal::get_beginning<Number>(input_vector),
- *this->data,
- *this->dof_info,
- this->begin_values(),
- this->begin_gradients(),
- this->scratch_data,
- evaluation_flag & EvaluationFlags::values,
- evaluation_flag & EvaluationFlags::gradients,
- this->active_fe_index,
- this->first_selected_component,
- std::array<unsigned int, 1>{{this->cell}},
- std::array<unsigned int, 1>{{this->face_no}},
- this->subface_index,
- this->dof_access_index,
- std::array<unsigned int, 1>{{this->face_orientation}},
- this->mapping_data->descriptor[this->active_fe_index]
- .face_orientations);
+ if (fe_degree > -1)
+ return internal::FEFaceEvaluationImplGatherEvaluateSelector<
+ dim,
+ Number,
+ VectorizedArrayType>::
+ template run<fe_degree, n_q_points_1d, 1>(
+ n_components,
+ internal::get_beginning<Number>(input_vector),
+ *this->data,
+ *this->dof_info,
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->active_fe_index,
+ this->first_selected_component,
+ std::array<unsigned int, 1>{{this->cell}},
+ std::array<unsigned int, 1>{{this->face_no}},
+ this->subface_index,
+ this->dof_access_index,
+ std::array<unsigned int, 1>{{this->face_orientation}},
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations);
+ else
+ return internal::
+ FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::
+ gather_evaluate(
+ n_components,
+ internal::get_beginning<Number>(input_vector),
+ *this->data,
+ *this->dof_info,
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->active_fe_index,
+ this->first_selected_component,
+ std::array<unsigned int, 1>{{this->cell}},
+ std::array<unsigned int, 1>{{this->face_no}},
+ this->subface_index,
+ this->dof_access_index,
+ std::array<unsigned int, 1>{{this->face_orientation}},
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations);
}
};
this->is_interior_face == false) == false,
ExcNotImplemented());
- if (!internal::FEFaceEvaluationImplIntegrateScatterSelector<
- dim,
- Number,
- VectorizedArrayType>::
- template run<fe_degree, n_q_points_1d, 1>(
- n_components,
- internal::get_beginning<Number>(destination),
- *this->data,
- *this->dof_info,
- this->begin_dof_values(),
- this->begin_values(),
- this->begin_gradients(),
- this->scratch_data,
- evaluation_flag & EvaluationFlags::values,
- evaluation_flag & EvaluationFlags::gradients,
- this->active_fe_index,
- this->first_selected_component,
- std::array<unsigned int, 1>{{this->cell}},
- std::array<unsigned int, 1>{{this->face_no}},
- this->subface_index,
- this->dof_access_index,
- std::array<unsigned int, 1>{{this->face_orientation}},
- this->mapping_data->descriptor[this->active_fe_index]
- .face_orientations))
+ if (fe_degree > -1)
{
- // if we arrive here, writing into the destination vector did not succeed
- // because some of the assumptions in integrate_scatter were not
- // fulfilled (e.g. an element or degree that does not support direct
- // writing), so we must do it here
- this->distribute_local_to_global(destination);
+ if (!internal::FEFaceEvaluationImplIntegrateScatterSelector<
+ dim,
+ Number,
+ VectorizedArrayType>::
+ template run<fe_degree, n_q_points_1d, 1>(
+ n_components,
+ internal::get_beginning<Number>(destination),
+ *this->data,
+ *this->dof_info,
+ this->begin_dof_values(),
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->active_fe_index,
+ this->first_selected_component,
+ std::array<unsigned int, 1>{{this->cell}},
+ std::array<unsigned int, 1>{{this->face_no}},
+ this->subface_index,
+ this->dof_access_index,
+ std::array<unsigned int, 1>{{this->face_orientation}},
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations))
+ {
+ // if we arrive here, writing into the destination vector did not
+ // succeed because some of the assumptions in integrate_scatter were
+ // not fulfilled (e.g. an element or degree that does not support
+ // direct writing), so we must do it here
+ this->distribute_local_to_global(destination);
+ }
+ }
+ else
+ {
+ if (!internal::FEFaceEvaluationFactory<dim, Number, VectorizedArrayType>::
+ integrate_scatter(
+ n_components,
+ internal::get_beginning<Number>(destination),
+ *this->data,
+ *this->dof_info,
+ this->begin_dof_values(),
+ this->begin_values(),
+ this->begin_gradients(),
+ this->scratch_data,
+ evaluation_flag & EvaluationFlags::values,
+ evaluation_flag & EvaluationFlags::gradients,
+ this->active_fe_index,
+ this->first_selected_component,
+ std::array<unsigned int, 1>{{this->cell}},
+ std::array<unsigned int, 1>{{this->face_no}},
+ this->subface_index,
+ this->dof_access_index,
+ std::array<unsigned int, 1>{{this->face_orientation}},
+ this->mapping_data->descriptor[this->active_fe_index]
+ .face_orientations))
+ {
+ this->distribute_local_to_global(destination);
+ }
}
}
SET(_src
dof_info.cc
evaluation_selector.cc
+ evaluation_template_factory.cc
+ evaluation_template_factory_inst2.cc
+ evaluation_template_factory_inst3.cc
+ evaluation_template_factory_inst4.cc
+ evaluation_template_factory_inst5.cc
+ evaluation_template_factory_inst6.cc
mapping_info.cc
mapping_info_inst2.cc
mapping_info_inst3.cc
SET(_inst
evaluation_selector.inst.in
+ evaluation_template_factory.inst.in
mapping_info.inst.in
matrix_free.inst.in
shape_info.inst.in
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+#define FE_EVAL_FACTORY_DEGREE_MAX 6
+
+#include <deal.II/matrix_free/evaluation_template_factory.templates.h>
+
+DEAL_II_NAMESPACE_OPEN
+
+#define SPLIT_INSTANTIATIONS_COUNT 6
+#ifndef SPLIT_INSTANTIATIONS_INDEX
+# define SPLIT_INSTANTIATIONS_INDEX 0
+#endif
+
+#include "evaluation_template_factory.inst"
+
+DEAL_II_NAMESPACE_CLOSE
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+
+for (deal_II_dimension : DIMENSIONS;
+ deal_II_scalar_vectorized : REAL_SCALARS_VECTORIZED)
+ {
+ template struct dealii::internal::FEEvaluationFactory<
+ deal_II_dimension,
+ deal_II_scalar_vectorized::value_type,
+ deal_II_scalar_vectorized>;
+
+ template struct dealii::internal::FEFaceEvaluationFactory<
+ deal_II_dimension,
+ deal_II_scalar_vectorized::value_type,
+ deal_II_scalar_vectorized>;
+
+ // inverse mass
+ template struct dealii::internal::CellwiseInverseMassFactory<
+ deal_II_dimension,
+ deal_II_scalar_vectorized::value_type,
+ deal_II_scalar_vectorized>;
+
+ template bool dealii::internal::FEFaceEvaluationFactory<
+ deal_II_dimension,
+ deal_II_scalar_vectorized::value_type,
+ deal_II_scalar_vectorized>::
+ gather_evaluate<1>(
+ const unsigned int,
+ const deal_II_scalar_vectorized::value_type *,
+ const MatrixFreeFunctions::ShapeInfo<deal_II_scalar_vectorized> &,
+ const MatrixFreeFunctions::DoFInfo &,
+ deal_II_scalar_vectorized *,
+ deal_II_scalar_vectorized *,
+ deal_II_scalar_vectorized *,
+ const bool,
+ const bool,
+ const unsigned int,
+ const unsigned int,
+ const std::array<unsigned int, 1>,
+ const std::array<unsigned int, 1>,
+ const unsigned int,
+ const MatrixFreeFunctions::DoFInfo::DoFAccessIndex,
+ const std::array<unsigned int, 1>,
+ const Table<2, unsigned int> &);
+
+ template bool dealii::internal::FEFaceEvaluationFactory<
+ deal_II_dimension,
+ deal_II_scalar_vectorized::value_type,
+ deal_II_scalar_vectorized>::
+ integrate_scatter<1>(
+ const unsigned int,
+ deal_II_scalar_vectorized::value_type *,
+ const MatrixFreeFunctions::ShapeInfo<deal_II_scalar_vectorized> &,
+ const MatrixFreeFunctions::DoFInfo &,
+ deal_II_scalar_vectorized *,
+ deal_II_scalar_vectorized *,
+ deal_II_scalar_vectorized *,
+ deal_II_scalar_vectorized *,
+ const bool,
+ const bool,
+ const unsigned int,
+ const unsigned int,
+ const std::array<unsigned int, 1>,
+ const std::array<unsigned int, 1>,
+ const unsigned int,
+ const MatrixFreeFunctions::DoFInfo::DoFAccessIndex,
+ const std::array<unsigned int, 1>,
+ const Table<2, unsigned int> &);
+ }
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+#define SPLIT_INSTANTIATIONS_INDEX 1
+#include "evaluation_template_factory.cc"
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+#define SPLIT_INSTANTIATIONS_INDEX 2
+#include "evaluation_template_factory.cc"
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+#define SPLIT_INSTANTIATIONS_INDEX 3
+#include "evaluation_template_factory.cc"
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+#define SPLIT_INSTANTIATIONS_INDEX 4
+#include "evaluation_template_factory.cc"
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2020 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE.md at
+// the top level directory of deal.II.
+//
+// ---------------------------------------------------------------------
+
+#define SPLIT_INSTANTIATIONS_INDEX 5
+#include "evaluation_template_factory.cc"