Debian Codegraph @

packages/seacas/applications/ejoin/EJ_SystemInterface.h

raw
1 // Copyright(C) 1999-2024 National Technology & Engineering Solutions
2 // of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 // NTESS, the U.S. Government retains certain rights in this software.
4 //
5 // See packages/seacas/LICENSE for details
6 #pragma once
7
8 #include "EJ_CodeTypes.h" // for StringIdVector, Omissions, etc
9 #include "EJ_vector3d.h" // for vector3d
10 #include "GetLongOpt.h" // for GetLongOption
11 #include <climits> // for INT_MAX
12 #include <string> // for string
13 #include <vector> // for vector
14
15 class SystemInterface
16 {
17 public:
18 SystemInterface();
19
20 bool parse_options(int argc, char **argv);
21
22 int debug() const { return debugLevel_; }
23
24 double tolerance() const { return tolerance_; }
25 bool match_node_ids() const { return matchNodeIds_; }
26 bool match_node_xyz() const { return matchNodeXYZ_; }
27 bool match_elem_ids() const { return matchElemIds_; }
28 bool omit_nodesets() const { return omitNodesets_; }
29 bool omit_sidesets() const { return omitSidesets_; }
30 bool omit_assemblies() const { return omitAssemblies_; }
31 bool convert_nodes_to_nodesets(int part_number) const;
32 bool create_assemblies() const { return createAssemblies_; }
33
34 bool disable_field_recognition() const { return disableFieldRecognition_; }
35 bool ints64bit() const { return ints64bit_; }
36 bool use_netcdf4() const { return useNetcdf4_; }
37 bool ignore_element_ids() const { return ignoreElementIds_; }
38
39 int quantize_nsd() const { return quantizeNSD_; }
40 bool quantize() const { return quantizeNSD_ > 0; }
41 int compression_level() const { return compressionLevel_; }
42 bool zlib() const { return zlib_; }
43 bool szip() const { return szip_; }
44 bool zstd() const { return zstd_; }
45 bool bz2() const { return bz2_; }
46
47 int step_min() const { return stepMin_; }
48 int step_max() const { return stepMax_; }
49 int step_interval() const { return stepInterval_; }
50
51 vector3d offset() const { return offset_; }
52 const std::vector<int> &information_record_parts() const { return infoRecordParts_; }
53 const StringIdVector &global_var_names() const { return globalVarNames_; }
54 const StringIdVector &node_var_names() const { return nodeVarNames_; }
55 const StringIdVector &elem_var_names() const { return elemVarNames_; }
56 const StringIdVector &nset_var_names() const { return nsetVarNames_; }
57 const StringIdVector &sset_var_names() const { return ssetVarNames_; }
58
59 const Omissions &block_inclusions() const { return blockInclusions_; }
60 const Omissions &block_omissions() const { return blockOmissions_; }
61 const Omissions &nset_omissions() const { return nsetOmissions_; }
62 const Omissions &sset_omissions() const { return ssetOmissions_; }
63 const Omissions &assembly_omissions() const { return assemblyOmissions_; }
64
65 const std::string &block_prefix() const { return blockPrefix_; }
66
67 //! Dumps representation of data in this class to cerr
68 static void show_version();
69
70 // Make this private eventually...
71 StringVector inputFiles_;
72 std::string outputName_;
73
74 private:
75 void enroll_options();
76
77 /*! The defined formats for the count attribute are:<br>
78 - <missing> -- default -- 1 <= count <= oo (all steps)
79 - "X" -- X <= count <= X (just step X) (if X == -1, do last step only)
80 - "X:Y" -- X to Y by 1
81 - "X:" -- X to oo by 1
82 - ":Y" -- 1 to Y by 1
83 - "::Z" -- 1 to oo by Z
84
85 The count and step must always be >= 0
86 */
87 void parse_step_option(const char *tokens);
88
89 GetLongOption options_; //!< Options parsing
90
91 int debugLevel_{0};
92 int stepMin_{1};
93 int stepMax_{INT_MAX};
94 int stepInterval_{1};
95 int compressionLevel_{0};
96 int quantizeNSD_{0};
97 bool zlib_{false};
98 bool szip_{false};
99 bool zstd_{false};
100 bool bz2_{false};
101
102 bool omitNodesets_{false};
103 bool omitSidesets_{false};
104 bool omitAssemblies_{false};
105 bool matchNodeIds_{false};
106 bool matchNodeXYZ_{false};
107 bool matchElemIds_{false};
108 bool disableFieldRecognition_{false};
109 bool ints64bit_{false};
110 bool useNetcdf4_{false};
111 bool ignoreElementIds_{false};
112
113 bool createAssemblies_{true};
114
115 std::string blockPrefix_{"p"};
116
117 vector3d offset_;
118 double tolerance_{0.0};
119
120 Omissions blockInclusions_;
121 Omissions blockOmissions_;
122 Omissions assemblyOmissions_;
123 Omissions nsetOmissions_;
124 Omissions ssetOmissions_;
125
126 std::vector<int> nodesetConvertParts_;
127 std::vector<int> infoRecordParts_;
128
129 StringIdVector globalVarNames_;
130 StringIdVector nodeVarNames_;
131 StringIdVector elemVarNames_;
132 StringIdVector nsetVarNames_;
133 StringIdVector ssetVarNames_;
134 };