23 #include <opm/input/eclipse/Deck/UDAValue.hpp> 24 #include <opm/input/eclipse/Deck/value_status.hpp> 26 #include <opm/input/eclipse/Utility/Typetools.hpp> 28 #include <opm/input/eclipse/Units/Dimension.hpp> 44 DeckItem(
const std::string&, std::string);
45 DeckItem(
const std::string&,
double) =
delete;
47 DeckItem(
const std::string&,
UDAValue,
const std::vector<Dimension>& active_dim,
const std::vector<Dimension>& default_dim);
48 DeckItem(
const std::string&,
double,
const std::vector<Dimension>& active_dim,
const std::vector<Dimension>& default_dim);
50 static DeckItem serializationTestObject();
51 DeckItem emptyStructuralCopy()
const;
53 const std::string& name()
const;
56 bool defaultApplied( std::size_t )
const;
61 bool hasValue( std::size_t )
const;
69 std::size_t data_size()
const;
72 T
get( std::size_t index )
const;
74 double getSIDouble( std::size_t )
const;
75 std::string getTrimmedString( std::size_t )
const;
77 template <
typename T> std::vector<T>& getData();
78 template <
typename T>
const std::vector<T>& getData()
const;
80 const std::vector< double >& getSIDoubleData()
const;
81 const std::vector<value::status>& getValueStatus()
const;
82 const std::vector<Dimension>& getActiveDimensions()
const 84 return this->active_dimensions;
91 void push_back(
int );
92 void push_back(
double );
93 void push_back( std::string );
95 void push_back(
UDAValue, std::size_t );
96 void push_back(
int, std::size_t );
97 void push_back(
double, std::size_t );
98 void push_back( std::string, std::size_t );
99 void push_backDefault(
UDAValue, std::size_t n = 1 );
100 void push_backDefault(
int, std::size_t n = 1 );
101 void push_backDefault(
double, std::size_t n = 1 );
102 void push_backDefault( std::string, std::size_t n = 1 );
103 void push_backDefault(
RawString, std::size_t n = 1 );
106 template <
typename T>
107 void push_backDummyDefault( std::size_t n = 1 );
109 type_tag getType()
const;
112 friend std::ostream& operator<<(std::ostream& os,
const DeckItem& item);
124 bool equal(
const DeckItem& other,
bool cmp_default,
bool cmp_numeric)
const;
130 bool operator==(
const DeckItem& other)
const;
131 bool operator!=(
const DeckItem& other)
const;
132 static bool to_bool(std::string string_value);
134 bool is_uda() {
return (type == get_type< UDAValue >()); };
135 bool is_double() {
return type == get_type< double >(); };
136 bool is_int() {
return type == get_type< int >() ; };
137 bool is_string() {
return type == get_type< std::string >(); };
138 bool is_raw_string() {
return type == get_type< RawString >(); };
140 UDAValue& get_uda() {
return uval[0]; };
142 template<
class Serializer>
151 serializer(item_name);
152 serializer(value_status);
153 serializer(raw_data);
154 serializer(active_dimensions);
155 serializer(default_dimensions);
158 void reserve_additionalRawString(std::size_t);
161 mutable std::vector< double > dval;
162 std::vector< int > ival;
163 std::vector< std::string > sval;
164 std::vector< RawString > rsval;
165 std::vector< UDAValue > uval;
167 type_tag type = type_tag::unknown;
169 std::string item_name;
170 std::vector<value::status> value_status;
176 mutable bool raw_data =
true;
177 std::vector< Dimension > active_dimensions;
178 std::vector< Dimension > default_dimensions;
180 template<
typename T > std::vector< T >& value_ref();
181 template<
typename T >
const std::vector< T >& value_ref()
const;
182 template<
typename T >
void push( T );
183 template<
typename T >
void push( T, std::size_t );
184 template<
typename T >
void push_default( T, std::size_t n );
185 template<
typename T >
void write_vector(
DeckOutput& writer,
const std::vector<T>& data)
const;
Definition: UDAValue.hpp:31
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: DeckItem.hpp:38
Definition: DeckOutput.hpp:29
Definition: Typetools.hpp:39
Class for (de-)serializing.
Definition: Serializer.hpp:95