From: janssen Date: Sun, 6 Nov 2011 14:08:19 +0000 (+0000) Subject: works now with offset and certain dofs can be selected X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=085c61713034cc8b3f1522dc6f08edfd220d53a4;p=dealii-svn.git works now with offset and certain dofs can be selected git-svn-id: https://svn.dealii.org/trunk@24725 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/block_list.h b/deal.II/include/deal.II/lac/block_list.h index e738b22243..0fadbb43b5 100644 --- a/deal.II/include/deal.II/lac/block_list.h +++ b/deal.II/include/deal.II/lac/block_list.h @@ -85,7 +85,8 @@ class BlockList : */ void add(unsigned int block, const std::vector& indices, - const std::vector& selected_indices); + const std::vector& selected_indices, + unsigned int offset = 0); /** * Just set up the correct size @@ -327,7 +328,8 @@ void BlockList::add( const unsigned int block, const std::vector& indices, - const std::vector& selected) + const std::vector& selected, + unsigned int offset) { AssertIndexRange(block, index_sets.size()); AssertDimension(indices.size(), selected.size()); @@ -337,9 +339,9 @@ BlockList::add( const unsigned int k = indices[i]; if (k==numbers::invalid_unsigned_int) continue; - if (selected[i] && std::find(index_sets[block].begin(), index_sets[block].end(), k) + if (selected[i] && std::find(index_sets[block].begin(), index_sets[block].end(), k-offset) == index_sets[block].end()) - index_sets[block].push_back(k); + index_sets[block].push_back(k-offset); } } @@ -429,7 +431,7 @@ BlockList::initialize_mg( AssertDimension(selected_dofs.size(), cell->get_fe().dofs_per_cell); cell->get_mg_dof_indices(indices); - add(k, indices, selected_dofs); + add(k, indices, selected_dofs, offset); } }