Commit f1acf358 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Moving grid gnuplot writrer.

parent 806d6e76
Loading
Loading
Loading
Loading
+0 −48
Original line number Diff line number Diff line
// 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
+35 −41
Original line number Diff line number Diff line
/***************************************************************************
                          GnuplotWriter.h  -  description
                             -------------------
    begin                : Jul 2, 2013
    copyright            : (C) 2013 by Tomas Oberhuber
    email                : tomas.oberhuber@fjfi.cvut.cz
 ***************************************************************************/

/* See Copyright Notice in tnl/Copyright */
// 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

@@ -19,35 +15,33 @@ namespace Meshes {
class GnuplotWriter
{
public:

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

};

}  // namespace Meshes