--- /dev/null
+Fixed: MatrixFreeOperators::CellwiseInverseMassMatrix with template argument
+`-1` for the polynomial degree now chooses the pre-compiled code with fast
+tensor-product algorithms if available, rather than a slower general-purpose
+code.
+<br>
+(Martin Kronbichler, 2021/11/29)
{
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,
static void
transform_from_q_points_to_basis(
const unsigned int n_components,
- const unsigned int fe_degree,
- const unsigned int n_q_points_1d,
const FEEvaluationBaseData<dim, Number, false, VectorizedArrayType>
& fe_eval,
const VectorizedArrayType *in_array,
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)
{
+ const unsigned int fe_degree = fe_eval.get_shape_info().data[0].fe_degree;
instantiation_helper_run<
1,
CellwiseInverseMassMatrixImplBasic<dim, VectorizedArrayType>>(
CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::
transform_from_q_points_to_basis(
const unsigned int n_components,
- const unsigned int fe_degree,
- const unsigned int n_q_points_1d,
const FEEvaluationBaseData<dim, Number, false, VectorizedArrayType>
& fe_eval,
const VectorizedArrayType *in_array,
VectorizedArrayType * out_array)
{
+ const unsigned int fe_degree = fe_eval.get_shape_info().data[0].fe_degree;
+ const unsigned int n_q_points_1d =
+ fe_eval.get_shape_info().data[0].n_q_points_1d;
instantiation_helper_run<
1,
CellwiseInverseMassMatrixImplTransformFromQPoints<dim,
VectorizedArrayType>::apply(const VectorizedArrayType *in_array,
VectorizedArrayType * out_array) const
{
- internal::CellwiseInverseMassMatrixImplBasic<dim, VectorizedArrayType>::
- template run<fe_degree>(n_components, fe_eval, in_array, out_array);
+ if (fe_degree > -1)
+ internal::CellwiseInverseMassMatrixImplBasic<dim, VectorizedArrayType>::
+ template run<fe_degree>(n_components, fe_eval, in_array, out_array);
+ else
+ internal::CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::
+ apply(n_components, fe_eval, in_array, out_array);
}
const VectorizedArrayType * in_array,
VectorizedArrayType * out_array) const
{
- internal::CellwiseInverseMassMatrixImplFlexible<dim, VectorizedArrayType>::
- template run<fe_degree>(
- n_actual_components,
- fe_eval.get_shape_info().data.front().inverse_shape_values_eo,
- inverse_coefficients,
- in_array,
- out_array);
+ const unsigned int given_degree =
+ fe_eval.get_shape_info().data[0].fe_degree;
+ if (fe_degree > -1)
+ internal::CellwiseInverseMassMatrixImplFlexible<dim,
+ VectorizedArrayType>::
+ template run<fe_degree>(
+ n_actual_components,
+ fe_eval.get_shape_info().data.front().inverse_shape_values_eo,
+ inverse_coefficients,
+ in_array,
+ out_array);
+ else
+ internal::CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::
+ apply(n_actual_components,
+ given_degree,
+ fe_eval.get_shape_info().data.front().inverse_shape_values_eo,
+ inverse_coefficients,
+ in_array,
+ out_array);
}
else
internal::CellwiseInverseMassFactory<dim, Number, VectorizedArrayType>::
transform_from_q_points_to_basis(n_actual_components,
- fe_degree,
- n_q_points_1d,
fe_eval,
in_array,
out_array);