*/
unsigned int
get_cell_active_fe_index(
- const std::pair<unsigned int, unsigned int> range) const;
+ const std::pair<unsigned int, unsigned int> range, unsigned int dof_index) const;
/**
* In the hp-adaptive case, return the active FE index of a face range.
template <int dim, typename Number, typename VectorizedArrayType>
unsigned int
MatrixFree<dim, Number, VectorizedArrayType>::get_cell_active_fe_index(
- const std::pair<unsigned int, unsigned int> range) const
+ const std::pair<unsigned int, unsigned int> range, unsigned int dof_handler_index) const
{
const auto &fe_indices = dof_info[0].cell_active_fe_index;
- if (fe_indices.empty() == true)
+ if (fe_indices.empty() == true ||
+ dof_handlers[dof_handler_index]->get_fe_collection().size() == 1)
return 0;
const auto index = fe_indices[range.first];
typename Number = double,
typename VectorizedArrayType = VectorizedArray<Number>>
void
-test()
+test(bool use_categorization = false)
{
parallel::distributed::Triangulation<dim> tria(MPI_COMM_WORLD);
cell->set_refine_flag();
tria.execute_coarsening_and_refinement();
+ if (use_categorization)
+ {
+ for (auto &cell : tria.active_cell_iterators())
+ if (cell->is_active() && cell->is_locally_owned() &&
+ cell->center()[0] < 0.0)
+ cell->set_material_id(42);
+ else
+ cell->set_material_id(0);
+ }
const FE_Q<dim> fe_q(fe_degree);
const FESystem<dim> fe(fe_q, n_components);
additional_data;
additional_data.mapping_update_flags = update_values | update_gradients;
+ if (use_categorization)
+ {
+ additional_data.cell_vectorization_category.resize(tria.n_active_cells());
+ for (const auto &cell : tria.active_cell_iterators())
+ if (cell->is_locally_owned())
+ additional_data
+ .cell_vectorization_category[cell->active_cell_index()] =
+ cell->material_id();
+
+ additional_data.cell_vectorization_categories_strict = true;
+ }
+
MappingQ<dim> mapping(1);
QGauss<1> quad(fe_degree + 1);
test<2, 1, 2, 1, float>(); // scalar
test<2, 1, 2, 2, float>(); // vector
+
+ // Same as above, but testing additional categorization of vectorized cell
+ // batches
+ test<2, 1, 2, 1, float>(true); // scalar
+ test<2, 1, 2, 2, float>(true); // vector
}