20#ifndef OPM_KEYWORDVALIDATION_HEADER_INCLUDED
21#define OPM_KEYWORDVALIDATION_HEADER_INCLUDED
23#include <opm/common/OpmLog/KeywordLocation.hpp>
27#include <initializer_list>
31#include <unordered_map>
42namespace KeywordValidation
47 std::optional<std::string> message;
54 std::function<
bool(T)> validator;
55 std::optional<std::string> message;
59 using UnsupportedKeywords = std::map<std::string, UnsupportedKeywordProperties>;
63 using PartiallySupportedKeywordItems = std::map<std::size_t, PartiallySupportedKeywordProperties<T>>;
67 using PartiallySupportedKeywords = std::map<std::string, PartiallySupportedKeywordItems<T>>;
75 std::size_t record_number;
76 std::optional<std::size_t> item_number;
77 std::optional<std::string> item_value;
78 std::optional<std::string> user_message;
85 std::string get_error_report(
const std::vector<ValidationError>&
errors,
127 template <
typename T>
131 const std::size_t record_number,
132 const std::size_t item_number,
134 std::vector<ValidationError>&
errors)
const;
137 template <
typename T>
140 std::vector<ValidationError>&
errors)
const;
142 const UnsupportedKeywords m_keywords;
146 const std::unordered_map<std::string, std::function<
void(
const DeckKeyword&
keyword, std::vector<ValidationError>&
errors)>> m_special_validation;
151 template <
typename T>
158 m_allowed_values.push_back(
item);
162 bool operator()(
const T& value)
const
164 return std::find(m_allowed_values.begin(), m_allowed_values.end(), value) != m_allowed_values.end();
168 std::vector<T> m_allowed_values;
Definition AquiferInterface.hpp:35
Definition KeywordValidation.hpp:97
Definition KeywordValidation.hpp:153
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
Definition KeywordValidation.hpp:52
Definition KeywordValidation.hpp:45
Definition KeywordValidation.hpp:72