From: kronbichler Date: Tue, 7 Apr 2009 08:44:40 +0000 (+0000) Subject: Fix a bug that I introduced yesterday. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad99ff6686c2581325ab140f734031b0ac2a969d;p=dealii-svn.git Fix a bug that I introduced yesterday. git-svn-id: https://svn.dealii.org/trunk@18561 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/constraint_matrix.templates.h b/deal.II/lac/include/lac/constraint_matrix.templates.h index fbc2fd9579..5699e87841 100644 --- a/deal.II/lac/include/lac/constraint_matrix.templates.h +++ b/deal.II/lac/include/lac/constraint_matrix.templates.h @@ -1591,9 +1591,8 @@ distribute_local_to_global (const FullMatrix &local_matrix, { for (unsigned int i=block_start; i &local_matrix, col_counter++; } } - - if (use_vectors == true) - { - val = local_vector(loc_row); - - for (unsigned int i=0; iinhomogeneity * - local_matrix(loc_row,constraint_lines[i].first); - } } else @@ -1687,29 +1677,6 @@ distribute_local_to_global (const FullMatrix &local_matrix, col_counter++; } } - - if (use_vectors == true) - { - if (loc_row != deal_II_numbers::invalid_unsigned_int) - { - Assert (loc_row >= 0 && loc_row < n_local_dofs, - ExcInternalError()); - val = local_vector(loc_row); - for (unsigned int i=0; iinhomogeneity * - local_matrix(loc_row,constraint_lines[i].first); - } - - for (unsigned int q=0; q < my_indices[i].constraints.size(); ++q) - { - const unsigned int loc_row_q = my_indices[i].constraints[q].first; - double add_this = local_vector (loc_row_q); - for (unsigned int k=0; kinhomogeneity * - local_matrix(loc_row_q,constraint_lines[k].first); - val += add_this * my_indices[i].constraints[q].second; - } - } } block_col_start = block_ends[block_col]; @@ -1721,14 +1688,39 @@ distribute_local_to_global (const FullMatrix &local_matrix, // go trough the individual blocks and // look which entries we need to set. Threads::ThreadMutex::ScopedLock lock(mutex); - global_matrix.block(block, block_col).add(localized_indices[i], col_counter, + global_matrix.block(block, block_col).add(row, col_counter, &cols[0], &vals[0], false, true); } - if (val != 0) + + + if (use_vectors == true) { - Threads::ThreadMutex::ScopedLock lock(mutex); - global_vector(row) += val; + double val = 0; + if (loc_row != deal_II_numbers::invalid_unsigned_int) + { + Assert (loc_row >= 0 && loc_row < n_local_dofs, + ExcInternalError()); + val = local_vector(loc_row); + for (unsigned int i=0; iinhomogeneity * + local_matrix(loc_row,constraint_lines[i].first); + } + + for (unsigned int q=0; q < my_indices[i].constraints.size(); ++q) + { + const unsigned int loc_row_q = my_indices[i].constraints[q].first; + double add_this = local_vector (loc_row_q); + for (unsigned int k=0; kinhomogeneity * + local_matrix(loc_row_q,constraint_lines[k].first); + val += add_this * my_indices[i].constraints[q].second; + } + if (val != 0) + { + Threads::ThreadMutex::ScopedLock lock(mutex); + global_vector(my_indices[i].global_row) += val; + } } } block_start = block_ends[block];