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
58 Ioss::GetLongOption options_;
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{"none"};
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()};
72 int surface_split_type{1};
73 int data_storage_type{0};
74 int compression_level{0};
75 int serialize_io_size{0};
76 //! If non-zero, then put `split_times` timesteps in each file. Then close file and start new
77 //! file.
78 // If `split_cyclic == 0`, then filenames will be
79 // filename.e-s000X; if `split_cyclic > 0`, then filenames will be
80 // filename.e.{A|B|C...}
81 int split_times{0};
82 //! If non-zero, then the `split_times` timesteps will be put into
83 // `split_cyclic` files and then recycle filenames. For example:
84 // `split_times=1` and `split_cyclic=3`, t=1 ->file.A, t=2
85 // ->file.B, t=3 -> file.C, t=4 -> file.A If `split_times=2` and
86 // `split_cyclic=2`, then t=1,2 -> file.A, t=3,4 -> file.B, t=5,6
87 // -> file.A, t=7,8 -> file.B
88 int split_cyclic{0};
89 bool shuffle{false};
90 bool debug{false};
91 bool statistics{false};
92 bool memory_statistics{false};
93 bool do_transform_fields{false};
94 bool ints_64_bit{false};
95 bool ints_32_bit{false};
96 bool reals_32_bit{false};
97 bool netcdf4{false};
98 bool netcdf5{false};
99 bool quiet{false};
100 bool in_memory_read{false};
101 bool in_memory_write{false};
102 bool lower_case_variable_names{true};
103 bool delete_timesteps{false};
104 bool minimize_open_files{false};
105 bool disable_field_recognition{false};
106 bool file_per_state{
107 false}; // Put transient data for each timestep in separate file (EXPERMENTAL)
108 char fieldSuffixSeparator{'_'};
109 };
110 } // namespace IOShell
111 #endif
IOShell::Interface::netcdf4
bool netcdf4
Definition: shell_interface.h:97
IOShell::Interface::in_memory_write
bool in_memory_write
Definition: shell_interface.h:101
IOShell::Interface::disable_field_recognition
bool disable_field_recognition
Definition: shell_interface.h:105
IOShell::Interface::minimize_open_files
bool minimize_open_files
Definition: shell_interface.h:104
IOShell::Interface::statistics
bool statistics
Definition: shell_interface.h:91
IOShell::Interface::split_times
int split_times
Definition: shell_interface.h:81
IOShell::Interface::quiet
bool quiet
Definition: shell_interface.h:99
IOShell
A special namespace for the io_shell demonstration program interface.
Definition: shell_interface.h:45
IOShell::Interface::memory_statistics
bool memory_statistics
Definition: shell_interface.h:92
IOShell::Interface::outputFile
std::string outputFile
Definition: shell_interface.h:61
IOShell::Interface::surface_split_type
int surface_split_type
Definition: shell_interface.h:72
IOShell::Interface::do_transform_fields
bool do_transform_fields
Definition: shell_interface.h:93
IOShell::Interface::delete_timesteps
bool delete_timesteps
Definition: shell_interface.h:103
IOShell::Interface::decomp_method
std::string decomp_method
Definition: shell_interface.h:65
IOShell::Interface::serialize_io_size
int serialize_io_size
Definition: shell_interface.h:75
IOShell::Interface::compression_level
int compression_level
Definition: shell_interface.h:74
IOShell::Interface::split_cyclic
int split_cyclic
If non-zero, then the split_times timesteps will be put into.
Definition: shell_interface.h:88
IOShell::Interface::Interface
Interface()
Definition: shell_interface.C:67
IOShell::Interface::options_
Ioss::GetLongOption options_
Definition: shell_interface.h:58
IOShell::Interface::data_storage_type
int data_storage_type
Definition: shell_interface.h:73
IOShell::Interface::groupName
std::string groupName
Definition: shell_interface.h:64
IOShell::Interface::~Interface
~Interface()
IOShell::Interface::append_step
int append_step
Definition: shell_interface.h:71
IOShell::Interface
Definition: shell_interface.h:46
IOShell::Interface::ints_32_bit
bool ints_32_bit
Definition: shell_interface.h:95
IOShell::Interface::netcdf5
bool netcdf5
Definition: shell_interface.h:98
IOShell::Interface::timestep_delay
double timestep_delay
Definition: shell_interface.h:70
Ioss::GetLongOption
A database of program command line and environment variable options and methods for manipulating them...
Definition: Ioss_GetLongOpt.h:47
IOShell::Interface::debug
bool debug
Definition: shell_interface.h:90
IOShell::Interface::ints_64_bit
bool ints_64_bit
Definition: shell_interface.h:94
IOShell::Interface::compose_output
std::string compose_output
Definition: shell_interface.h:66
IOShell::Interface::inputFile
std::vector< std::string > inputFile
Definition: shell_interface.h:60
IOShell::Interface::maximum_time
double maximum_time
Definition: shell_interface.h:67
IOShell::Interface::parse_options
bool parse_options(int argc, char **argv)
Definition: shell_interface.C:275
IOShell::Interface::enroll_options
void enroll_options()
Dumps representation of data in this class to cerr.
Definition: shell_interface.C:71
IOShell::Interface::file_per_state
bool file_per_state
Definition: shell_interface.h:106
IOShell::Interface::fieldSuffixSeparator
char fieldSuffixSeparator
Definition: shell_interface.h:108
IOShell::Interface::minimum_time
double minimum_time
Definition: shell_interface.h:68
IOShell::Interface::reals_32_bit
bool reals_32_bit
Definition: shell_interface.h:96
IOShell::Interface::outFiletype
std::string outFiletype
Definition: shell_interface.h:63
IOShell::Interface::in_memory_read
bool in_memory_read
Definition: shell_interface.h:100
IOShell::Interface::shuffle
bool shuffle
Definition: shell_interface.h:89
IOShell::Interface::lower_case_variable_names
bool lower_case_variable_names
Definition: shell_interface.h:102
IOShell::Interface::inFiletype
std::string inFiletype
Definition: shell_interface.h:62
IOShell::Interface::append_time
double append_time
Definition: shell_interface.h:69
Ioss_GetLongOpt.h