From 743132042471889b414c1d380eaa617ce875fe4c Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Sun, 22 Mar 2015 10:35:30 -0400 Subject: [PATCH] address comments - rename doxygen file - documentation fixes - rename csp->dsp --- doc/doxygen/headers/distributed.h | 8 +-- doc/doxygen/headers/matrices.h | 62 +++++-------------- ...n.cc => block_dynamic_sparsity_pattern.cc} | 12 ++-- examples/step-11/step-11.cc | 14 ++--- examples/step-12/step-12.cc | 6 +- examples/step-13/step-13.cc | 14 +++-- examples/step-14/step-14.cc | 14 +++-- examples/step-15/step-15.cc | 8 +-- examples/step-16/step-16.cc | 14 ++--- examples/step-2/step-2.cc | 16 ++--- examples/step-20/step-20.cc | 18 +++--- examples/step-22/step-22.cc | 18 +++--- examples/step-23/step-23.cc | 6 +- examples/step-24/step-24.cc | 6 +- examples/step-25/step-25.cc | 6 +- examples/step-26/step-26.cc | 6 +- examples/step-27/step-27.cc | 6 +- examples/step-28/step-28.cc | 8 +-- examples/step-29/step-29.cc | 6 +- examples/step-3/step-3.cc | 6 +- examples/step-31/step-31.cc | 38 ++++++------ examples/step-33/step-33.cc | 8 +-- examples/step-35/step-35.cc | 18 +++--- examples/step-36/step-36.cc | 10 +-- examples/step-38/step-38.cc | 6 +- examples/step-39/step-39.cc | 20 +++--- examples/step-4/step-4.cc | 6 +- examples/step-40/step-40.cc | 8 +-- examples/step-41/step-41.cc | 10 +-- examples/step-43/step-43.cc | 38 ++++++------ examples/step-44/step-44.cc | 26 ++++---- examples/step-45/step-45.cc | 10 +-- examples/step-46/step-46.cc | 8 +-- examples/step-47/step-47.cc | 8 +-- examples/step-5/step-5.cc | 6 +- examples/step-50/step-50.cc | 14 ++--- examples/step-51/step-51.cc | 6 +- examples/step-52/step-52.cc | 6 +- examples/step-6/step-6.cc | 6 +- examples/step-7/step-7.cc | 8 +-- examples/step-8/step-8.cc | 6 +- examples/step-9/step-9.cc | 6 +- include/deal.II/lac/block_sparsity_pattern.h | 19 +++--- .../lac/petsc_parallel_block_sparse_matrix.h | 4 +- .../lac/petsc_parallel_block_sparse_matrix.cc | 28 ++++----- 45 files changed, 277 insertions(+), 300 deletions(-) rename examples/doxygen/{compressed_block_sparsity_pattern.cc => block_dynamic_sparsity_pattern.cc} (89%) diff --git a/doc/doxygen/headers/distributed.h b/doc/doxygen/headers/distributed.h index 4749dc707d..206dd3537a 100644 --- a/doc/doxygen/headers/distributed.h +++ b/doc/doxygen/headers/distributed.h @@ -272,8 +272,8 @@ *
Sparsity patterns
* * At the time of writing this, the only class equipped to deal with the - * situation just explained is CompressedSimpleSparsityPattern. A version of - * the function CompressedSimpleSparsityPattern::reinit() exists that takes an + * situation just explained is DynamicSparsityPattern. A version of + * the function DynamicSparsityPattern::reinit() exists that takes an * IndexSet argument that indicates which lines of the sparsity pattern to * allocate memory for. In other words, it is safe to create such an object * that will report as its size 1 billion, but in fact only stores only as @@ -301,7 +301,7 @@ * When creating the sparsity pattern as well as when assembling the linear * system, we need to know about constraints on degrees of freedom, for * example resulting from hanging nodes or boundary conditions. Like the - * CompressedSimpleSparsityPattern class, the ConstraintMatrix can also take + * DynamicSparsityPattern class, the ConstraintMatrix can also take * an IndexSet upon construction that indicates for which of the possibly very * large number of degrees of freedom it should actually store * constraints. Unlike for the sparsity pattern, these are now only those @@ -323,7 +323,7 @@ * store all necessary constraints on each processor: you will just generate * wrong matrix entries, but the program will not abort. This is opposed to * the situation of the sparsity pattern: there, if the IndexSet passed to the - * CompressedSimpleSparsityPattern indicates that it should store too few rows + * DynamicSparsityPattern indicates that it should store too few rows * of the matrix, the program will either abort when you attempt to write into * matrix entries that do not exist or the matrix class will silently allocate * more memory to accommodate them. As a consequence, it is useful to err on diff --git a/doc/doxygen/headers/matrices.h b/doc/doxygen/headers/matrices.h index a9e6e67a32..1841443030 100644 --- a/doc/doxygen/headers/matrices.h +++ b/doc/doxygen/headers/matrices.h @@ -159,7 +159,7 @@ class MATRIX * locations can be added any more. Only after compression can a sparsity * pattern be associated to a matrix, since the latter requires the efficient * compressed data format of the former. Building a sparsity pattern during - * the dynamic phase often happens with the DoFTools:make_sparsity_pattern() + * the dynamic phase often happens with the DoFTools::make_sparsity_pattern() * function. Although this may appear a restriction, it is typically not a * significant problem to first build a sparsity pattern and then to write * into the matrix only in the previously allocated locations, since in finite @@ -176,7 +176,7 @@ class MATRIX * The main drawback of static sparsity patterns is that their efficient * construction requires a reasonably good guess how many entries each of the * rows may maximally have. During the actual construction, for example in the - * DoFTools:make_sparsity_pattern() function, only at most as many entries can + * DoFTools::make_sparsity_pattern() function, only at most as many entries can * be allocated as previously stated. This is a problem because it is often * difficult to estimate the maximal number of entries per row. Consequently, * a common strategy is to first build and intermediate sparsity pattern that @@ -194,46 +194,23 @@ class MATRIX * with bad estimates requires huge amounts of memory, almost all of which * will not be used and be de-allocated upon compression. * - * To avoid this, deal.II contains a number of "dynamic" or "compressed" - * sparsity patterns that only allocate as much memory as necessary to hold - * the currently added entries. While this saves much memory compared to the - * worst-case behavior mentioned above, it requires the use of less efficient - * storage schemes for insertion of elements, and the frequent allocation of - * memory often also takes significant compute time. The tradeoff to avoid - * excessive memory allocation cannot be avoided, however. - * - * The following classes implement this "dynamic" memory scheme in deal.II: - * - CompressedSparsityPattern - * - CompressedSimpleSparsityPattern - * - CompressedSetSparsityPattern - * - * These classes have different performance characteristics and memory - * requirements. Which one is the "best" changes from case to case because - * it is dependent on the number of dofs, the number of couplings per dof, - * the strategy used to insert and the amount of memory available. - * - * CompressedSparsityPattern and CompressedSimpleSparsityPattern are very - * similar, where CompressedSimpleSparsityPattern trades some memory (requires - * up to twice the memory in the worst case) for additional speed which is - * noticeable in cases with many nonzero entries. CompressedSetSparsityPattern - * on the other hand uses a lot more memory but may perform better in cases with - * many nonzero entries per row. See for example the step-27 - * and step-22 tutorial programs. - * - * As a guideline you should start using CompressedSparsityPattern and try the - * other variants if you run into problems. Switching between them should be as - * simple as changing the class name because all classes have the same interface - * for adding entries. - * In either case, these classes are typically used in the following way - * (replace the class CompressedSparsityPattern with a different one from above): + * To avoid this, deal.II contains a "dynamic" or "compressed" sparsity + * pattern called DynamicSparsityPattern that only allocate as much memory as + * necessary to hold the currently added entries. While this saves much memory + * compared to the worst-case behavior mentioned above, it requires the use of + * less efficient storage schemes for insertion of elements, and the frequent + * allocation of memory often also takes significant compute time. The + * tradeoff to avoid excessive memory allocation cannot be avoided, however. + * + * The class is typically used in the following way * @verbatim - * CompressedSparsityPattern compressed_pattern (dof_handler.n_dofs()); + * DynamicSparsityPattern dsp (dof_handler.n_dofs()); * DoFTools::make_sparsity_pattern (dof_handler, - * compressed_pattern); - * constraints.condense (compressed_pattern); + * dsp); + * constraints.condense (dsp); * * SparsityPattern final_sparsity_pattern; - * final_sparsity_pattern.copy_from (compressed_pattern); + * final_sparsity_pattern.copy_from (dsp); * @endverbatim * * The intermediate, compressed sparsity pattern is directly copied into the @@ -241,13 +218,8 @@ class MATRIX * *

