*
* @ingroup constraints
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity_pattern,
+ SP &sparsity_pattern,
const ConstraintMatrix &constraints = ConstraintMatrix(),
const bool keep_constrained_dofs = true,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
*
* @ingroup constraints
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_sparsity_pattern (const DH &dof,
const Table<2, Coupling> &coupling,
- SparsityPattern &sparsity_pattern,
+ SP &sparsity_pattern,
const ConstraintMatrix &constraints = ConstraintMatrix(),
const bool keep_constrained_dofs = true,
const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id);
* whereas the ones that correspond to columns come from the second
* DoFHandler.
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_sparsity_pattern (const DH &dof_row,
const DH &dof_col,
- SparsityPattern &sparsity);
+ SP &sparsity);
/**
* Create the sparsity pattern for boundary matrices. See the general
* class that satisfies similar requirements. It is assumed that the size of
* the sparsity pattern is already correct.
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_boundary_sparsity_pattern (const DH &dof,
const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- SparsityPattern &sparsity_pattern);
+ SP &sparsity_pattern);
/**
* Write the sparsity structure of the matrix composed of the basis
*
* For the type of the sparsity pattern, the same holds as said above.
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_boundary_sparsity_pattern (const DH &dof,
const typename FunctionMap<DH::space_dimension>::type &boundary_ids,
const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- SparsityPattern &sparsity);
+ SP &sparsity);
/**
* Generate sparsity pattern for fluxes, i.e. formulations of the discrete
* neighboring elements, the normal couplings and these extra matrix entries
* are considered.
*/
- template<class DH, class SparsityPattern>
+ template<class DH, class SP>
void
- make_flux_sparsity_pattern (const DH &dof_handler,
- SparsityPattern &sparsity_pattern);
+ make_flux_sparsity_pattern (const DH &dof_handler,
+ SP &sparsity_pattern);
/**
* This function does the same as the other with the same name, but it gets
*
* @ingroup constraints
*/
- template<class DH, class SparsityPattern>
+ template<class DH, class SP>
void
make_flux_sparsity_pattern (const DH &dof_handler,
- SparsityPattern &sparsity_pattern,
+ SP &sparsity_pattern,
const ConstraintMatrix &constraints,
const bool keep_constrained_dofs = true,
const types::subdomain_id subdomain_id = numbers::invalid_unsigned_int);
*
* @todo Not implemented for hp::DoFHandler.
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_flux_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
+ SP &sparsity,
const Table<2,Coupling> &int_mask,
const Table<2,Coupling> &flux_mask);
* @ref GlossBlockLA "Block (linear algebra)"
* @author Wolfgang Bangerth, 2000, 2001
*/
-template <class SparsityPatternBase>
+template <class SP>
class BlockSparsityPatternBase : public Subscriptor
{
public:
/**
* Access the block with the given coordinates.
*/
- SparsityPatternBase &
+ SP &
block (const size_type row,
const size_type column);
* Access the block with the given coordinates. Version for constant
* objects.
*/
- const SparsityPatternBase &
+ const SP &
block (const size_type row,
const size_type column) const;
/**
* Array of sparsity patterns.
*/
- Table<2,SmartPointer<SparsityPatternBase, BlockSparsityPatternBase<SparsityPatternBase> > > sub_objects;
+ Table<2,SmartPointer<SP, BlockSparsityPatternBase<SP> > > sub_objects;
/**
* Object storing and managing the transformation of row indices to indices
-template <class SparsityPatternBase>
+template <class SP>
inline
-SparsityPatternBase &
-BlockSparsityPatternBase<SparsityPatternBase>::block (const size_type row,
- const size_type column)
+SP &
+BlockSparsityPatternBase<SP>::block (const size_type row,
+ const size_type column)
{
Assert (row<rows, ExcIndexRange(row,0,rows));
Assert (column<columns, ExcIndexRange(column,0,columns));
-template <class SparsityPatternBase>
+template <class SP>
inline
-const SparsityPatternBase &
-BlockSparsityPatternBase<SparsityPatternBase>::block (const size_type row,
- const size_type column) const
+const SP &
+BlockSparsityPatternBase<SP>::block (const size_type row,
+ const size_type column) const
{
Assert (row<rows, ExcIndexRange(row,0,rows));
Assert (column<columns, ExcIndexRange(column,0,columns));
-template <class SparsityPatternBase>
+template <class SP>
inline
const BlockIndices &
-BlockSparsityPatternBase<SparsityPatternBase>::get_row_indices () const
+BlockSparsityPatternBase<SP>::get_row_indices () const
{
return row_indices;
}
-template <class SparsityPatternBase>
+template <class SP>
inline
const BlockIndices &
-BlockSparsityPatternBase<SparsityPatternBase>::get_column_indices () const
+BlockSparsityPatternBase<SP>::get_column_indices () const
{
return column_indices;
}
-template <class SparsityPatternBase>
+template <class SP>
inline
void
-BlockSparsityPatternBase<SparsityPatternBase>::add (const size_type i,
- const size_type j)
+BlockSparsityPatternBase<SP>::add (const size_type i,
+ const size_type j)
{
// if you get an error here, are
// you sure you called
-template <class SparsityPatternBase>
+template <class SP>
template <typename ForwardIterator>
void
-BlockSparsityPatternBase<SparsityPatternBase>::add_entries (const size_type row,
- ForwardIterator begin,
- ForwardIterator end,
- const bool indices_are_sorted)
+BlockSparsityPatternBase<SP>::add_entries (const size_type row,
+ ForwardIterator begin,
+ ForwardIterator end,
+ const bool indices_are_sorted)
{
// Resize scratch arrays
if (block_column_indices.size() < this->n_block_cols())
-template <class SparsityPatternBase>
+template <class SP>
inline
bool
-BlockSparsityPatternBase<SparsityPatternBase>::exists (const size_type i,
- const size_type j) const
+BlockSparsityPatternBase<SP>::exists (const size_type i,
+ const size_type j) const
{
// if you get an error here, are
// you sure you called
-template <class SparsityPatternBase>
+template <class SP>
inline
unsigned int
-BlockSparsityPatternBase<SparsityPatternBase>::
+BlockSparsityPatternBase<SP>::
row_length (const size_type row) const
{
const std::pair<size_type , size_type>
-template <class SparsityPatternBase>
+template <class SP>
inline
-typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
-BlockSparsityPatternBase<SparsityPatternBase>::n_block_cols () const
+typename BlockSparsityPatternBase<SP>::size_type
+BlockSparsityPatternBase<SP>::n_block_cols () const
{
return columns;
}
-template <class SparsityPatternBase>
+template <class SP>
inline
-typename BlockSparsityPatternBase<SparsityPatternBase>::size_type
-BlockSparsityPatternBase<SparsityPatternBase>::n_block_rows () const
+typename BlockSparsityPatternBase<SP>::size_type
+BlockSparsityPatternBase<SP>::n_block_rows () const
{
return rows;
}
* There is no need to consider hanging nodes here, since only one level is
* considered.
*/
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
- make_sparsity_pattern (const DH &dof_handler,
- SparsityPattern &sparsity,
- const unsigned int level);
+ make_sparsity_pattern (const DH &dof_handler,
+ SP &sparsity,
+ const unsigned int level);
/**
* Make a sparsity pattern including fluxes of discontinuous Galerkin
* and
* @ref DoFTools
*/
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
make_flux_sparsity_pattern (const DoFHandler<dim,spacedim> &dof_handler,
- SparsityPattern &sparsity,
- const unsigned int level);
+ SP &sparsity,
+ const unsigned int level);
/**
* Create sparsity pattern for the fluxes at refinement edges. The matrix
*
* make_flux_sparsity_pattern()
*/
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
make_flux_sparsity_pattern_edge (const DoFHandler<dim,spacedim> &dof_handler,
- SparsityPattern &sparsity,
- const unsigned int level);
+ SP &sparsity,
+ const unsigned int level);
/**
* This function does the same as the other with the same name, but it gets
* two additional coefficient matrices. A matrix entry will only be
* There is one matrix for couplings in a cell and one for the couplings
* occurring in fluxes.
*/
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
- make_flux_sparsity_pattern (const DoFHandler<dim,spacedim> &dof,
- SparsityPattern &sparsity,
- const unsigned int level,
+ make_flux_sparsity_pattern (const DoFHandler<dim,spacedim> &dof,
+ SP &sparsity,
+ const unsigned int level,
const Table<2,DoFTools::Coupling> &int_mask,
const Table<2,DoFTools::Coupling> &flux_mask);
*
* make_flux_sparsity_pattern()
*/
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
- make_flux_sparsity_pattern_edge (const DoFHandler<dim,spacedim> &dof_handler,
- SparsityPattern &sparsity,
- const unsigned int level,
+ make_flux_sparsity_pattern_edge (const DoFHandler<dim,spacedim> &dof_handler,
+ SP &sparsity,
+ const unsigned int level,
const Table<2,DoFTools::Coupling> &flux_mask);
/**
namespace DoFTools
{
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
- make_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
- const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs,
- const types::subdomain_id subdomain_id)
+ make_sparsity_pattern (const DH &dof,
+ SP &sparsity,
+ const ConstraintMatrix &constraints,
+ const bool keep_constrained_dofs,
+ const types::subdomain_id subdomain_id)
{
const types::global_dof_index n_dofs = dof.n_dofs();
(void)n_dofs;
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
- make_sparsity_pattern (const DH &dof,
- const Table<2,Coupling> &couplings,
- SparsityPattern &sparsity,
- const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs,
- const types::subdomain_id subdomain_id)
+ make_sparsity_pattern (const DH &dof,
+ const Table<2,Coupling> &couplings,
+ SP &sparsity,
+ const ConstraintMatrix &constraints,
+ const bool keep_constrained_dofs,
+ const types::subdomain_id subdomain_id)
{
const types::global_dof_index n_dofs = dof.n_dofs();
(void)n_dofs;
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
- make_sparsity_pattern (
- const DH &dof_row,
- const DH &dof_col,
- SparsityPattern &sparsity)
+ make_sparsity_pattern (const DH &dof_row,
+ const DH &dof_col,
+ SP &sparsity)
{
const types::global_dof_index n_dofs_row = dof_row.n_dofs();
const types::global_dof_index n_dofs_col = dof_col.n_dofs();
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
- make_boundary_sparsity_pattern (
- const DH &dof,
- const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- SparsityPattern &sparsity)
+ make_boundary_sparsity_pattern
+ (const DH &dof,
+ const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
+ SP &sparsity)
{
if (DH::dimension == 1)
{
typename DH::FunctionMap boundary_ids;
boundary_ids[0] = 0;
boundary_ids[1] = 0;
- make_boundary_sparsity_pattern<DH, SparsityPattern> (dof,
- boundary_ids,
- dof_to_boundary_mapping,
- sparsity);
+ make_boundary_sparsity_pattern<DH, SP> (dof,
+ boundary_ids,
+ dof_to_boundary_mapping,
+ sparsity);
return;
}
- template <class DH, class SparsityPattern>
- void make_boundary_sparsity_pattern (
- const DH &dof,
- const typename FunctionMap<DH::space_dimension>::type &boundary_ids,
- const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
- SparsityPattern &sparsity)
+ template <class DH, class SP>
+ void make_boundary_sparsity_pattern
+ (const DH &dof,
+ const typename FunctionMap<DH::space_dimension>::type &boundary_ids,
+ const std::vector<types::global_dof_index> &dof_to_boundary_mapping,
+ SP &sparsity)
{
if (DH::dimension == 1)
{
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_flux_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
+ SP &sparsity,
const ConstraintMatrix &constraints,
- const bool keep_constrained_dofs,
- const types::subdomain_id subdomain_id)
+ const bool keep_constrained_dofs,
+ const types::subdomain_id subdomain_id)
// TODO: QA: reduce the indentation level of this method..., Maier 2012
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
- make_flux_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity)
+ make_flux_sparsity_pattern (const DH &dof,
+ SP &sparsity)
{
ConstraintMatrix constraints;
make_flux_sparsity_pattern (dof, sparsity, constraints);
// implementation of the same function in namespace DoFTools for
// non-hp DoFHandlers
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_flux_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
+ SP &sparsity,
const Table<2,Coupling> &int_mask,
const Table<2,Coupling> &flux_mask)
{
// implementation of the same function in namespace DoFTools for
// non-hp DoFHandlers
- template <int dim, int spacedim, class SparsityPattern>
+ template <int dim, int spacedim, class SP>
void
make_flux_sparsity_pattern (const dealii::hp::DoFHandler<dim,spacedim> &dof,
- SparsityPattern &sparsity,
- const Table<2,Coupling> &int_mask,
- const Table<2,Coupling> &flux_mask)
+ SP &sparsity,
+ const Table<2,Coupling> &int_mask,
+ const Table<2,Coupling> &flux_mask)
{
// while the implementation above is quite optimized and caches a
// lot of data (see e.g. the int/flux_dof_mask tables), this is no
- template <class DH, class SparsityPattern>
+ template <class DH, class SP>
void
make_flux_sparsity_pattern (const DH &dof,
- SparsityPattern &sparsity,
+ SP &sparsity,
const Table<2,Coupling> &int_mask,
const Table<2,Coupling> &flux_mask)
{
- template <class DH, class SparsityPattern>
- void make_sparsity_pattern (
- const DH &dof,
- SparsityPattern &sparsity,
- const unsigned int level)
+ template <class DH, class SP>
+ void make_sparsity_pattern (const DH &dof,
+ SP &sparsity,
+ const unsigned int level)
{
const types::global_dof_index n_dofs = dof.n_dofs(level);
(void)n_dofs;
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
- make_flux_sparsity_pattern (
- const DoFHandler<dim,spacedim> &dof,
- SparsityPattern &sparsity,
- const unsigned int level)
+ make_flux_sparsity_pattern (const DoFHandler<dim,spacedim> &dof,
+ SP &sparsity,
+ const unsigned int level)
{
const types::global_dof_index n_dofs = dof.n_dofs(level);
(void)n_dofs;
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
- make_flux_sparsity_pattern_edge (
- const DoFHandler<dim,spacedim> &dof,
- SparsityPattern &sparsity,
- const unsigned int level)
+ make_flux_sparsity_pattern_edge (const DoFHandler<dim,spacedim> &dof,
+ SP &sparsity,
+ const unsigned int level)
{
Assert ((level>=1) && (level<dof.get_tria().n_global_levels()),
ExcIndexRange(level, 1, dof.get_tria().n_global_levels()));
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
- make_flux_sparsity_pattern (
- const DoFHandler<dim,spacedim> &dof,
- SparsityPattern &sparsity,
- const unsigned int level,
- const Table<2,DoFTools::Coupling> &int_mask,
- const Table<2,DoFTools::Coupling> &flux_mask)
+ make_flux_sparsity_pattern (const DoFHandler<dim,spacedim> &dof,
+ SP &sparsity,
+ const unsigned int level,
+ const Table<2,DoFTools::Coupling> &int_mask,
+ const Table<2,DoFTools::Coupling> &flux_mask)
{
const FiniteElement<dim> &fe = dof.get_fe();
const types::global_dof_index n_dofs = dof.n_dofs(level);
- template <int dim, class SparsityPattern, int spacedim>
+ template <int dim, class SP, int spacedim>
void
- make_flux_sparsity_pattern_edge (
- const DoFHandler<dim,spacedim> &dof,
- SparsityPattern &sparsity,
- const unsigned int level,
- const Table<2,DoFTools::Coupling> &flux_mask)
+ make_flux_sparsity_pattern_edge (const DoFHandler<dim,spacedim> &dof,
+ SP &sparsity,
+ const unsigned int level,
+ const Table<2,DoFTools::Coupling> &flux_mask)
{
const FiniteElement<dim> &fe = dof.get_fe();
const unsigned int n_comp = fe.n_components();