Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PtsIO.h
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File PtsIO.h
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2014 Kilian Lackhove
10 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
11 // Department of Aeronautics, Imperial College London (UK), and Scientific
12 // Computing and Imaging Institute, University of Utah (USA).
13 //
14 // License for the specific language governing rights and limitations under
15 // Permission is hereby granted, free of charge, to any person obtaining a
16 // copy of this software and associated documentation files (the "Software"),
17 // to deal in the Software without restriction, including without limitation
18 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
19 // and/or sell copies of the Software, and to permit persons to whom the
20 // Software is furnished to do so, subject to the following conditions:
21 //
22 // The above copyright notice and this permission notice shall be included
23 // in all copies or substantial portions of the Software.
24 //
25 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
26 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
27 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
29 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
30 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
31 // DEALINGS IN THE SOFTWARE.
32 //
33 // Description: Pts IO prototype definitions
34 //
35 ///////////////////////////////////////////////////////////////////////////////
36 
37 #ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_PTSIO_H
38 #define NEKTAR_LIB_UTILITIES_BASIC_UTILS_PTSIO_H
39 
40 #include <string>
41 #include <vector>
42 
43 #include <boost/shared_ptr.hpp>
44 
45 #include <tinyxml.h>
46 
48 
54 
55 using namespace std;
56 namespace Nektar
57 {
58 namespace LibUtilities
59 {
60 
61 typedef std::map<std::string, std::string> PtsMetaDataMap;
62 static PtsMetaDataMap NullPtsMetaDataMap;
63 
64 LIB_UTILITIES_EXPORT void Import(const string &inFile,
65  PtsFieldSharedPtr &ptsField);
66 
67 LIB_UTILITIES_EXPORT void Write(const string &outFile,
68  const PtsFieldSharedPtr &ptsField);
69 
70 class PtsIO : protected FieldIO
71 {
72 public:
74  bool sharedFilesystem = false);
75 
77  const string &inFile,
78  PtsFieldSharedPtr &ptsField,
79  FieldMetaDataMap &fieldmetadatamap = NullFieldMetaDataMap);
80 
81  LIB_UTILITIES_EXPORT void Write(const string &outFile,
82  const PtsFieldSharedPtr &ptsField);
83 
84  LIB_UTILITIES_EXPORT void ImportFieldData(TiXmlDocument docInput,
85  PtsFieldSharedPtr &ptsField);
86 
87 protected:
88  LIB_UTILITIES_EXPORT void SetUpFieldMetaData(const std::string outname);
89 
90  LIB_UTILITIES_EXPORT virtual std::string GetFileEnding() const
91  {
92  return "pts";
93  };
94 };
95 
96 typedef boost::shared_ptr<PtsIO> PtsIOSharedPtr;
97 }
98 }
99 #endif
STL namespace.
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:53
boost::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:263
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
Definition: FieldIO.cpp:115
std::map< std::string, std::string > PtsMetaDataMap
Definition: PtsIO.h:61
static PtsMetaDataMap NullPtsMetaDataMap
Definition: PtsIO.h:62
boost::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:53
#define LIB_UTILITIES_EXPORT
virtual std::string GetFileEnding() const
Definition: PtsIO.h:90
boost::shared_ptr< PtsIO > PtsIOSharedPtr
Definition: PtsIO.h:96
Class for operating on FLD files.
Definition: FieldIO.h:137
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap)
Write a field file in serial only.
Definition: FieldIO.cpp:81
static FieldMetaDataMap NullFieldMetaDataMap
Definition: FieldIO.h:54