Nektar++
CsvIO.h
Go to the documentation of this file.
1///////////////////////////////////////////////////////////////////////////////
2//
3// File: CsvIO.h
4//
5// For more information, please see: http://www.nektar.info
6//
7// The MIT License
8//
9// Copyright (c) 2017 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// Permission is hereby granted, free of charge, to any person obtaining a
15// copy of this software and associated documentation files (the "Software"),
16// to deal in the Software without restriction, including without limitation
17// the rights to use, copy, modify, merge, publish, distribute, sublicense,
18// and/or sell copies of the Software, and to permit persons to whom the
19// Software is furnished to do so, subject to the following conditions:
20//
21// The above copyright notice and this permission notice shall be included
22// in all copies or substantial portions of the Software.
23//
24// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
25// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
27// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
29// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
30// DEALINGS IN THE SOFTWARE.
31//
32// Description: Csv IO
33//
34///////////////////////////////////////////////////////////////////////////////
35
36#ifndef NEKTAR_LIB_UTILITIES_BASIC_UTILS_CSVIO_H
37#define NEKTAR_LIB_UTILITIES_BASIC_UTILS_CSVIO_H
38
39#include <memory>
40#include <string>
41#include <vector>
42
48
50{
51
52class CsvIO : public PtsIO
53{
54public:
56 bool sharedFilesystem = false);
57
59 {
60 }
61
62 LIB_UTILITIES_EXPORT void Write(const std::string &outFile,
63 const PtsFieldSharedPtr &ptsField,
64 const bool backup = false);
65
66protected:
68 const std::string inFile, PtsFieldSharedPtr &ptsField,
69 DomainRangeShPtr &Range) override;
70
71 LIB_UTILITIES_EXPORT std::string v_GetFileEnding() const override;
72};
73
74typedef std::shared_ptr<CsvIO> CsvIOSharedPtr;
75} // namespace Nektar::LibUtilities
76#endif
#define LIB_UTILITIES_EXPORT
void Write(const std::string &outFile, const PtsFieldSharedPtr &ptsField, const bool backup=false)
Save a pts field to a file.
Definition: CsvIO.cpp:68
std::string v_GetFileEnding() const override
Definition: CsvIO.cpp:278
void v_ImportPtsFieldData(const std::string inFile, PtsFieldSharedPtr &ptsField, DomainRangeShPtr &Range) override
Definition: CsvIO.cpp:111
CsvIO(LibUtilities::CommSharedPtr pComm, bool sharedFilesystem=false)
Definition: CsvIO.cpp:57
std::shared_ptr< PtsField > PtsFieldSharedPtr
Definition: PtsField.h:184
std::shared_ptr< DomainRange > DomainRangeShPtr
Definition: DomainRange.h:64
std::shared_ptr< CsvIO > CsvIOSharedPtr
Definition: CsvIO.h:74
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
Definition: Comm.h:55