*
* The parameters @p dof_no, @p quad_no, and @p first_selected_component are
* passed to the constructor of the FEEvaluation that is internally set up.
+ *
+ * The parameter @p first_vector_component is used to select the right
+ * starting block in a block vector.
*/
template <int dim,
int fe_degree,
&cell_operation,
const unsigned int dof_no = 0,
const unsigned int quad_no = 0,
- const unsigned int first_selected_component = 0);
+ const unsigned int first_selected_component = 0,
+ const unsigned int first_vector_component = 0);
const CLASS *owning_class,
const unsigned int dof_no = 0,
const unsigned int quad_no = 0,
- const unsigned int first_selected_component = 0);
+ const unsigned int first_selected_component = 0,
+ const unsigned int first_vector_component = 0);
&boundary_operation,
const unsigned int dof_no = 0,
const unsigned int quad_no = 0,
- const unsigned int first_selected_component = 0);
+ const unsigned int first_selected_component = 0,
+ const unsigned int first_vector_component = 0);
const CLASS *owning_class,
const unsigned int dof_no = 0,
const unsigned int quad_no = 0,
- const unsigned int first_selected_component = 0);
+ const unsigned int first_selected_component = 0,
+ const unsigned int first_vector_component = 0);
&cell_operation,
const unsigned int dof_no,
const unsigned int quad_no,
- const unsigned int first_selected_component)
+ const unsigned int first_selected_component,
+ const unsigned int first_vector_component)
{
compute_diagonal<dim,
fe_degree,
{},
dof_no,
quad_no,
- first_selected_component);
+ first_selected_component,
+ first_vector_component);
}
template <typename CLASS,
const CLASS *owning_class,
const unsigned int dof_no,
const unsigned int quad_no,
- const unsigned int first_selected_component)
+ const unsigned int first_selected_component,
+ const unsigned int first_vector_component)
{
compute_diagonal<dim,
fe_degree,
[&](auto &phi) { (owning_class->*cell_operation)(phi); },
dof_no,
quad_no,
- first_selected_component);
+ first_selected_component,
+ first_vector_component);
}
template <int dim,
&boundary_operation,
const unsigned int dof_no,
const unsigned int quad_no,
- const unsigned int first_selected_component)
+ const unsigned int first_selected_component,
+ const unsigned int first_vector_component)
{
int dummy = 0;
for (unsigned int d = 0; d < n_components; ++d)
diagonal_global_components[d] = dealii::internal::
BlockVectorSelector<VectorType, IsBlockVector<VectorType>::value>::
- get_vector_component(diagonal_global, d + first_selected_component);
+ get_vector_component(diagonal_global, d + first_vector_component);
const auto &dof_info = matrix_free.get_dof_info(dof_no);
const CLASS *owning_class,
const unsigned int dof_no,
const unsigned int quad_no,
- const unsigned int first_selected_component)
+ const unsigned int first_selected_component,
+ const unsigned int first_vector_component)
{
compute_diagonal<dim,
fe_degree,
[&](auto &phi) { (owning_class->*boundary_operation)(phi); },
dof_no,
quad_no,
- first_selected_component);
+ first_selected_component,
+ first_vector_component);
}
namespace internal
typename Number = double,
typename VectorizedArrayType = VectorizedArray<Number>>
void
-test()
+test(const unsigned int first_vector_component)
{
Triangulation<dim> tria;
GridGenerator::hyper_ball(tria);
diagonal_global.print(deallog.get_file_stream());
- LinearAlgebra::distributed::BlockVector<Number> diagonal_global_block(dim);
+ LinearAlgebra::distributed::BlockVector<Number> diagonal_global_block(
+ dim + first_vector_component);
- for (unsigned int comp = 0; comp < dim; ++comp)
+ for (unsigned int comp = 0; comp < dim + first_vector_component; ++comp)
matrix_free.initialize_dof_vector(diagonal_global_block.block(comp), 1);
MatrixFreeTools::compute_diagonal<dim,
n_points,
n_components,
Number,
- VectorizedArrayType>(matrix_free,
- diagonal_global_block,
- kernel,
- 1);
+ VectorizedArrayType>(
+ matrix_free,
+ diagonal_global_block,
+ kernel,
+ 1,
+ 0,
+ 0,
+ first_vector_component);
diagonal_global_block.print(deallog.get_file_stream());
}
Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
MPILogInitAll all;
- test<2, 1>();
+ test<2, 1>(0);
+ test<2, 1>(1 /*test first vector component*/);
}