From: Karl Ljungkvist Date: Thu, 9 Jun 2016 12:47:45 +0000 (+0200) Subject: Fix array lenghts X-Git-Tag: v8.5.0-rc1~400^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f130a0041bcad47fdc6c755bb294ee0407e700f;p=dealii.git Fix array lenghts --- diff --git a/source/multigrid/mg_transfer_matrix_free.cc b/source/multigrid/mg_transfer_matrix_free.cc index 30bce84d16..f8117424b3 100644 --- a/source/multigrid/mg_transfer_matrix_free.cc +++ b/source/multigrid/mg_transfer_matrix_free.cc @@ -503,7 +503,7 @@ void MGTransferMatrixFree::build // // get the valence of the individual components and compute the weights as // the inverse of the valence - weights_on_refined.resize(n_levels); + weights_on_refined.resize(n_levels-1); for (unsigned int level = 1; levelghosted_level_vector[level] = 0; @@ -522,7 +522,7 @@ void MGTransferMatrixFree::build // 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].resize(((n_owned_level_cells[level-1]+vec_size-1)/vec_size)*Utilities::fixed_power(3)); + weights_on_refined[level-1].resize(((n_owned_level_cells[level-1]+vec_size-1)/vec_size)*Utilities::fixed_power(3)); for (unsigned int c=0; c::build { unsigned int shift = 9*degree_to_3[k] + 3*degree_to_3[j]; for (unsigned int i=0; i(3)+shift+degree_to_3[i]][v] = Number(1.)/ + weights_on_refined[level-1][comp*Utilities::fixed_power(3)+shift+degree_to_3[i]][v] = Number(1.)/ this->ghosted_level_vector[level].local_element(level_dof_indices[level][n_child_cell_dofs*c+m]); } } @@ -799,7 +799,7 @@ void MGTransferMatrixFree n_child_cell_dofs, n_components, evaluation_data); - weight_dofs_on_child(&weights_on_refined[to_level][(cell/vec_size)*three_to_dim], + weight_dofs_on_child(&weights_on_refined[to_level-1][(cell/vec_size)*three_to_dim], n_components, &evaluation_data[2*n_child_cell_dofs]); } @@ -872,7 +872,7 @@ void MGTransferMatrixFree Evaluator evaluator(shape_info.shape_val_evenodd, shape_info.shape_val_evenodd, shape_info.shape_val_evenodd); - weight_dofs_on_child(&weights_on_refined[from_level][(cell/vec_size)*three_to_dim], + weight_dofs_on_child(&weights_on_refined[from_level-1][(cell/vec_size)*three_to_dim], n_components, &evaluation_data[0]); perform_tensorized_op(evaluator,