Dynamic block sparsity patterns

* - * The following classes implement an array of dynamic sparsity patterns: - * - BlockCompressedSparsityPattern - * - BlockCompressedSetSparsityPattern - * - BlockCompressedSimpleSparsityPattern - * - * These classes inherit the same tradeoffs regarding their efficiency from - * their non-block classes (see above). See their documentation and + * The class BlockDynamicSparsityPattern implements an array of dynamic + * sparsity patterns for contructing block matrices. See the documentation and * step-22 for more information. * * @ingroup Matrices diff --git a/examples/doxygen/compressed_block_sparsity_pattern.cc b/examples/doxygen/block_dynamic_sparsity_pattern.cc similarity index 89% rename from examples/doxygen/compressed_block_sparsity_pattern.cc rename to examples/doxygen/block_dynamic_sparsity_pattern.cc index 7ade2ed7fb..cedb545fe5 100644 --- a/examples/doxygen/compressed_block_sparsity_pattern.cc +++ b/examples/doxygen/block_dynamic_sparsity_pattern.cc @@ -55,17 +55,17 @@ int main() std::vector dofs_per_block(fe.n_blocks()); DoFTools::count_dofs_per_block(dof, dofs_per_block); - BlockDynamicSparsityPattern c_sparsity(fe.n_blocks(), fe.n_blocks()); + BlockDynamicSparsityPattern dsp(fe.n_blocks(), fe.n_blocks()); for (unsigned int i=0; i // Just this one is new: it declares a class -// DynamicSparsityPattern, which we will use and explain +// DynamicSparsityPattern, which we will use and explain // further down below. #include @@ -202,7 +202,7 @@ namespace Step11 // // Since this can be so difficult that no reasonable answer can be given // that allows allocation of only a reasonable amount of memory, there is - // a class DynamicSparsityPattern, that can help us out + // a class DynamicSparsityPattern, that can help us out // here. It does not require that we know in advance how many entries rows // could have, but allows just about any length. It is thus significantly // more flexible in case you do not have good estimates of row lengths, @@ -215,15 +215,15 @@ namespace Step11 // pattern due to the differential operator, then condense it with the // constraints object which adds those positions in the sparsity pattern // that are required for the elimination of the constraint. - DynamicSparsityPattern csp (dof_handler.n_dofs(), + DynamicSparsityPattern dsp (dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - mean_value_constraints.condense (csp); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + mean_value_constraints.condense (dsp); // Finally, once we have the full pattern, we can initialize an object of // type SparsityPattern from it and in turn initialize the // matrix with it. Note that this is actually necessary, since the - // DynamicSparsityPattern is so inefficient compared to + // DynamicSparsityPattern is so inefficient compared to // the SparsityPattern class due to the more flexible data // structures it has to use, that we can impossibly base the sparse matrix // class on it, but rather need an object of type @@ -236,7 +236,7 @@ namespace Step11 // compressed object right from the start, to which you cannot add new // entries anymore. The compress call is therefore implicit // in the copy_from call. - sparsity_pattern.copy_from (csp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); } diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index 5800662b3c..eb82f05312 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -222,9 +222,9 @@ namespace Step12 // To build the sparsity pattern for DG discretizations, we can call the // function analogue to DoFTools::make_sparsity_pattern, which is called // DoFTools::make_flux_sparsity_pattern: - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_flux_sparsity_pattern (dof_handler, c_sparsity); - sparsity_pattern.copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_flux_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from(dsp); // Finally, we set up the structure of all components of the linear // system. diff --git a/examples/step-13/step-13.cc b/examples/step-13/step-13.cc index 7bc173e742..ffc1df67ca 100644 --- a/examples/step-13/step-13.cc +++ b/examples/step-13/step-13.cc @@ -1033,11 +1033,13 @@ namespace Step13 = &DoFTools::make_hanging_node_constraints; // Start a side task then continue on the main thread - Threads::Task<> side_task(std_cxx11::bind(mhnc_p,std_cxx11::cref(dof_handler), - std_cxx11::ref(hanging_node_constraints))); + Threads::Task<> side_task + = Threads::new_task (mhnc_p, + dof_handler, + hanging_node_constraints); - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); @@ -1045,8 +1047,8 @@ namespace Step13 side_task.join(); hanging_node_constraints.close (); - hanging_node_constraints.condense (csp); - sparsity_pattern.copy_from(csp); + hanging_node_constraints.condense (dsp); + sparsity_pattern.copy_from(dsp); // Finally initialize the matrix and right hand side vector diff --git a/examples/step-14/step-14.cc b/examples/step-14/step-14.cc index 061fa9ee0c..e6c93cea4c 100644 --- a/examples/step-14/step-14.cc +++ b/examples/step-14/step-14.cc @@ -711,11 +711,13 @@ namespace Step14 = &DoFTools::make_hanging_node_constraints; // Start a side task then continue on the main thread - Threads::Task<> side_task(std_cxx11::bind(mhnc_p,std_cxx11::cref(dof_handler), - std_cxx11::ref(hanging_node_constraints))); + Threads::Task<> side_task + = Threads::new_task (mhnc_p, + dof_handler, + hanging_node_constraints); - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); @@ -723,8 +725,8 @@ namespace Step14 side_task.join(); hanging_node_constraints.close (); - hanging_node_constraints.condense (csp); - sparsity_pattern.copy_from(csp); + hanging_node_constraints.condense (dsp); + sparsity_pattern.copy_from(dsp); matrix.reinit (sparsity_pattern); rhs.reinit (dof_handler.n_dofs()); diff --git a/examples/step-15/step-15.cc b/examples/step-15/step-15.cc index 691d7bc761..b92b423341 100644 --- a/examples/step-15/step-15.cc +++ b/examples/step-15/step-15.cc @@ -208,12 +208,12 @@ namespace Step15 newton_update.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); - hanging_node_constraints.condense (c_sparsity); + hanging_node_constraints.condense (dsp); - sparsity_pattern.copy_from(c_sparsity); + sparsity_pattern.copy_from(dsp); system_matrix.reinit (sparsity_pattern); } diff --git a/examples/step-16/step-16.cc b/examples/step-16/step-16.cc index 4c4edee95d..ced76104e6 100644 --- a/examples/step-16/step-16.cc +++ b/examples/step-16/step-16.cc @@ -277,8 +277,8 @@ namespace Step16 ? ")" : ", "); deallog << std::endl; - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); solution.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); @@ -296,8 +296,8 @@ namespace Step16 constraints); constraints.close (); hanging_node_constraints.close (); - constraints.condense (csp); - sparsity_pattern.copy_from (csp); + constraints.condense (dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); // The multigrid constraints have to be initialized. They need to know @@ -343,11 +343,11 @@ namespace Step16 // matrices. for (unsigned int level=0; level &dof_handler) // to initialize this intermediate data structure, we have to give it the // size of the matrix, which in our case will be square with as many rows // and columns as there are degrees of freedom on the grid: - DynamicSparsityPattern compressed_sparsity_pattern(dof_handler.n_dofs(), - dof_handler.n_dofs()); + DynamicSparsityPattern dynamic_sparsity_pattern(dof_handler.n_dofs(), + dof_handler.n_dofs()); // We then fill this object with the places where nonzero elements will be // located given the present numbering of degrees of freedom: - DoFTools::make_sparsity_pattern (dof_handler, compressed_sparsity_pattern); + DoFTools::make_sparsity_pattern (dof_handler, dynamic_sparsity_pattern); // Now we are ready to create the actual sparsity pattern that we could // later use for our matrix. It will just contain the data already assembled // in the DynamicSparsityPattern. SparsityPattern sparsity_pattern; - sparsity_pattern.copy_from (compressed_sparsity_pattern); + sparsity_pattern.copy_from (dynamic_sparsity_pattern); // With this, we can now write the results to a file: std::ofstream out ("sparsity_pattern.1"); @@ -265,12 +265,12 @@ void renumber_dofs (DoFHandler<2> &dof_handler) { DoFRenumbering::Cuthill_McKee (dof_handler); - DynamicSparsityPattern compressed_sparsity_pattern(dof_handler.n_dofs(), - dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, compressed_sparsity_pattern); + DynamicSparsityPattern dynamic_sparsity_pattern(dof_handler.n_dofs(), + dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dynamic_sparsity_pattern); SparsityPattern sparsity_pattern; - sparsity_pattern.copy_from (compressed_sparsity_pattern); + sparsity_pattern.copy_from (dynamic_sparsity_pattern); std::ofstream out ("sparsity_pattern.2"); sparsity_pattern.print_gnuplot (out); diff --git a/examples/step-20/step-20.cc b/examples/step-20/step-20.cc index 81e9c73a97..f3c27e81c4 100644 --- a/examples/step-20/step-20.cc +++ b/examples/step-20/step-20.cc @@ -364,19 +364,19 @@ namespace Step20 // n_u and n_p, which hold the number of velocity // and pressure variables. In the second step we have to instruct the block // system to update its knowledge about the sizes of the blocks it manages; - // this happens with the c_sparsity.collect_sizes () call. - BlockDynamicSparsityPattern c_sparsity(2, 2); - c_sparsity.block(0, 0).reinit (n_u, n_u); - c_sparsity.block(1, 0).reinit (n_p, n_u); - c_sparsity.block(0, 1).reinit (n_u, n_p); - c_sparsity.block(1, 1).reinit (n_p, n_p); - c_sparsity.collect_sizes (); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity); + // this happens with the dsp.collect_sizes () call. + BlockDynamicSparsityPattern dsp(2, 2); + dsp.block(0, 0).reinit (n_u, n_u); + dsp.block(1, 0).reinit (n_p, n_u); + dsp.block(0, 1).reinit (n_u, n_p); + dsp.block(1, 1).reinit (n_p, n_p); + dsp.collect_sizes (); + DoFTools::make_sparsity_pattern (dof_handler, dsp); // We use the compressed block sparsity pattern in the same way as the // non-block version to create the sparsity pattern and then the system // matrix: - sparsity_pattern.copy_from(c_sparsity); + sparsity_pattern.copy_from(dsp); system_matrix.reinit (sparsity_pattern); // Then we have to resize the solution and right hand side vectors in diff --git a/examples/step-22/step-22.cc b/examples/step-22/step-22.cc index ce1458b395..beb787b990 100644 --- a/examples/step-22/step-22.cc +++ b/examples/step-22/step-22.cc @@ -522,20 +522,20 @@ namespace Step22 // in step-11 and step-18. // // All this is done inside a new scope, which - // means that the memory of csp will be released once the + // means that the memory of dsp will be released once the // information has been copied to sparsity_pattern. { - BlockDynamicSparsityPattern csp (2,2); + BlockDynamicSparsityPattern dsp (2,2); - csp.block(0,0).reinit (n_u, n_u); - csp.block(1,0).reinit (n_p, n_u); - csp.block(0,1).reinit (n_u, n_p); - csp.block(1,1).reinit (n_p, n_p); + dsp.block(0,0).reinit (n_u, n_u); + dsp.block(1,0).reinit (n_p, n_u); + dsp.block(0,1).reinit (n_u, n_p); + dsp.block(1,1).reinit (n_p, n_p); - csp.collect_sizes(); + dsp.collect_sizes(); - DoFTools::make_sparsity_pattern (dof_handler, csp, constraints, false); - sparsity_pattern.copy_from (csp); + DoFTools::make_sparsity_pattern (dof_handler, dsp, constraints, false); + sparsity_pattern.copy_from (dsp); } // Finally, the system matrix, solution and right hand side are created diff --git a/examples/step-23/step-23.cc b/examples/step-23/step-23.cc index 429c565d78..76f5ab9089 100644 --- a/examples/step-23/step-23.cc +++ b/examples/step-23/step-23.cc @@ -333,9 +333,9 @@ namespace Step23 << std::endl << std::endl; - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from (dsp); // Then comes a block where we have to initialize the 3 matrices we need // in the course of the program: the mass matrix, the Laplace matrix, and diff --git a/examples/step-24/step-24.cc b/examples/step-24/step-24.cc index 700aeeaaa7..b550073087 100644 --- a/examples/step-24/step-24.cc +++ b/examples/step-24/step-24.cc @@ -290,9 +290,9 @@ namespace Step24 << std::endl << std::endl; - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); mass_matrix.reinit (sparsity_pattern); diff --git a/examples/step-25/step-25.cc b/examples/step-25/step-25.cc index d182d7dd3a..e4566bcdd3 100644 --- a/examples/step-25/step-25.cc +++ b/examples/step-25/step-25.cc @@ -307,9 +307,9 @@ namespace Step25 << dof_handler.n_dofs() << std::endl; - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); mass_matrix.reinit (sparsity_pattern); diff --git a/examples/step-26/step-26.cc b/examples/step-26/step-26.cc index 6d6781f28c..69cd670707 100644 --- a/examples/step-26/step-26.cc +++ b/examples/step-26/step-26.cc @@ -249,12 +249,12 @@ namespace Step26 constraints); constraints.close(); - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, - c_sparsity, + dsp, constraints, /*keep_constrained_dofs = */ true); - sparsity_pattern.copy_from(c_sparsity); + sparsity_pattern.copy_from(dsp); mass_matrix.reinit(sparsity_pattern); laplace_matrix.reinit(sparsity_pattern); diff --git a/examples/step-27/step-27.cc b/examples/step-27/step-27.cc index c1ed5552ab..a3d54b6136 100644 --- a/examples/step-27/step-27.cc +++ b/examples/step-27/step-27.cc @@ -212,10 +212,10 @@ namespace Step27 constraints); constraints.close (); - DynamicSparsityPattern csp (dof_handler.n_dofs(), + DynamicSparsityPattern dsp (dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp, constraints, false); - sparsity_pattern.copy_from (csp); + DoFTools::make_sparsity_pattern (dof_handler, dsp, constraints, false); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); } diff --git a/examples/step-28/step-28.cc b/examples/step-28/step-28.cc index 296fd7dbd4..aec1ef2f64 100644 --- a/examples/step-28/step-28.cc +++ b/examples/step-28/step-28.cc @@ -593,10 +593,10 @@ namespace Step28 system_matrix.clear (); - DynamicSparsityPattern csp(n_dofs, n_dofs); - DoFTools::make_sparsity_pattern (dof_handler, csp); - hanging_node_constraints.condense (csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp(n_dofs, n_dofs); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + hanging_node_constraints.condense (dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-29/step-29.cc b/examples/step-29/step-29.cc index f18b368ae5..d5d4ec69f2 100644 --- a/examples/step-29/step-29.cc +++ b/examples/step-29/step-29.cc @@ -538,9 +538,9 @@ namespace Step29 dof_handler.distribute_dofs (fe); - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); system_rhs.reinit (dof_handler.n_dofs()); diff --git a/examples/step-3/step-3.cc b/examples/step-3/step-3.cc index 60ca98c3b3..2cf3f8dd16 100644 --- a/examples/step-3/step-3.cc +++ b/examples/step-3/step-3.cc @@ -208,9 +208,9 @@ void Step3::setup_system () // first creating a temporary structure, tagging those entries that might be // nonzero, and then copying the data over to the SparsityPattern object // that can then be used by the system matrix. - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity); - sparsity_pattern.copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from(dsp); // Note that the SparsityPattern object does not hold the values of the // matrix, it only stores the places where entries are. The entries diff --git a/examples/step-31/step-31.cc b/examples/step-31/step-31.cc index 7f311fd9cd..8d53da03f5 100644 --- a/examples/step-31/step-31.cc +++ b/examples/step-31/step-31.cc @@ -958,14 +958,14 @@ namespace Step31 { stokes_matrix.clear (); - BlockDynamicSparsityPattern csp (2,2); + BlockDynamicSparsityPattern dsp (2,2); - csp.block(0,0).reinit (n_u, n_u); - csp.block(0,1).reinit (n_u, n_p); - csp.block(1,0).reinit (n_p, n_u); - csp.block(1,1).reinit (n_p, n_p); + dsp.block(0,0).reinit (n_u, n_u); + dsp.block(0,1).reinit (n_u, n_p); + dsp.block(1,0).reinit (n_p, n_u); + dsp.block(1,1).reinit (n_p, n_p); - csp.collect_sizes (); + dsp.collect_sizes (); Table<2,DoFTools::Coupling> coupling (dim+1, dim+1); @@ -976,10 +976,10 @@ namespace Step31 else coupling[c][d] = DoFTools::none; - DoFTools::make_sparsity_pattern (stokes_dof_handler, coupling, csp, + DoFTools::make_sparsity_pattern (stokes_dof_handler, coupling, dsp, stokes_constraints, false); - stokes_matrix.reinit (csp); + stokes_matrix.reinit (dsp); } { @@ -987,14 +987,14 @@ namespace Step31 Mp_preconditioner.reset (); stokes_preconditioner_matrix.clear (); - BlockDynamicSparsityPattern csp (2,2); + BlockDynamicSparsityPattern dsp (2,2); - csp.block(0,0).reinit (n_u, n_u); - csp.block(0,1).reinit (n_u, n_p); - csp.block(1,0).reinit (n_p, n_u); - csp.block(1,1).reinit (n_p, n_p); + dsp.block(0,0).reinit (n_u, n_u); + dsp.block(0,1).reinit (n_u, n_p); + dsp.block(1,0).reinit (n_p, n_u); + dsp.block(1,1).reinit (n_p, n_p); - csp.collect_sizes (); + dsp.collect_sizes (); Table<2,DoFTools::Coupling> coupling (dim+1, dim+1); for (unsigned int c=0; c void ConservationLaw::setup_system () { - DynamicSparsityPattern sparsity_pattern (dof_handler.n_dofs(), - dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); + DynamicSparsityPattern dsp (dof_handler.n_dofs(), + dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); - system_matrix.reinit (sparsity_pattern); + system_matrix.reinit (dsp); } diff --git a/examples/step-35/step-35.cc b/examples/step-35/step-35.cc index 8742441d21..2d4933fb38 100644 --- a/examples/step-35/step-35.cc +++ b/examples/step-35/step-35.cc @@ -791,9 +791,9 @@ namespace Step35 NavierStokesProjection::initialize_velocity_matrices() { { - DynamicSparsityPattern csp(dof_handler_velocity.n_dofs(), dof_handler_velocity.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler_velocity, csp); - sparsity_pattern_velocity.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler_velocity.n_dofs(), dof_handler_velocity.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler_velocity, dsp); + sparsity_pattern_velocity.copy_from (dsp); } vel_Laplace_plus_Mass.reinit (sparsity_pattern_velocity); for (unsigned int d=0; d::initialize_pressure_matrices() { { - DynamicSparsityPattern csp(dof_handler_pressure.n_dofs(), dof_handler_pressure.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler_pressure, csp); - sparsity_pattern_pressure.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler_pressure.n_dofs(), dof_handler_pressure.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler_pressure, dsp); + sparsity_pattern_pressure.copy_from (dsp); } pres_Laplace.reinit (sparsity_pattern_pressure); @@ -847,9 +847,9 @@ namespace Step35 NavierStokesProjection::initialize_gradient_operator() { { - DynamicSparsityPattern csp(dof_handler_velocity.n_dofs(), dof_handler_pressure.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler_velocity, dof_handler_pressure, csp); - sparsity_pattern_pres_vel.copy_from (csp); + DynamicSparsityPattern dsp(dof_handler_velocity.n_dofs(), dof_handler_pressure.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler_velocity, dof_handler_pressure, dsp); + sparsity_pattern_pres_vel.copy_from (dsp); } InitGradPerTaskData per_task_data (0, fe_velocity.dofs_per_cell, diff --git a/examples/step-36/step-36.cc b/examples/step-36/step-36.cc index 6cc02f2e9f..016c174c58 100644 --- a/examples/step-36/step-36.cc +++ b/examples/step-36/step-36.cc @@ -152,12 +152,12 @@ namespace Step36 // previously. One way to do that would be to use code like this: // @code // DynamicSparsityPattern - // csp (dof_handler.n_dofs(), + // dsp (dof_handler.n_dofs(), // dof_handler.n_dofs()); - // DoFTools::make_sparsity_pattern (dof_handler, csp); - // csp.compress (); - // stiffness_matrix.reinit (csp); - // mass_matrix.reinit (csp); + // DoFTools::make_sparsity_pattern (dof_handler, dsp); + // dsp.compress (); + // stiffness_matrix.reinit (dsp); + // mass_matrix.reinit (dsp); // @endcode // instead of the two reinit() calls for the // stiffness and mass matrices below. diff --git a/examples/step-38/step-38.cc b/examples/step-38/step-38.cc index 0bc5e4435a..36720a35a6 100644 --- a/examples/step-38/step-38.cc +++ b/examples/step-38/step-38.cc @@ -341,9 +341,9 @@ namespace Step38 << " degrees of freedom." << std::endl; - DynamicSparsityPattern csp (dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp (dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-39/step-39.cc b/examples/step-39/step-39.cc index 03d5aa97dc..ce4e0e03f1 100644 --- a/examples/step-39/step-39.cc +++ b/examples/step-39/step-39.cc @@ -502,9 +502,9 @@ namespace Step39 // not know the row sizes in advance, we first fill a temporary // DynamicSparsityPattern object and copy it to the regular // SparsityPattern once it is complete. - DynamicSparsityPattern c_sparsity(n_dofs); - DoFTools::make_flux_sparsity_pattern(dof_handler, c_sparsity); - sparsity.copy_from(c_sparsity); + DynamicSparsityPattern dsp(n_dofs); + DoFTools::make_flux_sparsity_pattern(dof_handler, dsp); + sparsity.copy_from(dsp); matrix.reinit(sparsity); const unsigned int n_levels = triangulation.n_levels(); @@ -529,9 +529,9 @@ namespace Step39 { // These are roughly the same lines as above for the global matrix, // now for each level. - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs(level)); - MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level); - mg_sparsity[level].copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern(dof_handler, dsp, level); + mg_sparsity[level].copy_from(dsp); mg_matrix[level].reinit(mg_sparsity[level]); // Additionally, we need to initialize the transfer matrices at the @@ -540,10 +540,10 @@ namespace Step39 // object on level 0. if (level>0) { - 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); - mg_sparsity_dg_interface[level].copy_from(ci_sparsity); + DynamicSparsityPattern dsp; + dsp.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern_edge(dof_handler, dsp, level); + mg_sparsity_dg_interface[level].copy_from(dsp); mg_matrix_dg_up[level].reinit(mg_sparsity_dg_interface[level]); mg_matrix_dg_down[level].reinit(mg_sparsity_dg_interface[level]); } diff --git a/examples/step-4/step-4.cc b/examples/step-4/step-4.cc index a8f06c66cf..b4c7a62cd0 100644 --- a/examples/step-4/step-4.cc +++ b/examples/step-4/step-4.cc @@ -271,9 +271,9 @@ void Step4::setup_system () << dof_handler.n_dofs() << std::endl; - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity); - sparsity_pattern.copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from(dsp); system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-40/step-40.cc b/examples/step-40/step-40.cc index 9dda199522..e03278ce65 100644 --- a/examples/step-40/step-40.cc +++ b/examples/step-40/step-40.cc @@ -315,18 +315,18 @@ namespace Step40 // entries that will exist in that part of the finite element matrix that // it will own. The final step is to initialize the matrix with the // sparsity pattern. - DynamicSparsityPattern csp (locally_relevant_dofs); + DynamicSparsityPattern dsp (locally_relevant_dofs); - DoFTools::make_sparsity_pattern (dof_handler, csp, + DoFTools::make_sparsity_pattern (dof_handler, dsp, constraints, false); - SparsityTools::distribute_sparsity_pattern (csp, + SparsityTools::distribute_sparsity_pattern (dsp, dof_handler.n_locally_owned_dofs_per_processor(), mpi_communicator, locally_relevant_dofs); system_matrix.reinit (locally_owned_dofs, locally_owned_dofs, - csp, + dsp, mpi_communicator); } diff --git a/examples/step-41/step-41.cc b/examples/step-41/step-41.cc index b2211d7e42..981df9e03e 100644 --- a/examples/step-41/step-41.cc +++ b/examples/step-41/step-41.cc @@ -246,14 +246,14 @@ namespace Step41 constraints); constraints.close (); - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); DoFTools::make_sparsity_pattern (dof_handler, - c_sparsity, + dsp, constraints, false); - system_matrix.reinit (c_sparsity); - complete_system_matrix.reinit (c_sparsity); + system_matrix.reinit (dsp); + complete_system_matrix.reinit (dsp); solution.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); @@ -266,7 +266,7 @@ namespace Step41 // diagonal, and in the following then first compute all of this as a // matrix and then extract the diagonal elements for later use: TrilinosWrappers::SparseMatrix mass_matrix; - mass_matrix.reinit (c_sparsity); + mass_matrix.reinit (dsp); assemble_mass_matrix_diagonal (mass_matrix); diagonal_of_mass_matrix.reinit (dof_handler.n_dofs()); for (unsigned int j=0; j coupling (dim+1, dim+1); @@ -755,10 +755,10 @@ namespace Step43 coupling[c][d] = DoFTools::none; - DoFTools::make_sparsity_pattern (darcy_dof_handler, coupling, csp, + DoFTools::make_sparsity_pattern (darcy_dof_handler, coupling, dsp, darcy_constraints, false); - darcy_matrix.reinit (csp); + darcy_matrix.reinit (dsp); } { @@ -766,14 +766,14 @@ namespace Step43 Mp_preconditioner.reset (); darcy_preconditioner_matrix.clear (); - BlockDynamicSparsityPattern csp (2,2); + BlockDynamicSparsityPattern dsp (2,2); - csp.block(0,0).reinit (n_u, n_u); - csp.block(0,1).reinit (n_u, n_p); - csp.block(1,0).reinit (n_p, n_u); - csp.block(1,1).reinit (n_p, n_p); + dsp.block(0,0).reinit (n_u, n_u); + dsp.block(0,1).reinit (n_u, n_p); + dsp.block(1,0).reinit (n_p, n_u); + dsp.block(1,1).reinit (n_p, n_p); - csp.collect_sizes (); + dsp.collect_sizes (); Table<2,DoFTools::Coupling> coupling (dim+1, dim+1); for (unsigned int c=0; c cell_coupling (fe_collection.n_components(), @@ -481,10 +481,10 @@ namespace Step46 face_coupling[c][d] = DoFTools::always; } - DoFTools::make_flux_sparsity_pattern (dof_handler, csp, + DoFTools::make_flux_sparsity_pattern (dof_handler, dsp, cell_coupling, face_coupling); - constraints.condense (csp); - sparsity_pattern.copy_from (csp); + constraints.condense (dsp); + sparsity_pattern.copy_from (dsp); } system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-47/step-47.cc b/examples/step-47/step-47.cc index 3e30d75d92..352091a7f8 100644 --- a/examples/step-47/step-47.cc +++ b/examples/step-47/step-47.cc @@ -259,12 +259,12 @@ namespace Step47 constraints.close(); - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); - constraints.condense (c_sparsity); + constraints.condense (dsp); - sparsity_pattern.copy_from(c_sparsity); + sparsity_pattern.copy_from(dsp); system_matrix.reinit (sparsity_pattern); } diff --git a/examples/step-5/step-5.cc b/examples/step-5/step-5.cc index a808db5c55..cb07bb63a5 100644 --- a/examples/step-5/step-5.cc +++ b/examples/step-5/step-5.cc @@ -270,9 +270,9 @@ void Step5::setup_system () << dof_handler.n_dofs() << std::endl; - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, c_sparsity); - sparsity_pattern.copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + sparsity_pattern.copy_from(dsp); system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-50/step-50.cc b/examples/step-50/step-50.cc index ab47295877..bcbf3a63e0 100644 --- a/examples/step-50/step-50.cc +++ b/examples/step-50/step-50.cc @@ -371,9 +371,9 @@ namespace Step50 constraints.close (); hanging_node_constraints.close (); - DynamicSparsityPattern csp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (mg_dof_handler, csp, constraints); - system_matrix.reinit (mg_dof_handler.locally_owned_dofs(), csp, MPI_COMM_WORLD, true); + DynamicSparsityPattern dsp(mg_dof_handler.n_dofs(), mg_dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (mg_dof_handler, dsp, constraints); + system_matrix.reinit (mg_dof_handler.locally_owned_dofs(), dsp, MPI_COMM_WORLD, true); // The multigrid constraints have to be // initialized. They need to know about @@ -434,18 +434,18 @@ namespace Step50 // matrices. for (unsigned int level=0; level(),constraint_matrix); constraint_matrix.close(); - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern(dof_handler,c_sparsity,constraint_matrix); - sparsity_pattern.copy_from(c_sparsity); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern(dof_handler,dsp,constraint_matrix); + sparsity_pattern.copy_from(dsp); system_matrix.reinit(sparsity_pattern); mass_matrix.reinit(sparsity_pattern); diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index ac0fc3be25..5ce8e02ec5 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -344,9 +344,9 @@ void Step6::setup_system () // constraints after assembling, we would have to pass true // instead because then we would first write into these locations only to // later set them to zero again during condensation. - DynamicSparsityPattern c_sparsity(dof_handler.n_dofs()); + DynamicSparsityPattern dsp(dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, - c_sparsity, + dsp, constraints, /*keep_constrained_dofs = */ false); @@ -354,7 +354,7 @@ void Step6::setup_system () // regularly assembling the matrix and those that were introduced by // eliminating constraints). We can thus copy our intermediate object to the // sparsity pattern: - sparsity_pattern.copy_from(c_sparsity); + sparsity_pattern.copy_from(dsp); // Finally, the so-constructed sparsity pattern serves as the basis on top // of which we will create the sparse matrix: diff --git a/examples/step-7/step-7.cc b/examples/step-7/step-7.cc index 7442ff11c0..d2996618a6 100644 --- a/examples/step-7/step-7.cc +++ b/examples/step-7/step-7.cc @@ -531,10 +531,10 @@ namespace Step7 hanging_node_constraints); hanging_node_constraints.close (); - DynamicSparsityPattern csp (dof_handler.n_dofs(), dof_handler.n_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, csp); - hanging_node_constraints.condense (csp); - sparsity_pattern.copy_from (csp); + DynamicSparsityPattern dsp (dof_handler.n_dofs(), dof_handler.n_dofs()); + DoFTools::make_sparsity_pattern (dof_handler, dsp); + hanging_node_constraints.condense (dsp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-8/step-8.cc b/examples/step-8/step-8.cc index a72fbda2a8..91e0443608 100644 --- a/examples/step-8/step-8.cc +++ b/examples/step-8/step-8.cc @@ -342,12 +342,12 @@ namespace Step8 hanging_node_constraints); hanging_node_constraints.close (); - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, - csp, + dsp, hanging_node_constraints, /*keep_constrained_dofs = */ true); - sparsity_pattern.copy_from (csp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); diff --git a/examples/step-9/step-9.cc b/examples/step-9/step-9.cc index b1610e4049..8b6a8dd0d1 100644 --- a/examples/step-9/step-9.cc +++ b/examples/step-9/step-9.cc @@ -553,12 +553,12 @@ namespace Step9 hanging_node_constraints); hanging_node_constraints.close (); - DynamicSparsityPattern csp(dof_handler.n_dofs(), dof_handler.n_dofs()); + DynamicSparsityPattern dsp(dof_handler.n_dofs(), dof_handler.n_dofs()); DoFTools::make_sparsity_pattern(dof_handler, - csp, + dsp, hanging_node_constraints, /*keep_constrained_dofs = */ true); - sparsity_pattern.copy_from (csp); + sparsity_pattern.copy_from (dsp); system_matrix.reinit (sparsity_pattern); diff --git a/include/deal.II/lac/block_sparsity_pattern.h b/include/deal.II/lac/block_sparsity_pattern.h index e9a6b34e56..c64d5a2684 100644 --- a/include/deal.II/lac/block_sparsity_pattern.h +++ b/include/deal.II/lac/block_sparsity_pattern.h @@ -49,15 +49,15 @@ namespace TrilinosWrappers /** * This is the base class for block versions of the sparsity pattern and - * compressed sparsity pattern classes. It has not much functionality, but - * only administrates an array of sparsity pattern objects and delegates work - * to them. It has mostly the same interface as has the SparsityPattern, - * CompressedSparsityPattern, and CompressedSetSparsityPattern classes, and - * simply transforms calls to its member functions to calls to the respective - * member functions of the member sparsity patterns. + * dynamic sparsity pattern classes. It has not much functionality, but only + * administrates an array of sparsity pattern objects and delegates work to + * them. It has mostly the same interface as has the SparsityPattern, and + * DynamicSparsityPattern, and simply transforms calls to its member functions + * to calls to the respective member functions of the member sparsity + * patterns. * * The largest difference between the SparsityPattern and - * CompressedSparsityPattern classes and this class is that mostly, the + * DynamicSparsityPattern classes and this class is that mostly, the * matrices have different properties and you will want to work on the blocks * making up the matrix rather than the whole matrix. You can access the * different blocks using the block(row,col) function. @@ -469,13 +469,14 @@ public: * the use of block indices causes some additional complications, we give a * short example. * - * @dontinclude compressed_block_sparsity_pattern.cc + * @dontinclude block_dynamic_sparsity_pattern.cc * * After the the DoFHandler dof and the ConstraintMatrix * constraints have been set up with a system element, we must count * the degrees of freedom in each matrix block: * - * @skipline dofs_per_block @until count + * @skipline dofs_per_block + * @until count * * Now, we are ready to set up the BlockDynamicSparsityPattern. * diff --git a/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h b/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h index 61ae9a1bcf..33a5991e2a 100644 --- a/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h +++ b/include/deal.II/lac/petsc_parallel_block_sparse_matrix.h @@ -155,7 +155,7 @@ namespace PETScWrappers */ void reinit(const std::vector &rows, const std::vector &cols, - const BlockDynamicSparsityPattern &bcsp, + const BlockDynamicSparsityPattern &bdsp, const MPI_Comm &com); @@ -163,7 +163,7 @@ namespace PETScWrappers * Same as above but for a symmetric structure only. */ void reinit(const std::vector &sizes, - const BlockDynamicSparsityPattern &bcsp, + const BlockDynamicSparsityPattern &bdsp, const MPI_Comm &com); diff --git a/source/lac/petsc_parallel_block_sparse_matrix.cc b/source/lac/petsc_parallel_block_sparse_matrix.cc index 011f6ecce7..afc0b0ec8b 100644 --- a/source/lac/petsc_parallel_block_sparse_matrix.cc +++ b/source/lac/petsc_parallel_block_sparse_matrix.cc @@ -71,37 +71,37 @@ namespace PETScWrappers BlockSparseMatrix:: reinit(const std::vector &rows, const std::vector &cols, - const BlockDynamicSparsityPattern &bcsp, + const BlockDynamicSparsityPattern &bdsp, const MPI_Comm &com) { - Assert(rows.size() == bcsp.n_block_rows(), ExcMessage("invalid size")); - Assert(cols.size() == bcsp.n_block_cols(), ExcMessage("invalid size")); + Assert(rows.size() == bdsp.n_block_rows(), ExcMessage("invalid size")); + Assert(cols.size() == bdsp.n_block_cols(), ExcMessage("invalid size")); clear(); - this->sub_objects.reinit (bcsp.n_block_rows(), - bcsp.n_block_cols()); + this->sub_objects.reinit (bdsp.n_block_rows(), + bdsp.n_block_cols()); std::vector row_sizes; - for (unsigned int r=0; rrow_block_indices.reinit (row_sizes); std::vector col_sizes; - for (unsigned int c=0; ccolumn_block_indices.reinit (col_sizes); for (unsigned int r=0; rn_block_rows(); ++r) for (unsigned int c=0; cn_block_cols(); ++c) { - Assert(rows[r].size() == bcsp.block(r,c).n_rows(), ExcMessage("invalid size")); - Assert(cols[c].size() == bcsp.block(r,c).n_cols(), ExcMessage("invalid size")); + Assert(rows[r].size() == bdsp.block(r,c).n_rows(), ExcMessage("invalid size")); + Assert(cols[c].size() == bdsp.block(r,c).n_cols(), ExcMessage("invalid size")); BlockType *p = new BlockType(); p->reinit(rows[r], cols[c], - bcsp.block(r,c), + bdsp.block(r,c), com); this->sub_objects[r][c] = p; } @@ -112,10 +112,10 @@ namespace PETScWrappers void BlockSparseMatrix:: reinit(const std::vector &sizes, - const BlockDynamicSparsityPattern &bcsp, + const BlockDynamicSparsityPattern &bdsp, const MPI_Comm &com) { - reinit(sizes, sizes, bcsp, com); + reinit(sizes, sizes, bdsp, com); } -- 2.39.5