is_linear ? Utilities::pow(2, dim - 1) : this->dofs_per_component_face;
for (unsigned int comp = 0; comp < n_components; ++comp)
for (unsigned int i = 0; i < 2 * dofs_per_comp_face; ++i)
- ETT::read_value(face_dof_values[i + comp * 3 * dofs_per_comp_face],
+ ETT::read_value(face_dof_values[(i + comp * 3 * dofs_per_comp_face) *
+ stride_face_dof],
comp,
this->solution_renumbered[i]);
face_dof_values_ptr = this->solution_renumbered.data();
}
+ constexpr int stride_face_dof_actual =
+ n_components == 1 ? stride_face_dof : 1;
+
// loop over quadrature batches qb
const unsigned int n_shapes = is_linear ? 2 : this->poly.size();
scalar_value_type,
VectorizedArrayType,
2,
- stride_face_dof>(face_dof_values_ptr,
- this->unit_point_faces_ptr[qb]) :
+ stride_face_dof_actual>(face_dof_values_ptr,
+ this->unit_point_faces_ptr[qb]) :
internal::evaluate_tensor_product_value_and_gradient_shapes<
dim - 1,
scalar_value_type,
VectorizedArrayType,
2,
false,
- stride_face_dof>(this->shapes_faces.data() + qb * n_shapes,
- n_shapes,
- face_dof_values_ptr);
+ stride_face_dof_actual>(this->shapes_faces.data() +
+ qb * n_shapes,
+ n_shapes,
+ face_dof_values_ptr);
value = interpolated_value[dim - 1];
// reorder derivative from tangential/normal derivatives into tensor
}
else
{
- value =
- is_linear ?
- internal::evaluate_tensor_product_value_linear<
- dim - 1,
- scalar_value_type,
- VectorizedArrayType,
- stride_face_dof>(face_dof_values_ptr,
- this->unit_point_faces_ptr[qb]) :
- internal::evaluate_tensor_product_value_shapes<
- dim - 1,
- scalar_value_type,
- VectorizedArrayType,
- false,
- stride_face_dof>(this->shapes_faces.data() + qb * n_shapes,
- n_shapes,
- face_dof_values_ptr);
+ value = is_linear ?
+ internal::evaluate_tensor_product_value_linear<
+ dim - 1,
+ scalar_value_type,
+ VectorizedArrayType,
+ stride_face_dof_actual>(face_dof_values_ptr,
+ this->unit_point_faces_ptr[qb]) :
+ internal::evaluate_tensor_product_value_shapes<
+ dim - 1,
+ scalar_value_type,
+ VectorizedArrayType,
+ false,
+ stride_face_dof_actual>(this->shapes_faces.data() +
+ qb * n_shapes,
+ n_shapes,
+ face_dof_values_ptr);
}
if (evaluation_flags & EvaluationFlags::values)
#include <deal.II/numerics/vector_tools.h>
-#include <../tests.h>
+#include "../tests.h"
using namespace dealii;
void
do_test(unsigned int degree)
{
- using VectorType = LinearAlgebra::distributed::Vector<Number>;
+ using VectorType = LinearAlgebra::distributed::Vector<Number>;
+ using VectorizedArrayType = VectorizedArray<Number>;
- parallel::distributed::Triangulation<dim> tria(MPI_COMM_WORLD);
+ Triangulation<dim> tria;
GridGenerator::hyper_cube(tria);
tria.refine_global(2);
AffineConstraints<Number> constraints;
constraints.close();
- typename MatrixFree<dim, Number>::AdditionalData data;
+ typename MatrixFree<dim, Number, VectorizedArrayType>::AdditionalData data;
data.mapping_update_flags = update_values;
data.mapping_update_flags_inner_faces = update_values;
data.mapping_update_flags_boundary_faces = update_values;
MappingQ1<dim> mapping;
- MatrixFree<dim, Number> matrix_free;
+ MatrixFree<dim, Number, VectorizedArrayType> matrix_free;
matrix_free.reinit(
mapping, dof_handler, constraints, QGauss<dim>(degree + 1), data);
vector_face_accessors.push_back(
matrix_free.get_face_iterator(face_batch, 0));
- quadrature_vector.emplace_back(Quadrature<dim - 1>(degree + 1));
+ quadrature_vector.push_back(QGauss<dim - 1>(degree + 1));
}
}
src);
const auto boundary_function_1 = [&](const auto &data,
- auto & dst,
+ auto &dst,
const auto &src,
const auto face_range) {
FEFacePointEvaluation<dim, dim, dim, Number> phi_pnt(
const auto boundary_function_2 =
[&](const auto &data, auto &dst, const auto &src, const auto face_range) {
- FEFaceEvaluation<dim, -1, 0, dim, Number> phi(matrix_free, true, 0, 0, 1);
+ FEFaceEvaluation<dim, -1, 0, dim, Number, VectorizedArrayType> phi(
+ matrix_free, true, 0, 0, 1);
FEFacePointEvaluation<dim, dim, dim, Number> phi_pnt(
nm_mapping_info, data.get_dof_handler().get_fe(), true, 1);
++v)
{
phi_pnt.reinit(face * n_lanes + v);
- phi_pnt.evaluate_in_face(&phi.get_scratch_data().begin()[0][v],
- EvaluationFlags::values);
+ phi_pnt.template evaluate_in_face<VectorizedArrayType::size()>(
+ &phi.get_scratch_data().begin()[0][v], EvaluationFlags::values);
for (unsigned int q : phi_pnt.quadrature_point_indices())
phi_pnt.submit_value(phi_pnt.get_value(q), q);
- phi_pnt.integrate_in_face(&phi.get_scratch_data().begin()[0][v],
- EvaluationFlags::values);
+ phi_pnt.template integrate_in_face<VectorizedArrayType::size()>(
+ &phi.get_scratch_data().begin()[0][v], EvaluationFlags::values);
}
phi.collect_from_face(EvaluationFlags::values);
phi.distribute_local_to_global(dst);
matrix_free.template loop<VectorType, VectorType>(
{}, {}, boundary_function_2, dst_2, src, true);
- Assert(std::abs(dst_1.l2_norm() - dst_2.l2_norm()) < 1.0e-12);
+ Assert(std::abs(dst_1.l2_norm() - dst_2.l2_norm()) < 1.0e-12,
+ ExcInternalError());
}
int
main(int argc, char *argv[])
{
- Utilities::MPI::MPI_InitFinalize mpi(argc, argv, 1);
- MPILogInitAll all;
+ initlog();
do_test<2, double>(2);