Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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 namespace Nektar
56 {
57 namespace LibUtilities
58 {
59 using namespace std;
60 
61 typedef std::map<std::string, std::string> PtsMetaDataMap;
62 static PtsMetaDataMap NullPtsMetaDataMap;
63 
64 class PtsIO : public FieldIOXml
65 {
66 public:
68  bool sharedFilesystem = false);
69 
71  {
72  }
73 
75  const string &inFile,
76  PtsFieldSharedPtr &ptsField,
77  FieldMetaDataMap &fieldmetadatamap = NullFieldMetaDataMap);
78 
79  LIB_UTILITIES_EXPORT void Write(const string &outFile,
80  const PtsFieldSharedPtr &ptsField,
81  const bool backup = false);
82 
83  LIB_UTILITIES_EXPORT void ImportFieldData(TiXmlDocument docInput,
84  PtsFieldSharedPtr &ptsField);
85 
86 protected:
87  LIB_UTILITIES_EXPORT void SetUpFieldMetaData(const std::string outname);
88 
89  LIB_UTILITIES_EXPORT virtual std::string GetFileEnding() const
90  {
91  return "pts";
92  };
93 };
94 
95 typedef boost::shared_ptr<PtsIO> PtsIOSharedPtr;
96 }
97 }
98 #endif
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > &ElementIDs)
This function allows for data to be imported from an FLD file when a session and/or communicator is n...
Definition: FieldIO.cpp:279
STL namespace.
std::map< std::string, std::string > FieldMetaDataMap
Definition: FieldIO.h:54
boost::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:178
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:55
#define LIB_UTILITIES_EXPORT
virtual std::string GetFileEnding() const
Helper function that determines default file extension.
Definition: PtsIO.h:89
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap, const bool backup)
This function allows for data to be written to an FLD file when a session and/or communicator is not ...
Definition: FieldIO.cpp:235
boost::shared_ptr< PtsIO > PtsIOSharedPtr
Definition: PtsIO.h:95
static FieldMetaDataMap NullFieldMetaDataMap
Definition: FieldIO.h:55