From c9d4f287039254697e89048b5276cadbbfb75ae4 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Fri, 3 Apr 2015 10:21:22 +0200 Subject: [PATCH] replace csp and c_sparsity_pattern by dsp use indent --- include/deal.II/dofs/dof_tools.h | 3 +- include/deal.II/lac/block_sparsity_pattern.h | 2 +- include/deal.II/lac/chunk_sparsity_pattern.h | 5 +- include/deal.II/lac/sparse_matrix.templates.h | 20 ++--- include/deal.II/lac/sparsity_pattern.h | 2 +- include/deal.II/lac/sparsity_tools.h | 14 +-- include/deal.II/multigrid/mg_transfer.h | 16 ++-- .../multigrid/sparse_matrix_collection.h | 6 +- .../deal.II/numerics/vector_tools.templates.h | 14 +-- source/dofs/dof_renumbering.cc | 36 ++++---- source/grid/grid_tools.cc | 10 +-- source/lac/block_sparsity_pattern.cc | 6 +- source/lac/chunk_sparsity_pattern.cc | 18 ++-- source/lac/sparsity_pattern.cc | 24 +++--- source/lac/sparsity_tools.cc | 86 +++++++++---------- source/lac/trilinos_sparse_matrix.cc | 12 +-- source/lac/trilinos_sparsity_pattern.cc | 12 +-- source/multigrid/mg_transfer_prebuilt.cc | 10 +-- 18 files changed, 147 insertions(+), 149 deletions(-) diff --git a/include/deal.II/dofs/dof_tools.h b/include/deal.II/dofs/dof_tools.h index 719e45110f..fa2b2df70e 100644 --- a/include/deal.II/dofs/dof_tools.h +++ b/include/deal.II/dofs/dof_tools.h @@ -363,8 +363,7 @@ namespace DoFTools * * The actual type of the sparsity pattern may be SparsityPattern, * DynamicSparsityPattern, BlockSparsityPattern, - * BlockDynamicSparsityPattern, BlockDynamicSetSparsityPattern, - * BlockDynamicSimpleSparsityPattern, or any other class that satisfies + * BlockDynamicSparsityPattern, or any other class that satisfies * similar requirements. It is assumed that the size of the sparsity pattern * matches the number of degrees of freedom and that enough unused nonzero * entries are left to fill the sparsity pattern. The nonzero entries diff --git a/include/deal.II/lac/block_sparsity_pattern.h b/include/deal.II/lac/block_sparsity_pattern.h index d7fd972c18..cedefafa73 100644 --- a/include/deal.II/lac/block_sparsity_pattern.h +++ b/include/deal.II/lac/block_sparsity_pattern.h @@ -446,7 +446,7 @@ public: * contents of each of the subobjects. Previous content of this object is * lost. */ - void copy_from (const BlockDynamicSparsityPattern &csp); + void copy_from (const BlockDynamicSparsityPattern &dsp); }; diff --git a/include/deal.II/lac/chunk_sparsity_pattern.h b/include/deal.II/lac/chunk_sparsity_pattern.h index 7d506e52e3..18212d0bdf 100644 --- a/include/deal.II/lac/chunk_sparsity_pattern.h +++ b/include/deal.II/lac/chunk_sparsity_pattern.h @@ -481,13 +481,12 @@ public: const size_type chunk_size); /** - * Copy data from an object of type DynamicSparsityPattern, - * DynamicSetSparsityPattern or DynamicSimpleSparsityPattern. Previous + * Copy data from an object of type DynamicSparsityPattern. Previous * content of this object is lost, and the sparsity pattern is in compressed * mode afterwards. */ template - void copy_from (const SparsityType &csp, + void copy_from (const SparsityType &dsp, const size_type chunk_size); /** diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index e75b33427f..05264fb950 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -969,8 +969,8 @@ SparseMatrix::mmult (SparseMatrix &C, // a lot of entries to each row, which is best handled by the // DynamicSparsityPattern class. { - DynamicSparsityPattern csp (m(), B.n()); - for (size_type i = 0; i < csp.n_rows(); ++i) + DynamicSparsityPattern dsp (m(), B.n()); + for (size_type i = 0; i < dsp.n_rows(); ++i) { const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]]; const size_type *const end_rows = @@ -988,13 +988,13 @@ SparseMatrix::mmult (SparseMatrix &C, if (sp_B.n_rows() == sp_B.n_cols()) { ++new_cols; - csp.add(i, col); + dsp.add(i, col); } - csp.add_entries (i, new_cols, end_new_cols, true); + dsp.add_entries (i, new_cols, end_new_cols, true); } } - sp_C.copy_from (csp); + sp_C.copy_from (dsp); } // reinit matrix C from that information @@ -1096,14 +1096,14 @@ SparseMatrix::Tmmult (SparseMatrix &C, // a lot of entries to each row, which is best handled by the // DynamicSparsityPattern class. { - DynamicSparsityPattern csp (n(), B.n()); + DynamicSparsityPattern dsp (n(), B.n()); for (size_type i = 0; i < sp_A.n_rows(); ++i) { const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]]; const size_type *const end_rows = &sp_A.colnums[sp_A.rowstart[i+1]]; - // cast away constness to conform with csp.add_entries interface + // cast away constness to conform with dsp.add_entries interface size_type *new_cols = const_cast (&sp_B.colnums[sp_B.rowstart[i]]); size_type *end_new_cols = const_cast @@ -1119,12 +1119,12 @@ SparseMatrix::Tmmult (SparseMatrix &C, // if B has a diagonal, need to add that manually. this way, // we maintain sortedness. if (sp_B.n_rows() == sp_B.n_cols()) - csp.add(row, i); + dsp.add(row, i); - csp.add_entries (row, new_cols, end_new_cols, true); + dsp.add_entries (row, new_cols, end_new_cols, true); } } - sp_C.copy_from (csp); + sp_C.copy_from (dsp); } // reinit matrix C from that information diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index 1fa680ce9d..fe1597354b 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -630,7 +630,7 @@ public: * compressed mode afterwards. */ template - void copy_from (const CompressedSparsityType &csp); + void copy_from (const CompressedSparsityType &dsp); /** diff --git a/include/deal.II/lac/sparsity_tools.h b/include/deal.II/lac/sparsity_tools.h index 91f7f66ba6..09c05a4dde 100644 --- a/include/deal.II/lac/sparsity_tools.h +++ b/include/deal.II/lac/sparsity_tools.h @@ -138,7 +138,7 @@ namespace SparsityTools /** * Communciate rows in a compressed sparsity pattern over MPI. * - * @param csp is the sparsity pattern that has been built locally and for + * @param dsp is the sparsity pattern that has been built locally and for * which we need to exchange entries with other processors to make sure that * each processor knows all the elements of the rows of a matrix it stores * and that may eventually be written to. This sparsity pattern will be @@ -153,13 +153,13 @@ namespace SparsityTools * @param myrange indicates the range of elements stored locally and should * be the one used in the constructor of the * DynamicSparsityPattern. This should be the locally relevant - * set. Only rows contained in myrange are checked in csp for transfer. + * set. Only rows contained in myrange are checked in dsp for transfer. * This function needs to be used with PETScWrappers::MPI::SparseMatrix for * it to work correctly in a parallel computation. */ - template - void distribute_sparsity_pattern(CSP_t &csp, - const std::vector &rows_per_cpu, + template + void distribute_sparsity_pattern(DSP_t &dsp, + const std::vector &rows_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange); @@ -169,8 +169,8 @@ namespace SparsityTools * DoFHandler::locally_owned_dofs_per_processor and @p myrange are * locally_relevant_dofs. */ - template - void distribute_sparsity_pattern(CSP_t &csp, + template + void distribute_sparsity_pattern(DSP_t &dsp, const std::vector &owned_set_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange); diff --git a/include/deal.II/multigrid/mg_transfer.h b/include/deal.II/multigrid/mg_transfer.h index 26c4608084..8d8adb3e0a 100644 --- a/include/deal.II/multigrid/mg_transfer.h +++ b/include/deal.II/multigrid/mg_transfer.h @@ -48,10 +48,10 @@ namespace internal typedef ::dealii::SparsityPattern Sparsity; typedef ::dealii::SparseMatrix Matrix; - template - static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const CSP &csp, const DH &) + template + static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const DSP &dsp, const DH &) { - sparsity.copy_from (csp); + sparsity.copy_from (dsp); matrix.reinit (sparsity); } }; @@ -63,12 +63,12 @@ namespace internal typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity; typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix; - template - static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const CSP &csp, DH &dh) + template + static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const DSP &dsp, DH &dh) { matrix.reinit(dh.locally_owned_mg_dofs(level+1), dh.locally_owned_mg_dofs(level), - csp, MPI_COMM_WORLD, true); + dsp, MPI_COMM_WORLD, true); } }; @@ -79,8 +79,8 @@ namespace internal typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity; typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix; - template - static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const CSP &csp, DH &dh) + template + static void reinit(Matrix &matrix, Sparsity &sparsity, int level, const DSP &dsp, DH &dh) { } }; diff --git a/include/deal.II/multigrid/sparse_matrix_collection.h b/include/deal.II/multigrid/sparse_matrix_collection.h index 39dd085a9c..0390e7b9e6 100644 --- a/include/deal.II/multigrid/sparse_matrix_collection.h +++ b/include/deal.II/multigrid/sparse_matrix_collection.h @@ -87,9 +87,9 @@ namespace mg for (unsigned int level=sparsity.min_level(); level<=sparsity.max_level(); ++level) { - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs(level)); - MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level); - sparsity[level].copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern(dof_handler, dsp, level); + sparsity[level].copy_from(dsp); matrix[level].reinit(sparsity[level]); matrix_in[level].reinit(sparsity[level]); matrix_out[level].reinit(sparsity[level]); diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 652f62a726..7a9e5dc298 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -752,11 +752,11 @@ namespace VectorTools dealii::Vector vec (dof.n_dofs()); SparsityPattern sparsity; { - DynamicSparsityPattern csp (dof.n_dofs(), dof.n_dofs()); - DoFTools::make_sparsity_pattern (dof, csp, constraints, + DynamicSparsityPattern dsp (dof.n_dofs(), dof.n_dofs()); + DoFTools::make_sparsity_pattern (dof, dsp, constraints, !constraints_are_compatible); - sparsity.copy_from (csp); + sparsity.copy_from (dsp); } SparseMatrix mass_matrix (sparsity); dealii::Vector tmp (mass_matrix.n()); @@ -2176,14 +2176,14 @@ namespace VectorTools return; // set up sparsity structure - DynamicSparsityPattern c_sparsity(dof.n_boundary_dofs (boundary_functions), - dof.n_boundary_dofs (boundary_functions)); + DynamicSparsityPattern dsp(dof.n_boundary_dofs (boundary_functions), + dof.n_boundary_dofs (boundary_functions)); DoFTools::make_boundary_sparsity_pattern (dof, boundary_functions, dof_to_boundary_mapping, - c_sparsity); + dsp); SparsityPattern sparsity; - sparsity.copy_from(c_sparsity); + sparsity.copy_from(dsp); diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index d22b3c2090..f45484c5f1 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -101,14 +101,14 @@ namespace DoFRenumbering if (use_constraints) DoFTools::make_hanging_node_constraints (dof_handler, constraints); constraints.close (); - DynamicSparsityPattern csp (dof_handler.n_dofs(), - dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp, constraints); + DynamicSparsityPattern dsp (dof_handler.n_dofs(), + dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp, constraints); // submit the entries to the boost graph - for (unsigned int row=0; row::vertex_iterator ui, ui_end; @@ -411,21 +411,21 @@ namespace DoFRenumbering } else { - DynamicSparsityPattern csp (dof_handler.n_dofs(), - dof_handler.n_dofs(), - dof_handler.locally_owned_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp, constraints); + DynamicSparsityPattern dsp (dof_handler.n_dofs(), + dof_handler.n_dofs(), + dof_handler.locally_owned_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp, constraints); // If the index set is not complete, need to get indices in local // index space. if (dof_handler.locally_owned_dofs().n_elements() != dof_handler.locally_owned_dofs().size()) { - // Create sparsity pattern from csp by transferring its indices to + // Create sparsity pattern from dsp by transferring its indices to // processor-local index space and doing Cuthill-McKee there std::vector row_lengths(locally_owned.n_elements()); for (unsigned int i=0; i row_entries; @@ -434,7 +434,7 @@ namespace DoFRenumbering const types::global_dof_index row = locally_owned.nth_index_in_set(i); row_entries.resize(0); for (DynamicSparsityPattern::row_iterator it = - csp.row_begin(row); it != csp.row_end(row); ++it) + dsp.row_begin(row); it != dsp.row_end(row); ++it) if (*it != row && locally_owned.is_element(*it)) row_entries.push_back(locally_owned.index_within_set(*it)); sparsity.add_entries(i, row_entries.begin(), row_entries.end(), @@ -443,7 +443,7 @@ namespace DoFRenumbering sparsity.compress(); } else - sparsity.copy_from(csp); + sparsity.copy_from(dsp); } // constraints are not needed anymore @@ -487,10 +487,10 @@ namespace DoFRenumbering } else { - DynamicSparsityPattern csp (dof_handler.n_dofs(level), - dof_handler.n_dofs(level)); - MGTools::make_sparsity_pattern (dof_handler, csp, level); - sparsity.copy_from (csp); + DynamicSparsityPattern dsp (dof_handler.n_dofs(level), + dof_handler.n_dofs(level)); + MGTools::make_sparsity_pattern (dof_handler, dsp, level); + sparsity.copy_from (dsp); } std::vector new_indices(sparsity.n_rows()); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 59329c5b99..4b41231c3f 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -692,13 +692,13 @@ namespace GridTools DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(q1); - DynamicSparsityPattern c_sparsity_pattern (dof_handler.n_dofs (), - dof_handler.n_dofs ()); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity_pattern); - c_sparsity_pattern.compress (); + DynamicSparsityPattern dsp (dof_handler.n_dofs (), + dof_handler.n_dofs ()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + dsp.compress (); SparsityPattern sparsity_pattern; - sparsity_pattern.copy_from (c_sparsity_pattern); + sparsity_pattern.copy_from (dsp); sparsity_pattern.compress (); SparseMatrix S(sparsity_pattern); diff --git a/source/lac/block_sparsity_pattern.cc b/source/lac/block_sparsity_pattern.cc index bfc8c5fd1d..05f3e9a55f 100644 --- a/source/lac/block_sparsity_pattern.cc +++ b/source/lac/block_sparsity_pattern.cc @@ -419,16 +419,16 @@ BlockSparsityPattern::memory_consumption () const void -BlockSparsityPattern::copy_from (const BlockDynamicSparsityPattern &csp) +BlockSparsityPattern::copy_from (const BlockDynamicSparsityPattern &dsp) { // delete old content, set block // sizes anew - reinit (csp.n_block_rows(), csp.n_block_cols()); + reinit (dsp.n_block_rows(), dsp.n_block_cols()); // copy over blocks for (size_type i=0; i void -ChunkSparsityPattern::copy_from (const SparsityType &csp, +ChunkSparsityPattern::copy_from (const SparsityType &dsp, const size_type chunk_size) { Assert (chunk_size > 0, ExcInvalidNumber (chunk_size)); this->chunk_size = chunk_size; - rows = csp.n_rows(); - cols = csp.n_cols(); + rows = dsp.n_rows(); + cols = dsp.n_cols(); // simple case: just use the given sparsity pattern if (chunk_size == 1) { - sparsity_pattern.copy_from (csp); + sparsity_pattern.copy_from (dsp); return; } // create a temporary compressed sparsity pattern that collects all entries // from the input sparsity pattern and then initialize the underlying small // sparsity pattern - const size_type m_chunks = (csp.n_rows()+chunk_size-1) / chunk_size, - n_chunks = (csp.n_cols()+chunk_size-1) / chunk_size; + const size_type m_chunks = (dsp.n_rows()+chunk_size-1) / chunk_size, + n_chunks = (dsp.n_cols()+chunk_size-1) / chunk_size; DynamicSparsityPattern temporary_sp(m_chunks, n_chunks); - for (size_type row = 0; row +template void -SparsityPattern::copy_from (const CSP &csp) +SparsityPattern::copy_from (const DSP &dsp) { // first determine row lengths for each row. if the matrix is quadratic, // then we might have to add an additional entry for the diagonal, if that // is not yet present. as we have to call compress anyway later on, don't // bother to check whether that diagonal entry is in a certain row or not - const bool do_diag_optimize = (csp.n_rows() == csp.n_cols()); - std::vector row_lengths (csp.n_rows()); - for (size_type i=0; i row_lengths (dsp.n_rows()); + for (size_type i=0; i - void distribute_sparsity_pattern(CSP_t &csp, - const std::vector &rows_per_cpu, + template + void distribute_sparsity_pattern(DSP_t &dsp, + const std::vector &rows_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange) { const unsigned int myid = Utilities::MPI::this_mpi_process(mpi_comm); - std::vector start_index(rows_per_cpu.size()+1); + std::vector start_index(rows_per_cpu.size()+1); start_index[0]=0; - for (typename CSP_t::size_type i=0; i > map_vec_t; + typedef std::map > map_vec_t; map_vec_t send_data; { unsigned int dest_cpu=0; - typename CSP_t::size_type n_local_rel_rows = myrange.n_elements(); - for (typename CSP_t::size_type row_idx=0; row_idx=start_index[dest_cpu+1]) @@ -412,21 +412,21 @@ namespace SparsityTools continue; } - typename CSP_t::size_type rlen = csp.row_length(row); + typename DSP_t::size_type rlen = dsp.row_length(row); //skip empty lines if (!rlen) continue; //save entries - std::vector &dst = send_data[dest_cpu]; + std::vector &dst = send_data[dest_cpu]; dst.push_back(rlen); // number of entries dst.push_back(row); // row index - for (typename CSP_t::size_type c=0; c recv_buf; + std::vector recv_buf; for (unsigned int index=0; index::const_iterator ptr = recv_buf.begin(); - typename std::vector::const_iterator end = recv_buf.end(); + typename std::vector::const_iterator ptr = recv_buf.begin(); + typename std::vector::const_iterator end = recv_buf.end(); while (ptr+1 - void distribute_sparsity_pattern(CSP_t &csp, + template + void distribute_sparsity_pattern(DSP_t &dsp, const std::vector &owned_set_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange) { const unsigned int myid = Utilities::MPI::this_mpi_process(mpi_comm); - typedef std::map > map_vec_t; + typedef std::map > map_vec_t; map_vec_t send_data; { unsigned int dest_cpu=0; - typename CSP_t::size_type n_local_rel_rows = myrange.n_elements(); - for (typename CSP_t::size_type row_idx=0; row_idx &dst = send_data[dest_cpu]; + std::vector &dst = send_data[dest_cpu]; dst.push_back(rlen); // number of entries dst.push_back(row); // row index - for (typename CSP_t::size_type c=0; c recv_buf; + std::vector recv_buf; for (unsigned int index=0; index::const_iterator ptr = recv_buf.begin(); - typename std::vector::const_iterator end = recv_buf.end(); + typename std::vector::const_iterator ptr = recv_buf.begin(); + typename std::vector::const_iterator end = recv_buf.end(); while (ptr+1 (SparsityType & csp, \ + template void SparsityTools::distribute_sparsity_pattern (SparsityType & dsp, \ const std::vector & rows_per_cpu,\ const MPI_Comm & mpi_comm,\ const IndexSet & myrange) @@ -644,7 +644,7 @@ SPARSITY_FUNCTIONS(DynamicSparsityPattern); template void SparsityTools::distribute_sparsity_pattern -(BlockDynamicSparsityPattern &csp, +(BlockDynamicSparsityPattern &dsp, const std::vector &owned_set_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange); diff --git a/source/lac/trilinos_sparse_matrix.cc b/source/lac/trilinos_sparse_matrix.cc index d956100edc..256ddbcadb 100644 --- a/source/lac/trilinos_sparse_matrix.cc +++ b/source/lac/trilinos_sparse_matrix.cc @@ -480,21 +480,21 @@ namespace TrilinosWrappers // distinguish between compressed sparsity types that define row_begin() // and SparsityPattern that uses begin() as iterator type template - void copy_row (const Sparsity &csp, + void copy_row (const Sparsity &dsp, const size_type row, std::vector &row_indices) { - typename Sparsity::row_iterator col_num = csp.row_begin (row); - for (size_type col=0; col_num != csp.row_end (row); ++col_num, ++col) + typename Sparsity::row_iterator col_num = dsp.row_begin (row); + for (size_type col=0; col_num != dsp.row_end (row); ++col_num, ++col) row_indices[col] = *col_num; } - void copy_row (const dealii::SparsityPattern &csp, + void copy_row (const dealii::SparsityPattern &dsp, const size_type row, std::vector &row_indices) { - dealii::SparsityPattern::iterator col_num = csp.begin (row); - for (size_type col=0; col_num != csp.end (row); ++col_num, ++col) + dealii::SparsityPattern::iterator col_num = dsp.begin (row); + for (size_type col=0; col_num != dsp.end (row); ++col_num, ++col) row_indices[col] = col_num->column(); } } diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index 5ab4ea8dd1..4e773176f2 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -563,21 +563,21 @@ namespace TrilinosWrappers // distinguish between compressed sparsity types that define row_begin() // and SparsityPattern that uses begin() as iterator type template - void copy_row (const Sparsity &csp, + void copy_row (const Sparsity &dsp, const size_type row, std::vector &row_indices) { - typename Sparsity::row_iterator col_num = csp.row_begin (row); - for (size_type col=0; col_num != csp.row_end (row); ++col_num, ++col) + typename Sparsity::row_iterator col_num = dsp.row_begin (row); + for (size_type col=0; col_num != dsp.row_end (row); ++col_num, ++col) row_indices[col] = *col_num; } - void copy_row (const dealii::SparsityPattern &csp, + void copy_row (const dealii::SparsityPattern &dsp, const size_type row, std::vector &row_indices) { - dealii::SparsityPattern::iterator col_num = csp.begin (row); - for (size_type col=0; col_num != csp.end (row); ++col_num, ++col) + dealii::SparsityPattern::iterator col_num = dsp.begin (row); + for (size_type col=0; col_num != dsp.end (row); ++col_num, ++col) row_indices[col] = col_num->column(); } } diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index f24266e56c..82c86887de 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -168,8 +168,8 @@ void MGTransferPrebuilt::build_matrices ( // increment dofs_per_cell // since a useless diagonal // element will be stored - DynamicSparsityPattern csp (sizes[level+1], - sizes[level]); + DynamicSparsityPattern dsp (sizes[level+1], + sizes[level]); std::vector entries (dofs_per_cell); for (typename DoFHandler::cell_iterator cell=mg_dof.begin(level); cell != mg_dof.end(level); ++cell) @@ -202,7 +202,7 @@ void MGTransferPrebuilt::build_matrices ( for (unsigned int j=0; j::build_matrices ( internal::MatrixSelector::reinit(*prolongation_matrices[level], *prolongation_sparsities[level], level, - csp, + dsp, mg_dof); - csp.reinit(0,0); + dsp.reinit(0,0); FullMatrix prolongation; -- 2.39.5