// Copyright (c) 2004-2022 Tomáš Oberhuber et al.
//
// This file is part of TNL - Template Numerical Library (https://tnl-project.org/)
//
// SPDX-License-Identifier: MIT

#pragma once

#include <ostream>
#include <TNL/Containers/StaticVector.h>

namespace TNL {
namespace Meshes {

class GnuplotWriter
{
public:
   template< typename Element >
   static void
   write( std::ostream& str, const Element& d )
   {
      str << d;
   }

   template< typename Real >
   static void
   write( std::ostream& str, const Containers::StaticVector< 1, Real >& d )
   {
      str << d.x() << " ";
   }

   template< typename Real >
   static void
   write( std::ostream& str, const Containers::StaticVector< 2, Real >& d )
   {
      str << d.x() << " " << d.y() << " ";
   }

   template< typename Real >
   static void
   write( std::ostream& str, const Containers::StaticVector< 3, Real >& d )
   {
      str << d.x() << " " << d.y() << " " << d.z() << " ";
   }
};

}  // namespace Meshes
}  // namespace TNL
