* 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
* 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
* 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.
*/
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.
*/
*
* 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
#include <deal.II/lac/trilinos_sparse_matrix.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/full_matrix.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/vector_memory.h>
#include <ostream>
// 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]];
// 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 =
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
*
* @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.
/**
* 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.
*/
* <ul>
* <li> The matrix uses only one MPI process.
* <li> 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).
* <li> The matrix has been initialized from a
* 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.
*
* 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.
* 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.
*
* 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.
* 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
* 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,
* 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
* 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<typename SparsityType>
void
* 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<typename SparsityType>
void
* 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<typename SparsityType>
void
* 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<typename SparsityType>
void
#include <deal.II/lac/vector.h>
#include <deal.II/lac/pointer_matrix.h>
#include <deal.II/lac/sparse_matrix.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/multigrid/mg_base.h>
#include <deal.II/multigrid/mg_tools.h>
#include <deal.II/base/mg_level_object.h>
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]);
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);
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/precondition.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/vector_memory.h>
dealii::Vector<double> 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);
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,
#include <deal.II/lac/sparsity_pattern.h>
#include <deal.II/lac/sparsity_tools.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/dofs/dof_accessor.h>
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);
}
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);
{
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));
}
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);
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/utilities.h>
#include <deal.II/lac/sparsity_pattern.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
-#include <deal.II/lac/compressed_set_sparsity_pattern.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/trilinos_sparsity_pattern.h>
#include <deal.II/lac/block_sparsity_pattern.h>
#include <deal.II/lac/vector.h>
#include <deal.II/base/template_constraints.h>
#include <deal.II/base/utilities.h>
#include <deal.II/lac/sparsity_pattern.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
-#include <deal.II/lac/compressed_set_sparsity_pattern.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/trilinos_sparsity_pattern.h>
#include <deal.II/lac/block_sparsity_pattern.h>
#include <deal.II/lac/vector.h>
#include <deal.II/lac/precondition.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/sparse_matrix.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/lac/sparsity_pattern.h>
#include <deal.II/lac/sparsity_tools.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
#include <deal.II/grid/tria.h>
#include <deal.II/distributed/tria.h>
#include <deal.II/grid/tria_accessor.h>
DoFHandler<dim> 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 ();
#include <deal.II/lac/chunk_sparsity_pattern.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
-#include <deal.II/lac/compressed_set_sparsity_pattern.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/full_matrix.h>
void ChunkSparsityPattern::create_from<DynamicSparsityPattern>
(const unsigned int,
const unsigned int,
- const CompressedSparsityPattern &,
+ const DynamicSparsityPattern &,
const unsigned int,
const bool);
template
// 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...
{
SPARSITY_FUNCTIONS(DynamicSparsityPattern);
template void SparsityTools::distribute_sparsity_pattern
-<BlockCompressedSimpleSparsityPattern>
-(BlockCompressedSimpleSparsityPattern &csp,
+<BlockDynamicSparsityPattern>
+(BlockDynamicSparsityPattern &csp,
const std::vector<IndexSet> &owned_set_per_cpu,
const MPI_Comm &mpi_comm,
const IndexSet &myrange);
std::vector<TrilinosWrappers::types::int_type> 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<last_row; ++row)
#include <deal.II/base/thread_management.h>
#include <deal.II/lac/sparsity_pattern.h>
#include <deal.II/lac/block_sparsity_pattern.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/lac/sparsity_pattern.h>
#include <deal.II/lac/block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
#include <deal.II/lac/block_sparse_matrix.h>
-#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <deal.II/grid/tria.h>
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/dofs/dof_tools.h>
// 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<types::global_dof_index> entries (dofs_per_cell);
for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);
#include <deal.II/lac/arpack_solver.h>
#include <deal.II/lac/sparse_direct.h>
#include <deal.II/lac/sparse_matrix.h>
-#include <deal.II/lac/compressed_sparsity_pattern.h>
+#include <deal.II/lac/dynamic_sparsity_pattern.h>
#include <complex>