From 3f2c7b25d3964c69b622bc63f4b4972cc88c49b9 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Thu, 2 Apr 2015 12:03:37 +0200 Subject: [PATCH] start removing use of CompressedSparsityPattern and friends --- include/deal.II/dofs/dof_tools.h | 14 +++++++------- include/deal.II/lac/chunk_sparsity_pattern.h | 4 ++-- include/deal.II/lac/dynamic_sparsity_pattern.h | 8 ++++---- include/deal.II/lac/sparse_matrix.templates.h | 10 +++++----- include/deal.II/lac/sparsity_pattern.h | 3 +-- include/deal.II/lac/sparsity_tools.h | 4 ++-- include/deal.II/lac/trilinos_sparse_matrix.h | 12 ++++++------ include/deal.II/lac/trilinos_sparsity_pattern.h | 16 +++++++--------- .../deal.II/multigrid/sparse_matrix_collection.h | 6 +++--- .../deal.II/numerics/vector_tools.templates.h | 7 +++---- source/dofs/dof_renumbering.cc | 10 +++++----- source/dofs/dof_tools.cc | 4 +--- source/dofs/dof_tools_sparsity.cc | 4 +--- source/grid/grid_tools.cc | 5 ++--- source/lac/chunk_sparsity_pattern.cc | 6 ++---- source/lac/constraint_matrix.cc | 2 +- source/lac/sparsity_tools.cc | 4 ++-- source/lac/trilinos_sparsity_pattern.cc | 2 +- source/multigrid/mg_tools.cc | 2 +- source/multigrid/mg_transfer_prebuilt.cc | 4 ++-- tests/arpack/step-36_ar.cc | 2 +- 21 files changed, 59 insertions(+), 70 deletions(-) diff --git a/include/deal.II/dofs/dof_tools.h b/include/deal.II/dofs/dof_tools.h index 686d50efb3..719e45110f 100644 --- a/include/deal.II/dofs/dof_tools.h +++ b/include/deal.II/dofs/dof_tools.h @@ -362,9 +362,9 @@ namespace DoFTools * Remember using SparsityPattern::compress() after generating the pattern. * * The actual type of the sparsity pattern may be SparsityPattern, - * CompressedSparsityPattern, BlockSparsityPattern, - * BlockCompressedSparsityPattern, BlockCompressedSetSparsityPattern, - * BlockCompressedSimpleSparsityPattern, or any other class that satisfies + * DynamicSparsityPattern, BlockSparsityPattern, + * BlockDynamicSparsityPattern, BlockDynamicSetSparsityPattern, + * BlockDynamicSimpleSparsityPattern, 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 @@ -446,8 +446,8 @@ namespace DoFTools * resulting sparsity pattern. * * The actual type of the sparsity pattern may be SparsityPattern, - * CompressedSparsityPattern, BlockSparsityPattern, - * BlockCompressedSparsityPattern, BlockCompressedSetSparsityPattern, or any + * DynamicSparsityPattern, BlockSparsityPattern, + * BlockDynamicSparsityPattern, BlockDynamicSetSparsityPattern, or any * other class that satisfies similar requirements. * * There is a complication if some or all of the shape functions of the @@ -529,8 +529,8 @@ namespace DoFTools * documentation of this class for more information. * * The actual type of the sparsity pattern may be SparsityPattern, - * CompressedSparsityPattern, BlockSparsityPattern, - * BlockCompressedSparsityPattern, BlockCompressedSetSparsityPattern, or any + * DynamicSparsityPattern, BlockSparsityPattern, + * BlockDynamicSparsityPattern, BlockDynamicSetSparsityPattern, or any * other class that satisfies similar requirements. It is assumed that the * size of the sparsity pattern is already correct. */ diff --git a/include/deal.II/lac/chunk_sparsity_pattern.h b/include/deal.II/lac/chunk_sparsity_pattern.h index 654f8a2893..7d506e52e3 100644 --- a/include/deal.II/lac/chunk_sparsity_pattern.h +++ b/include/deal.II/lac/chunk_sparsity_pattern.h @@ -481,8 +481,8 @@ public: const size_type chunk_size); /** - * Copy data from an object of type CompressedSparsityPattern, - * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern. Previous + * Copy data from an object of type DynamicSparsityPattern, + * DynamicSetSparsityPattern or DynamicSimpleSparsityPattern. Previous * content of this object is lost, and the sparsity pattern is in compressed * mode afterwards. */ diff --git a/include/deal.II/lac/dynamic_sparsity_pattern.h b/include/deal.II/lac/dynamic_sparsity_pattern.h index 4078822cfc..086493e33d 100644 --- a/include/deal.II/lac/dynamic_sparsity_pattern.h +++ b/include/deal.II/lac/dynamic_sparsity_pattern.h @@ -70,13 +70,13 @@ template class SparseMatrix; * * Use this class as follows: * @code - * DynamicSparsityPattern compressed_pattern (dof_handler.n_dofs()); + * DynamicSparsityPattern dynamic_pattern (dof_handler.n_dofs()); * DoFTools::make_sparsity_pattern (dof_handler, - * compressed_pattern); - * constraints.condense (compressed_pattern); + * dynamic_pattern); + * constraints.condense (dynamic_pattern); * * SparsityPattern sp; - * sp.copy_from (compressed_pattern); + * sp.copy_from (dynamic_pattern); * @endcode * * @author Timo Heister, 2008 diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index a912d13c43..e75b33427f 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include @@ -967,9 +967,9 @@ SparseMatrix::mmult (SparseMatrix &C, // rows in the matrix A, and for each column in a row we add the whole // row of matrix B with that row number. This means that we will insert // a lot of entries to each row, which is best handled by the - // CompressedSimpleSparsityPattern class. + // DynamicSparsityPattern class. { - CompressedSimpleSparsityPattern csp (m(), B.n()); + DynamicSparsityPattern csp (m(), B.n()); for (size_type i = 0; i < csp.n_rows(); ++i) { const size_type *rows = &sp_A.colnums[sp_A.rowstart[i]]; @@ -1094,9 +1094,9 @@ SparseMatrix::Tmmult (SparseMatrix &C, // rows in the matrix A, and for each column in a row we add the whole // row of matrix B with that row number. This means that we will insert // a lot of entries to each row, which is best handled by the - // CompressedSimpleSparsityPattern class. + // DynamicSparsityPattern class. { - CompressedSimpleSparsityPattern csp (n(), B.n()); + DynamicSparsityPattern csp (n(), B.n()); for (size_type i = 0; i < sp_A.n_rows(); ++i) { const size_type *rows = diff --git a/include/deal.II/lac/sparsity_pattern.h b/include/deal.II/lac/sparsity_pattern.h index eac33c0f2d..1fa680ce9d 100644 --- a/include/deal.II/lac/sparsity_pattern.h +++ b/include/deal.II/lac/sparsity_pattern.h @@ -623,8 +623,7 @@ public: const ForwardIterator end); /** - * Copy data from an object of type CompressedSparsityPattern, - * CompressedSetSparsityPattern or CompressedSimpleSparsityPattern. Although + * Copy data from an object of type DynamicSparsityPattern. Although * not a compressed sparsity pattern, this function is also instantiated if * the argument is of type SparsityPattern (i.e., the current class). * Previous content of this object is lost, and the sparsity pattern is in diff --git a/include/deal.II/lac/sparsity_tools.h b/include/deal.II/lac/sparsity_tools.h index 3741f6328d..91f7f66ba6 100644 --- a/include/deal.II/lac/sparsity_tools.h +++ b/include/deal.II/lac/sparsity_tools.h @@ -152,7 +152,7 @@ namespace SparsityTools * * @param myrange indicates the range of elements stored locally and should * be the one used in the constructor of the - * CompressedSimpleSparsityPattern. This should be the locally relevant + * DynamicSparsityPattern. This should be the locally relevant * set. Only rows contained in myrange are checked in csp for transfer. * This function needs to be used with PETScWrappers::MPI::SparseMatrix for * it to work correctly in a parallel computation. @@ -165,7 +165,7 @@ namespace SparsityTools /** * similar to the function above, but includes support for - * BlockCompressedSimpleSparsityPattern. @p owned_set_per_cpu is typically + * BlockDynamicSparsityPattern. @p owned_set_per_cpu is typically * DoFHandler::locally_owned_dofs_per_processor and @p myrange are * locally_relevant_dofs. */ diff --git a/include/deal.II/lac/trilinos_sparse_matrix.h b/include/deal.II/lac/trilinos_sparse_matrix.h index 87e0d4a9f9..fe1d1cba64 100644 --- a/include/deal.II/lac/trilinos_sparse_matrix.h +++ b/include/deal.II/lac/trilinos_sparse_matrix.h @@ -460,7 +460,7 @@ namespace TrilinosWrappers *
    *
  • The matrix uses only one MPI process. *
  • The matrix has been initialized with the reinit() method with a - * CompressedSimpleSparsityPattern (that includes the set of locally + * DynamicSparsityPattern (that includes the set of locally * relevant rows, i.e., the rows that an assembly routine will possibly * write into). *
  • The matrix has been initialized from a @@ -722,11 +722,11 @@ namespace TrilinosWrappers * optional argument @p exchange_data can be used for reinitialization * with a sparsity pattern that is not fully constructed. This feature is * only implemented for input sparsity patterns of type - * CompressedSimpleSparsityPattern. If the flag is not set, each processor + * DynamicSparsityPattern. If the flag is not set, each processor * just sets the elements in the sparsity pattern that belong to its rows. * * If the sparsity pattern given to this function is of type - * CompressedSimpleSparsity pattern, then a matrix will be created that + * DynamicSparsity pattern, then a matrix will be created that * allows several threads to write into different rows of the matrix at * the same also with MPI, as opposed to most other reinit() methods. * @@ -745,7 +745,7 @@ namespace TrilinosWrappers * optional argument @p exchange_data can be used for reinitialization * with a sparsity pattern that is not fully constructed. This feature is * only implemented for input sparsity patterns of type - * CompressedSimpleSparsityPattern. + * DynamicSparsityPattern. * * This is a collective operation that needs to be called on all * processors in order to avoid a dead lock. @@ -882,7 +882,7 @@ namespace TrilinosWrappers * to the deal.II own object. The optional argument @p exchange_data can * be used for reinitialization with a sparsity pattern that is not fully * constructed. This feature is only implemented for input sparsity - * patterns of type CompressedSimpleSparsityPattern. If the flag is not + * patterns of type DynamicSparsityPattern. If the flag is not * set, each processor just sets the elements in the sparsity pattern that * belong to its rows. * @@ -902,7 +902,7 @@ namespace TrilinosWrappers * optional argument @p exchange_data can be used for reinitialization * with a sparsity pattern that is not fully constructed. This feature is * only implemented for input sparsity patterns of type - * CompressedSimpleSparsityPattern. + * DynamicSparsityPattern. * * This is a collective operation that needs to be called on all * processors in order to avoid a dead lock. diff --git a/include/deal.II/lac/trilinos_sparsity_pattern.h b/include/deal.II/lac/trilinos_sparsity_pattern.h index 86a9fe81a3..a23bcbc993 100644 --- a/include/deal.II/lac/trilinos_sparsity_pattern.h +++ b/include/deal.II/lac/trilinos_sparsity_pattern.h @@ -255,9 +255,7 @@ namespace TrilinosWrappers * with the difference that this class can work fully in %parallel according * to a partitioning of the sparsity pattern rows. * - * This class has many similarities to the compressed sparsity pattern - * classes of deal.II (i.e., the classes CompressedSparsityPattern, - * CompressedSetSparsityPattern, and CompressedSimpleSparsityPattern), since + * This class has many similarities to the DynamicSparsityPattern, since * it can dynamically add elements to the pattern without any memory being * previously reserved for it. However, it also has a method * SparsityPattern::compress(), that finalizes the pattern and enables its @@ -301,7 +299,7 @@ namespace TrilinosWrappers * not have this kind of information before building the sparsity pattern * (the usual case when the function DoFTools::make_sparsity_pattern() is * called). The entries are allocated dynamically in a similar manner as - * for the deal.II CompressedSparsityPattern classes. However, a good + * for the deal.II DynamicSparsityPattern classes. However, a good * estimate will reduce the setup time of the sparsity pattern. */ SparsityPattern (const size_type m, @@ -339,7 +337,7 @@ namespace TrilinosWrappers * The number of columns entries per row is specified as the maximum * number of entries argument. This does not need to be an accurate * number since the entries are allocated dynamically in a similar manner - * as for the deal.II CompressedSparsityPattern classes, but a good + * as for the deal.II DynamicSparsityPattern classes, but a good * estimate will reduce the setup time of the sparsity pattern. */ void @@ -547,7 +545,7 @@ namespace TrilinosWrappers * current Trilinos sparsity pattern. The optional argument @p * exchange_data can be used for reinitialization with a sparsity pattern * that is not fully constructed. This feature is only implemented for - * input sparsity patterns of type CompressedSimpleSparsityPattern. + * input sparsity patterns of type DynamicSparsityPattern. */ template void @@ -562,7 +560,7 @@ namespace TrilinosWrappers * current Trilinos sparsity pattern. The optional argument @p * exchange_data can be used for reinitialization with a sparsity pattern * that is not fully constructed. This feature is only implemented for - * input sparsity patterns of type CompressedSimpleSparsityPattern. + * input sparsity patterns of type DynamicSparsityPattern. */ template void @@ -777,7 +775,7 @@ namespace TrilinosWrappers * sparsity pattern. The optional argument @p exchange_data can be used * for reinitialization with a sparsity pattern that is not fully * constructed. This feature is only implemented for input sparsity - * patterns of type CompressedSimpleSparsityPattern. + * patterns of type DynamicSparsityPattern. */ template void @@ -793,7 +791,7 @@ namespace TrilinosWrappers * current Trilinos sparsity pattern. The optional argument @p * exchange_data can be used for reinitialization with a sparsity pattern * that is not fully constructed. This feature is only implemented for - * input sparsity patterns of type CompressedSimpleSparsityPattern. + * input sparsity patterns of type DynamicSparsityPattern. */ template void diff --git a/include/deal.II/multigrid/sparse_matrix_collection.h b/include/deal.II/multigrid/sparse_matrix_collection.h index 2db9c42d3f..39dd085a9c 100644 --- a/include/deal.II/multigrid/sparse_matrix_collection.h +++ b/include/deal.II/multigrid/sparse_matrix_collection.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include @@ -87,7 +87,7 @@ namespace mg for (unsigned int level=sparsity.min_level(); level<=sparsity.max_level(); ++level) { - CompressedSparsityPattern c_sparsity(dof_handler.n_dofs(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); matrix[level].reinit(sparsity[level]); @@ -95,7 +95,7 @@ namespace mg matrix_out[level].reinit(sparsity[level]); if (level>0) { - CompressedSparsityPattern ci_sparsity; + DynamicSparsityPattern ci_sparsity; ci_sparsity.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level)); MGTools::make_flux_sparsity_pattern_edge(dof_handler, ci_sparsity, level); sparsity_edge[level].copy_from(ci_sparsity); diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 8f0492ec33..652f62a726 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -29,8 +29,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -753,7 +752,7 @@ namespace VectorTools dealii::Vector vec (dof.n_dofs()); SparsityPattern sparsity; { - CompressedSimpleSparsityPattern csp (dof.n_dofs(), dof.n_dofs()); + DynamicSparsityPattern csp (dof.n_dofs(), dof.n_dofs()); DoFTools::make_sparsity_pattern (dof, csp, constraints, !constraints_are_compatible); @@ -2177,7 +2176,7 @@ namespace VectorTools return; // set up sparsity structure - CompressedSparsityPattern c_sparsity(dof.n_boundary_dofs (boundary_functions), + DynamicSparsityPattern c_sparsity(dof.n_boundary_dofs (boundary_functions), dof.n_boundary_dofs (boundary_functions)); DoFTools::make_boundary_sparsity_pattern (dof, boundary_functions, diff --git a/source/dofs/dof_renumbering.cc b/source/dofs/dof_renumbering.cc index 9a3e5e6bcd..d22b3c2090 100644 --- a/source/dofs/dof_renumbering.cc +++ b/source/dofs/dof_renumbering.cc @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include @@ -101,7 +101,7 @@ namespace DoFRenumbering if (use_constraints) DoFTools::make_hanging_node_constraints (dof_handler, constraints); constraints.close (); - CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(), + DynamicSparsityPattern csp (dof_handler.n_dofs(), dof_handler.n_dofs()); DoFTools::make_sparsity_pattern (dof_handler, csp, constraints); @@ -411,7 +411,7 @@ namespace DoFRenumbering } else { - CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(), + DynamicSparsityPattern csp (dof_handler.n_dofs(), dof_handler.n_dofs(), dof_handler.locally_owned_dofs()); DoFTools::make_sparsity_pattern (dof_handler, csp, constraints); @@ -433,7 +433,7 @@ namespace DoFRenumbering { const types::global_dof_index row = locally_owned.nth_index_in_set(i); row_entries.resize(0); - for (CompressedSimpleSparsityPattern::row_iterator it = + for (DynamicSparsityPattern::row_iterator it = csp.row_begin(row); it != csp.row_end(row); ++it) if (*it != row && locally_owned.is_element(*it)) row_entries.push_back(locally_owned.index_within_set(*it)); @@ -487,7 +487,7 @@ namespace DoFRenumbering } else { - CompressedSimpleSparsityPattern csp (dof_handler.n_dofs(level), + DynamicSparsityPattern csp (dof_handler.n_dofs(level), dof_handler.n_dofs(level)); MGTools::make_sparsity_pattern (dof_handler, csp, level); sparsity.copy_from (csp); diff --git a/source/dofs/dof_tools.cc b/source/dofs/dof_tools.cc index 76a7a9ee4f..8848982ab1 100644 --- a/source/dofs/dof_tools.cc +++ b/source/dofs/dof_tools.cc @@ -19,9 +19,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff --git a/source/dofs/dof_tools_sparsity.cc b/source/dofs/dof_tools_sparsity.cc index a907ee60bc..b377639e91 100644 --- a/source/dofs/dof_tools_sparsity.cc +++ b/source/dofs/dof_tools_sparsity.cc @@ -19,9 +19,7 @@ #include #include #include -#include -#include -#include +#include #include #include #include diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 5401887b7a..59329c5b99 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -22,11 +22,10 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -693,7 +692,7 @@ namespace GridTools DoFHandler dof_handler(triangulation); dof_handler.distribute_dofs(q1); - CompressedSparsityPattern c_sparsity_pattern (dof_handler.n_dofs (), + 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 (); diff --git a/source/lac/chunk_sparsity_pattern.cc b/source/lac/chunk_sparsity_pattern.cc index 4c22a45ba0..3a03a470ee 100644 --- a/source/lac/chunk_sparsity_pattern.cc +++ b/source/lac/chunk_sparsity_pattern.cc @@ -15,9 +15,7 @@ #include -#include -#include -#include +#include #include @@ -626,7 +624,7 @@ template void ChunkSparsityPattern::create_from (const unsigned int, const unsigned int, - const CompressedSparsityPattern &, + const DynamicSparsityPattern &, const unsigned int, const bool); template diff --git a/source/lac/constraint_matrix.cc b/source/lac/constraint_matrix.cc index 3da83d75d1..479d9f1894 100644 --- a/source/lac/constraint_matrix.cc +++ b/source/lac/constraint_matrix.cc @@ -965,7 +965,7 @@ void ConstraintMatrix::condense (BlockDynamicSparsityPattern &sparsity) const // the loop over cols may get longer. // // don't try to be clever here as in the algorithm for the - // CompressedSparsityPattern, as that would be much more + // DynamicSparsityPattern, as that would be much more // complicated here. after all, we know that compressed patterns // are inefficient... { diff --git a/source/lac/sparsity_tools.cc b/source/lac/sparsity_tools.cc index 492ee1589c..87ac00e897 100644 --- a/source/lac/sparsity_tools.cc +++ b/source/lac/sparsity_tools.cc @@ -643,8 +643,8 @@ namespace SparsityTools SPARSITY_FUNCTIONS(DynamicSparsityPattern); template void SparsityTools::distribute_sparsity_pattern - -(BlockCompressedSimpleSparsityPattern &csp, + +(BlockDynamicSparsityPattern &csp, const std::vector &owned_set_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange); diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index f348004b2e..5ab4ea8dd1 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -628,7 +628,7 @@ namespace TrilinosWrappers std::vector row_indices; // Include possibility to exchange data - // since CompressedSimpleSparsityPattern is + // since DynamicSparsityPattern is // able to do so if (exchange_data==false) for (size_type row=first_row; row #include #include -#include +#include #include #include #include diff --git a/source/multigrid/mg_transfer_prebuilt.cc b/source/multigrid/mg_transfer_prebuilt.cc index 1c206120eb..f24266e56c 100644 --- a/source/multigrid/mg_transfer_prebuilt.cc +++ b/source/multigrid/mg_transfer_prebuilt.cc @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -168,7 +168,7 @@ void MGTransferPrebuilt::build_matrices ( // increment dofs_per_cell // since a useless diagonal // element will be stored - CompressedSimpleSparsityPattern csp (sizes[level+1], + DynamicSparsityPattern csp (sizes[level+1], sizes[level]); std::vector entries (dofs_per_cell); for (typename DoFHandler::cell_iterator cell=mg_dof.begin(level); diff --git a/tests/arpack/step-36_ar.cc b/tests/arpack/step-36_ar.cc index 400c7c344e..13592789dc 100644 --- a/tests/arpack/step-36_ar.cc +++ b/tests/arpack/step-36_ar.cc @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include -- 2.39.5