// ---------------------------------------------------------------------
//
// Copyright (C) 1998 - 2017 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 (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);
    template
    void MGLevelGlobalTransfer< LinearAlgebra::distributed::Vector<float> >::copy_to_mg (
        const DoFHandler<deal_II_dimension>&, MGLevelObject<LinearAlgebra::distributed::Vector<float>>&, const LinearAlgebra::distributed::Vector<float>&, const bool) const;
    template
    void MGLevelGlobalTransfer< LinearAlgebra::distributed::Vector<double> >::copy_to_mg (
        const DoFHandler<deal_II_dimension>&, MGLevelObject<LinearAlgebra::distributed::Vector<double>>&, const LinearAlgebra::distributed::Vector<double>&, 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
}
