// ---------------------------------------------------------------------
//
// Copyright (C) 2009 - 2015 by the deal.II authors
//
// This file is part of the deal.II library.
//
// The deal.II library is free software; you can use it, redistribute
// it, and/or modify it under the terms of the GNU Lesser General
// Public License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
// The full text of the license can be found in the file LICENSE at
// the top level of the deal.II distribution.
//
// ---------------------------------------------------------------------



for (SP : SPARSITY_PATTERNS; deal_II_dimension : DIMENSIONS)
  {
    template void
    DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension> &dof,
     SP    &sparsity,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension> &dof,
     SP    &sparsity,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension>&,
     const Table<2,Coupling>&,
     SP &,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension>&,
     const Table<2,Coupling>&,
     SP &,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension> &dof_row,
     const DoFHandler<deal_II_dimension,deal_II_dimension> &dof_col,
     SP    &sparsity);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension>, SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension> &dof_row,
     const hp::DoFHandler<deal_II_dimension,deal_II_dimension> &dof_col,
     SP    &sparsity);

    template void
    DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
    (const DoFHandler<deal_II_dimension>& dof,
     const std::vector<types::global_dof_index>  &,
     SP    &);

    template void
    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
    (const hp::DoFHandler<deal_II_dimension>& dof,
     const std::vector<types::global_dof_index>  &,
     SP    &);

    template void
    DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
    (const DoFHandler<deal_II_dimension>& dof,
     const FunctionMap<deal_II_dimension>::type  &boundary_ids,
     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     SP    &sparsity);

    template void
    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
    (const hp::DoFHandler<deal_II_dimension>& dof,
     const FunctionMap<deal_II_dimension>::type  &boundary_ids,
     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     SP    &sparsity);

#if deal_II_dimension < 3
    template void
    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
     const FunctionMap<deal_II_dimension+1>::type  &boundary_ids,
     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     SP    &sparsity);
 #endif

    template void
    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
    (const DoFHandler<deal_II_dimension> &dof,
     SP    &sparsity);

    template void
    DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
    (const hp::DoFHandler<deal_II_dimension> &dof,
     SP    &sparsity);


    template void
    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
    (const DoFHandler<deal_II_dimension> &dof,
     SP    &sparsity,
     const ConstraintMatrix &constraints,
     const bool, const unsigned int);

    template void
    DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
    (const hp::DoFHandler<deal_II_dimension> &dof,
     SP    &sparsity,
     const ConstraintMatrix &constraints,
     const bool, const unsigned int);


#if deal_II_dimension > 1

    template void
    DoFTools::make_flux_sparsity_pattern<DoFHandler<deal_II_dimension>,SP>
    (const DoFHandler<deal_II_dimension> &dof,
     SP    &,
     const Table<2,Coupling>&,
     const Table<2,Coupling>&);

    template void
    DoFTools::make_flux_sparsity_pattern<hp::DoFHandler<deal_II_dimension>,SP>
    (const hp::DoFHandler<deal_II_dimension> &dof,
     SP    &,
     const Table<2,Coupling>&,
     const Table<2,Coupling>&);
#endif

#if deal_II_dimension < 3

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>, SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
     SP    &sparsity,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>, SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof,
     SP    &sparsity,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>, SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
     const Table<2,Coupling>&,
     SP &,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>, SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>&,
     const Table<2,Coupling>&,
     SP &,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>, SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_row,
     const DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_col,
     SP    &sparsity);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>, SP>
    (const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_row,
     const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1> &dof_col,
     SP    &sparsity);

    template void
    DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
     const std::vector<types::global_dof_index>  &,
     SP    &);

    //template void
    //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
    //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
    // const std::vector<types::global_dof_index>  &,
    // SP    &);

    template void
    DoFTools::make_boundary_sparsity_pattern<DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
    (const DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
     const FunctionMap<deal_II_dimension+1>::type  &boundary_ids,
     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     SP    &sparsity);

    //template void
    //DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>,SP>
    //(const hp::DoFHandler<deal_II_dimension,deal_II_dimension+1>& dof,
    // const FunctionMap<deal_II_dimension+1>::type  &boundary_ids,
    // const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
    // SP    &sparsity);

#endif


#if deal_II_dimension == 3

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<1,3>, SP>
    (const DoFHandler<1,3> &dof,
     SP    &sparsity,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<1,3>, SP>
    (const hp::DoFHandler<1,3> &dof,
     SP    &sparsity,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<1,3>, SP>
    (const DoFHandler<1,3>&,
     const Table<2,Coupling>&,
     SP &,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<1,3>, SP>
    (const hp::DoFHandler<1,3>&,
     const Table<2,Coupling>&,
     SP &,
     const ConstraintMatrix &,
     const bool,
     const unsigned int);

    template void
    DoFTools::make_sparsity_pattern<DoFHandler<1,3>, SP>
    (const DoFHandler<1,3> &dof_row,
     const DoFHandler<1,3> &dof_col,
     SP    &sparsity);

    template void
    DoFTools::make_sparsity_pattern<hp::DoFHandler<1,3>, SP>
    (const hp::DoFHandler<1,3> &dof_row,
     const hp::DoFHandler<1,3> &dof_col,
     SP    &sparsity);

    template void
    DoFTools::make_boundary_sparsity_pattern<DoFHandler<1,3>,SP>
    (const DoFHandler<1,3>& dof,
     const std::vector<types::global_dof_index>  &,
     SP    &);

    template void
    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<1,3>,SP>
    (const hp::DoFHandler<1,3>& dof,
     const std::vector<types::global_dof_index>  &,
     SP    &);

    template void
    DoFTools::make_boundary_sparsity_pattern<DoFHandler<1,3>,SP>
    (const DoFHandler<1,3>& dof,
     const FunctionMap<3>::type  &boundary_ids,
     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     SP    &sparsity);

    template void
    DoFTools::make_boundary_sparsity_pattern<hp::DoFHandler<1,3>,SP>
    (const hp::DoFHandler<1,3>& dof,
     const FunctionMap<3>::type  &boundary_ids,
     const std::vector<types::global_dof_index>  &dof_to_boundary_mapping,
     SP    &sparsity);

#endif

  }


for (deal_II_dimension : DIMENSIONS)
{
  template
  Table<2,DoFTools::Coupling>
  DoFTools::dof_couplings_from_component_couplings
  (const FiniteElement<deal_II_dimension> &fe,
   const Table<2,DoFTools::Coupling> &component_couplings);
}
