// ---------------------------------------------------------------------
//
// Copyright (C) 1998 - 2020 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.md at
// the top level directory of deal.II.
//
// ---------------------------------------------------------------------


for (VEC : REAL_VECTOR_TYPES; deal_II_dimension : DIMENSIONS;
     deal_II_space_dimension : SPACE_DIMENSIONS)
  {
#if deal_II_dimension <= deal_II_space_dimension
    namespace VectorTools
    \{
      template void
      create_right_hand_side<deal_II_dimension, deal_II_space_dimension, VEC>(
        const Mapping<deal_II_dimension, deal_II_space_dimension> &,
        const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
        const Quadrature<deal_II_dimension> &,
        const Function<deal_II_space_dimension, VEC::value_type> &,
        VEC &,
        const AffineConstraints<VEC::value_type> &);

      template void
      create_right_hand_side<deal_II_dimension, deal_II_space_dimension, VEC>(
        const DoFHandler<deal_II_dimension, deal_II_space_dimension> &,
        const Quadrature<deal_II_dimension> &,
        const Function<deal_II_space_dimension, VEC::value_type> &,
        VEC &,
        const AffineConstraints<VEC::value_type> &);
    \}
#endif
  }

// TODO[SP]: replace <deal_II_dimension> by <deal_II_dimension,
// deal_II_space_dimension>
// where applicable and move to codimension cases above also when applicable
for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
  {
    namespace VectorTools
    \{

#if deal_II_dimension == deal_II_space_dimension
      template void
      create_right_hand_side<deal_II_dimension,
                             deal_II_space_dimension,
                             Vector<double>>(
        const hp::MappingCollection<deal_II_dimension> &,
        const DoFHandler<deal_II_dimension> &,
        const hp::QCollection<deal_II_dimension> &,
        const Function<deal_II_space_dimension, Vector<double>::value_type> &,
        Vector<double> &,
        const AffineConstraints<double> &);

      template void
      create_right_hand_side<deal_II_dimension,
                             deal_II_space_dimension,
                             Vector<double>>(
        const DoFHandler<deal_II_dimension> &,
        const hp::QCollection<deal_II_dimension> &,
        const Function<deal_II_space_dimension, Vector<double>::value_type> &,
        Vector<double> &,
        const AffineConstraints<double> &);

#  if deal_II_dimension > 1
      template void
      create_boundary_right_hand_side<deal_II_dimension,
                                      deal_II_space_dimension,
                                      Vector<double>>(
        const Mapping<deal_II_dimension> &,
        const DoFHandler<deal_II_dimension> &,
        const Quadrature<deal_II_dimension - 1> &,
        const Function<deal_II_space_dimension, Vector<double>::value_type> &,
        Vector<double> &,
        const std::set<types::boundary_id> &);
#  endif

      template void
      create_boundary_right_hand_side<deal_II_dimension,
                                      deal_II_space_dimension,
                                      Vector<double>>(
        const DoFHandler<deal_II_dimension> &,
        const Quadrature<deal_II_dimension - 1> &,
        const Function<deal_II_space_dimension, Vector<double>::value_type> &,
        Vector<double> &,
        const std::set<types::boundary_id> &);

#  if deal_II_dimension > 1
      template void
      create_boundary_right_hand_side<deal_II_dimension,
                                      deal_II_space_dimension,
                                      Vector<double>>(
        const hp::MappingCollection<deal_II_dimension> &,
        const DoFHandler<deal_II_dimension> &,
        const hp::QCollection<deal_II_dimension - 1> &,
        const Function<deal_II_space_dimension, Vector<double>::value_type> &,
        Vector<double> &,
        const std::set<types::boundary_id> &);
#  endif

      template void
      create_boundary_right_hand_side<deal_II_dimension,
                                      deal_II_space_dimension,
                                      Vector<double>>(
        const DoFHandler<deal_II_dimension> &,
        const hp::QCollection<deal_II_dimension - 1> &,
        const Function<deal_II_space_dimension, Vector<double>::value_type> &,
        Vector<double> &,
        const std::set<types::boundary_id> &);


#endif
    \}
  }
