std::vector<std::vector<std::pair<unsigned int,unsigned int> > > &parent_child_connect,
std::vector<unsigned int> &n_owned_level_cells,
std::vector<std::vector<std::vector<unsigned short> > > &dirichlet_indices,
- std::vector<AlignedVector<VectorizedArray<Number> > > &weights_on_refined,
+ std::vector<std::vector<Number> > &weights_on_refined,
std::vector<std::vector<std::pair<unsigned int, unsigned int> > > ©_indices_global_mine,
MGLevelObject<LinearAlgebra::distributed::Vector<Number> > &ghosted_level_vector);
std::vector<std::vector<std::pair<unsigned int,unsigned int> > > &parent_child_connect,
std::vector<unsigned int> &n_owned_level_cells,
std::vector<std::vector<std::vector<unsigned short> > > &dirichlet_indices,
- std::vector<AlignedVector<VectorizedArray<Number> > > &weights_on_refined,
+ std::vector<std::vector<Number> > &weights_on_refined,
std::vector<std::vector<std::pair<unsigned int, unsigned int> > > ©_indices_global_mine,
MGLevelObject<LinearAlgebra::distributed::Vector<Number> > &ghosted_level_vector)
{
ghosted_level_vector[level].compress(VectorOperation::add);
ghosted_level_vector[level].update_ghost_values();
- const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
std::vector<unsigned int> degree_to_3 (n_child_dofs_1d);
degree_to_3[0] = 0;
for (unsigned int i=1; i<n_child_dofs_1d-1; ++i)
// we only store 3^dim weights because all dofs on a line have the
// same valence, and all dofs on a quad have the same valence.
- weights_on_refined[level-1].resize(((n_owned_level_cells[level-1]+vec_size-1)/vec_size)*Utilities::fixed_power<dim>(3));
+ weights_on_refined[level-1].resize(n_owned_level_cells[level-1]*Utilities::fixed_power<dim>(3));
for (unsigned int c=0; c<n_owned_level_cells[level-1]; ++c)
- {
- const unsigned int comp = c/vec_size;
- const unsigned int v = c%vec_size;
-
- for (unsigned int k=0, m=0; k<(dim>2 ? n_child_dofs_1d : 1); ++k)
- for (unsigned int j=0; j<(dim>1 ? n_child_dofs_1d : 1); ++j)
- {
- unsigned int shift = 9*degree_to_3[k] + 3*degree_to_3[j];
- for (unsigned int i=0; i<n_child_dofs_1d; ++i, ++m)
- weights_on_refined[level-1][comp*Utilities::fixed_power<dim>(3)+shift+degree_to_3[i]][v] = Number(1.)/
- ghosted_level_vector[level].local_element(level_dof_indices[level][elem_info.n_child_cell_dofs*c+m]);
- }
- }
+ for (unsigned int k=0, m=0; k<(dim>2 ? n_child_dofs_1d : 1); ++k)
+ for (unsigned int j=0; j<(dim>1 ? n_child_dofs_1d : 1); ++j)
+ {
+ unsigned int shift = 9*degree_to_3[k] + 3*degree_to_3[j];
+ for (unsigned int i=0; i<n_child_dofs_1d; ++i, ++m)
+ weights_on_refined[level-1][c*Utilities::fixed_power<dim>(3)+shift+degree_to_3[i]] = Number(1.)/
+ ghosted_level_vector[level].local_element(level_dof_indices[level][elem_info.n_child_cell_dofs*c+m]);
+ }
}
}
std::vector<std::vector<std::pair<unsigned int,unsigned int> > >&,
std::vector<unsigned int>&,
std::vector<std::vector<std::vector<unsigned short> > >&,
- std::vector<AlignedVector<VectorizedArray<S> > >&,
+ std::vector<std::vector<S> >&,
std::vector<std::vector<std::pair<unsigned int, unsigned int> > >&,
MGLevelObject<LinearAlgebra::distributed::Vector<S> >&);
\}
{
this->fill_and_communicate_copy_indices(mg_dof);
+ std::vector<std::vector<Number> > weights_unvectorized;
+
internal::MGTransfer::ElementInfo<Number> elem_info;
+
internal::MGTransfer::setup_transfer<dim,Number>(mg_dof,
(const MGConstrainedDoFs *)this->mg_constrained_dofs,
elem_info,
parent_child_connect,
n_owned_level_cells,
dirichlet_indices,
- weights_on_refined,
+ weights_unvectorized,
this->copy_indices_global_mine,
this->ghosted_level_vector);
// unpack element info data
n_child_cell_dofs = elem_info.n_child_cell_dofs;
shape_info = elem_info.shape_info;
+
+ // reshuffle into aligned vector of vectorized arrays
+ const unsigned int vec_size = VectorizedArray<Number>::n_array_elements;
+ const unsigned int n_levels = mg_dof.get_triangulation().n_global_levels();
+
+ const unsigned int n_weights_per_cell = Utilities::fixed_power<dim>(3);
+ weights_on_refined.resize(n_levels-1);
+ for (unsigned int level = 1; level<n_levels; ++level)
+ {
+ weights_on_refined[level-1].resize(((n_owned_level_cells[level-1]+vec_size-1)/vec_size)*n_weights_per_cell);
+
+ for (unsigned int c=0; c<n_owned_level_cells[level-1]; ++c)
+ {
+ const unsigned int comp = c/vec_size;
+ const unsigned int v = c%vec_size;
+ for (unsigned int i = 0; i<n_weights_per_cell; ++i)
+ {
+
+ weights_on_refined[level-1][comp*n_weights_per_cell+i][v] = weights_unvectorized[level-1][c*n_weights_per_cell+i];
+ }
+ }
+ }
+
evaluation_data.resize(3*n_child_cell_dofs);
}