IOSS  2.0
shell_interface.h
Go to the documentation of this file.
1 /*
2  * Copyright(C) 1999-2017 National Technology & Engineering Solutions
3  * of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
4  * NTESS, the U.S. Government retains certain rights in this software.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions are
8  * met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  *
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  *
18  * * Neither the name of NTESS nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 #ifndef shell_SystemInterface_h
35 #define shell_SystemInterface_h
36 
37 #include "Ioss_GetLongOpt.h"
38 
39 #include <iosfwd>
40 #include <string>
41 #include <vector>
42 
43 /** \brief A special namespace for the io_shell demonstration program interFace.
44  */
45 namespace IOShell {
46  class Interface
47  {
48  public:
49  Interface();
50  ~Interface();
51 
52  bool parse_options(int argc, char **argv);
53 
54  //! Dumps representation of data in this class to cerr
55 
56  void enroll_options();
57 
59 
60  std::vector<std::string> inputFile;
61  std::string outputFile;
62  std::string inFiletype{"unknown"};
63  std::string outFiletype{"unknown"};
64  std::string groupName;
65  std::string decomp_method;
66  std::string compose_output{"default"};
67  double maximum_time{std::numeric_limits<double>::max()};
68  double minimum_time{-std::numeric_limits<double>::max()};
69  double append_time{std::numeric_limits<double>::max()};
70  double timestep_delay{0.0};
71  int append_step{std::numeric_limits<int>::max()};
77 
78  //! If non-zero, then put `split_times` timesteps in each file. Then close file and start new
79  //! file.
80  // If `split_cyclic == 0`, then filenames will be
81  // filename.e-s000X; if `split_cyclic > 0`, then filenames will be
82  // filename.e.{A|B|C...}
83  int split_times{0};
84  //! If non-zero, then the `split_times` timesteps will be put into
85  // `split_cyclic` files and then recycle filenames. For example:
86  // `split_times=1` and `split_cyclic=3`, t=1 ->file.A, t=2
87  // ->file.B, t=3 -> file.C, t=4 -> file.A If `split_times=2` and
88  // `split_cyclic=2`, then t=1,2 -> file.A, t=3,4 -> file.B, t=5,6
89  // -> file.A, t=7,8 -> file.B
90  int split_cyclic{0};
91  bool shuffle{false};
92  bool debug{false};
93  bool statistics{false};
94  bool memory_statistics{false};
95  bool do_transform_fields{false};
96  bool ints_64_bit{false};
97  bool ints_32_bit{false};
98  bool reals_32_bit{false};
99  bool netcdf4{false};
100  bool netcdf5{false};
101  bool quiet{false};
102  bool in_memory_read{false};
103  bool in_memory_write{false};
105  bool delete_timesteps{false};
106  bool minimize_open_files{false};
108  // Put transient data for each timestep in separate file (EXPERIMENTAL)
109  bool file_per_state{false};
110  // Testing CGNS - defines zones in reverse order from input file.
111  bool reverse{false};
114  };
115 } // namespace IOShell
116 #endif
IOShell::Interface::enroll_options
void enroll_options()
Dumps representation of data in this class to cerr.
Definition: shell_interface.C:72
IOShell::Interface::split_times
int split_times
Definition: shell_interface.h:83
IOShell::Interface::split_cyclic
int split_cyclic
If non-zero, then the split_times timesteps will be put into.
Definition: shell_interface.h:90
IOShell::Interface::netcdf4
bool netcdf4
Definition: shell_interface.h:99
IOShell::Interface::decomp_method
std::string decomp_method
Definition: shell_interface.h:65
IOShell::Interface::memory_statistics
bool memory_statistics
Definition: shell_interface.h:94
IOShell::Interface::delete_timesteps
bool delete_timesteps
Definition: shell_interface.h:105
IOShell::Interface::quiet
bool quiet
Definition: shell_interface.h:101
IOShell::Interface
Definition: shell_interface.h:46
IOShell::Interface::outputFile
std::string outputFile
Definition: shell_interface.h:61
IOShell::Interface::do_transform_fields
bool do_transform_fields
Definition: shell_interface.h:95
IOShell::Interface::Interface
Interface()
Definition: shell_interface.C:68
IOShell::Interface::ints_32_bit
bool ints_32_bit
Definition: shell_interface.h:97
IOShell::Interface::minimize_open_files
bool minimize_open_files
Definition: shell_interface.h:106
IOShell::Interface::reverse
bool reverse
Definition: shell_interface.h:111
IOShell::Interface::data_storage_type
int data_storage_type
Definition: shell_interface.h:73
IOShell::Interface::append_time
double append_time
Definition: shell_interface.h:69
IOShell::Interface::compression_level
int compression_level
Definition: shell_interface.h:74
IOShell::Interface::serialize_io_size
int serialize_io_size
Definition: shell_interface.h:75
IOShell::Interface::append_step
int append_step
Definition: shell_interface.h:71
IOShell::Interface::surface_split_type
int surface_split_type
Definition: shell_interface.h:72
IOShell::Interface::statistics
bool statistics
Definition: shell_interface.h:93
IOShell::Interface::netcdf5
bool netcdf5
Definition: shell_interface.h:100
IOShell::Interface::maximum_time
double maximum_time
Definition: shell_interface.h:67
IOShell::Interface::outFiletype
std::string outFiletype
Definition: shell_interface.h:63
IOShell::Interface::flush_interval
int flush_interval
Definition: shell_interface.h:76
IOShell::Interface::ints_64_bit
bool ints_64_bit
Definition: shell_interface.h:96
IOShell::Interface::options_
Ioss::GetLongOption options_
Definition: shell_interface.h:58
IOShell::Interface::minimum_time
double minimum_time
Definition: shell_interface.h:68
IOShell::Interface::timestep_delay
double timestep_delay
Definition: shell_interface.h:70
IOShell::Interface::parse_options
bool parse_options(int argc, char **argv)
Definition: shell_interface.C:309
IOShell::Interface::groupName
std::string groupName
Definition: shell_interface.h:64
IOShell::Interface::add_processor_id_field
bool add_processor_id_field
Definition: shell_interface.h:112
Ioss_GetLongOpt.h
IOShell::Interface::shuffle
bool shuffle
Definition: shell_interface.h:91
IOShell::Interface::compose_output
std::string compose_output
Definition: shell_interface.h:66
IOShell::Interface::~Interface
~Interface()
IOShell::Interface::reals_32_bit
bool reals_32_bit
Definition: shell_interface.h:98
IOShell::Interface::in_memory_read
bool in_memory_read
Definition: shell_interface.h:102
IOShell::Interface::inputFile
std::vector< std::string > inputFile
Definition: shell_interface.h:60
IOShell
A special namespace for the io_shell demonstration program interFace.
Definition: shell_interface.h:45
IOShell::Interface::inFiletype
std::string inFiletype
Definition: shell_interface.h:62
IOShell::Interface::lower_case_variable_names
bool lower_case_variable_names
Definition: shell_interface.h:104
Ioss::GetLongOption
A database of program command line and environment variable options and methods for manipulating them...
Definition: Ioss_GetLongOpt.h:47
IOShell::Interface::fieldSuffixSeparator
char fieldSuffixSeparator
Definition: shell_interface.h:113
IOShell::Interface::file_per_state
bool file_per_state
Definition: shell_interface.h:109
IOShell::Interface::debug
bool debug
Definition: shell_interface.h:92
IOShell::Interface::in_memory_write
bool in_memory_write
Definition: shell_interface.h:103
IOShell::Interface::disable_field_recognition
bool disable_field_recognition
Definition: shell_interface.h:107