Nektar++
OutputFileBase.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // File: OutputFileBase.h
4 //
5 // For more information, please see: http://www.nektar.info/
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: Base class for outputting to a file
32 //
33 ////////////////////////////////////////////////////////////////////////////////
34 
35 #ifndef FIELDUTILS_OUTPUTFILEBASE
36 #define FIELDUTILS_OUTPUTFILEBASE
37 
38 #include "../Module.h"
39 #include <tinyxml.h>
40 
41 namespace Nektar
42 {
43 namespace FieldUtils
44 {
45 
46 /// Converter from fld to vtk.
48 {
49 public:
51  virtual ~OutputFileBase();
52 
53  /// Write fld to output file.
54  virtual void Process(po::variables_map &vm);
55 
56  virtual std::string GetModuleName()
57  {
58  return "OutputFileBase";
59  }
60 
61  virtual std::string GetModuleDescription()
62  {
63  return "Writing file";
64  }
65 
67  {
68  return eOutput;
69  }
70 
71 protected:
72  /// Write from pts to output file.
73  virtual void OutputFromPts(po::variables_map &vm) = 0;
74 
75  /// Write from m_exp to output file.
76  virtual void OutputFromExp(po::variables_map &vm) = 0;
77 
78  /// Write from data to output file.
79  virtual void OutputFromData(po::variables_map &vm) = 0;
80 
81  virtual fs::path GetPath(std::string &filename,
82  po::variables_map &vm) = 0;
83 
84  virtual fs::path GetFullOutName(std::string &filename,
85  po::variables_map &vm) = 0;
86 
88 
89 private:
90  bool WriteFile(std::string &filename, po::variables_map &vm);
91 
92  void ConvertExpToEquispaced(po::variables_map &vm);
93 
94  void PrintErrorFromPts();
95 
96  void PrintErrorFromExp();
97 };
98 }
99 }
100 
101 #endif
Converter from fld to vtk.
virtual void OutputFromPts(po::variables_map &vm)=0
Write from pts to output file.
bool WriteFile(std::string &filename, po::variables_map &vm)
virtual fs::path GetFullOutName(std::string &filename, po::variables_map &vm)=0
virtual fs::path GetPath(std::string &filename, po::variables_map &vm)=0
virtual void OutputFromData(po::variables_map &vm)=0
Write from data to output file.
virtual void Process(po::variables_map &vm)
Write fld to output file.
virtual ModulePriority GetModulePriority()
void ConvertExpToEquispaced(po::variables_map &vm)
virtual std::string GetModuleDescription()
virtual std::string GetModuleName()
virtual void OutputFromExp(po::variables_map &vm)=0
Write from m_exp to output file.
Abstract base class for output modules.
Definition: Module.h:280
std::shared_ptr< Field > FieldSharedPtr
Definition: Field.hpp:989
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1