// ---------------------------------------------------------------------
//
// Copyright (C) 1999 - 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 (deal_II_dimension : DIMENSIONS)
  {
#if deal_II_dimension > 1
    template void GridOut::write_dx(const Triangulation<deal_II_dimension> &,
                                    std::ostream &) const;
    template void GridOut::write_mathgl(
      const Triangulation<deal_II_dimension> &, std::ostream &) const;
#endif

    template void GridOut::write_msh(const Triangulation<deal_II_dimension> &,
                                     std::ostream &) const;
#ifdef DEAL_II_GMSH_WITH_API
    template void GridOut::write_msh(const Triangulation<deal_II_dimension> &,
                                     const std::string &) const;
#endif

#if deal_II_dimension != 2
    template void GridOut::write_xfig(
      const Triangulation<deal_II_dimension> &,
      std::ostream &,
      const Mapping<deal_II_dimension, deal_II_dimension> *) const;
#endif

    template void GridOut::write_gnuplot(
      const Triangulation<deal_II_dimension> &,
      std::ostream &,
      const Mapping<deal_II_dimension, deal_II_dimension> *) const;
    template void GridOut::write_ucd<deal_II_dimension>(
      const Triangulation<deal_II_dimension> &, std::ostream &) const;
    template void GridOut::write_eps<deal_II_dimension>(
      const Triangulation<deal_II_dimension> &,
      std::ostream &,
      const Mapping<deal_II_dimension, deal_II_dimension> *) const;
    template void GridOut::write_vtk(const Triangulation<deal_II_dimension> &,
                                     std::ostream &) const;
    template void GridOut::write_vtu(const Triangulation<deal_II_dimension> &,
                                     std::ostream &) const;
    template void GridOut::write_mesh_per_processor_as_vtu(
      const Triangulation<deal_II_dimension> &,
      const std::string &,
      const bool,
      const bool) const;

    template void GridOut::write<deal_II_dimension>(
      const Triangulation<deal_II_dimension> &,
      std::ostream &,
      const OutputFormat,
      const Mapping<deal_II_dimension, deal_II_dimension> *) const;
    template void GridOut::write<deal_II_dimension>(
      const Triangulation<deal_II_dimension> &,
      std::ostream &,
      const Mapping<deal_II_dimension, deal_II_dimension> *) const;
  }

for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
  {
#if deal_II_dimension <= deal_II_space_dimension
    // Instantiate write_svg exception for the <2,2> case for which there
    // is an overload that takes care of that case.
#  if !(deal_II_dimension == 2 && deal_II_space_dimension == 2)
    template void GridOut::write_svg(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &) const;
#  endif
#endif


#if deal_II_dimension < deal_II_space_dimension

    template void GridOut::write_msh(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &) const;
#  ifdef DEAL_II_GMSH_WITH_API
    template void GridOut::write_msh(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      const std::string &) const;
#  endif
    template void GridOut::write_ucd(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &) const;
    template void GridOut::write_gnuplot(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &,
      const Mapping<deal_II_dimension, deal_II_space_dimension> *) const;
    template void GridOut::write_vtk(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &) const;
    template void GridOut::write_vtu(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &) const;
    template void GridOut::write_mesh_per_processor_as_vtu(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      const std::string &,
      const bool,
      const bool) const;


    template void GridOut::write<deal_II_dimension, deal_II_space_dimension>(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &,
      const OutputFormat,
      const Mapping<deal_II_dimension, deal_II_space_dimension> *) const;
    template void GridOut::write<deal_II_dimension, deal_II_space_dimension>(
      const Triangulation<deal_II_dimension, deal_II_space_dimension> &,
      std::ostream &,
      const Mapping<deal_II_dimension, deal_II_space_dimension> *) const;

#endif
  }
