// ---------------------------------------------------------------------
//
// Copyright (C) 1998 - 2021 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 (V1 : VECTORS_WITH_MATRIX)
  {
    template class MGLevelGlobalTransfer<V1>;
  }

for (deal_II_dimension : DIMENSIONS; V1 : VECTORS_WITH_MATRIX)
  {
    template void MGLevelGlobalTransfer<V1>::
      fill_and_communicate_copy_indices<deal_II_dimension, deal_II_dimension>(
        const DoFHandler<deal_II_dimension, deal_II_dimension> &mg_dof);
  }

for (deal_II_dimension : DIMENSIONS; V1, V2 : DEAL_II_VEC_TEMPLATES;
     S1, S2 : REAL_SCALARS)
  {
    template void MGLevelGlobalTransfer<V1<S1>>::copy_to_mg(
      const DoFHandler<deal_II_dimension> &,
      MGLevelObject<V1<S1>> &,
      const V2<S2> &) const;
    template void MGLevelGlobalTransfer<V1<S1>>::copy_from_mg(
      const DoFHandler<deal_II_dimension> &,
      V2<S2> &,
      const MGLevelObject<V1<S1>> &) const;
    template void MGLevelGlobalTransfer<V1<S1>>::copy_from_mg_add(
      const DoFHandler<deal_II_dimension> &,
      V2<S2> &,
      const MGLevelObject<V1<S1>> &) const;
  }

for (deal_II_dimension : DIMENSIONS)
  {
    template void
    MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<float>>::
      fill_and_communicate_copy_indices<deal_II_dimension, deal_II_dimension>(
        const DoFHandler<deal_II_dimension, deal_II_dimension> &mg_dof);
  }

for (deal_II_dimension : DIMENSIONS; S1, S2 : REAL_SCALARS)
  {
    template void
    MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<S1>>::copy_to_mg(
      const DoFHandler<deal_II_dimension> &,
      MGLevelObject<LinearAlgebra::distributed::Vector<S1>> &,
      const LinearAlgebra::distributed::Vector<S2> &,
      const bool) const;
  }

for (deal_II_dimension : DIMENSIONS; S1, S2 : REAL_SCALARS)
  {
    template void
    MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<S1>>::copy_to_mg(
      const DoFHandler<deal_II_dimension> &,
      MGLevelObject<LinearAlgebra::distributed::Vector<S1>> &,
      const LinearAlgebra::distributed::Vector<S2> &) const;
    template void
    MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<S1>>::copy_from_mg(
      const DoFHandler<deal_II_dimension> &,
      LinearAlgebra::distributed::Vector<S2> &,
      const MGLevelObject<LinearAlgebra::distributed::Vector<S1>> &) const;
    template void
    MGLevelGlobalTransfer<LinearAlgebra::distributed::Vector<S1>>::
      copy_from_mg_add(
        const DoFHandler<deal_II_dimension> &,
        LinearAlgebra::distributed::Vector<S2> &,
        const MGLevelObject<LinearAlgebra::distributed::Vector<S1>> &) const;
  }

for (deal_II_dimension : DIMENSIONS)
  {
#ifdef DEAL_II_WITH_TRILINOS

    template void
    MGLevelGlobalTransfer<TrilinosWrappers::MPI::Vector>::copy_to_mg(
      const DoFHandler<deal_II_dimension> &,
      MGLevelObject<TrilinosWrappers::MPI::Vector> &,
      const TrilinosWrappers::MPI::Vector &) const;
    template void
    MGLevelGlobalTransfer<TrilinosWrappers::MPI::Vector>::copy_from_mg(
      const DoFHandler<deal_II_dimension> &,
      TrilinosWrappers::MPI::Vector &,
      const MGLevelObject<TrilinosWrappers::MPI::Vector> &) const;
    template void
    MGLevelGlobalTransfer<TrilinosWrappers::MPI::Vector>::copy_from_mg_add(
      const DoFHandler<deal_II_dimension> &,
      TrilinosWrappers::MPI::Vector &,
      const MGLevelObject<TrilinosWrappers::MPI::Vector> &) const;
#endif

#ifdef DEAL_II_WITH_PETSC
    template void MGLevelGlobalTransfer<PETScWrappers::MPI::Vector>::copy_to_mg(
      const DoFHandler<deal_II_dimension> &,
      MGLevelObject<PETScWrappers::MPI::Vector> &,
      const PETScWrappers::MPI::Vector &) const;
    template void
    MGLevelGlobalTransfer<PETScWrappers::MPI::Vector>::copy_from_mg(
      const DoFHandler<deal_II_dimension> &,
      PETScWrappers::MPI::Vector &,
      const MGLevelObject<PETScWrappers::MPI::Vector> &) const;
    template void
    MGLevelGlobalTransfer<PETScWrappers::MPI::Vector>::copy_from_mg_add(
      const DoFHandler<deal_II_dimension> &,
      PETScWrappers::MPI::Vector &,
      const MGLevelObject<PETScWrappers::MPI::Vector> &) const;
#endif
  }
