20#ifndef OPM_KEYWORDVALIDATION_HEADER_INCLUDED
21#define OPM_KEYWORDVALIDATION_HEADER_INCLUDED
23#include <opm/common/OpmLog/KeywordLocation.hpp>
26#include <initializer_list>
30#include <unordered_map>
41namespace KeywordValidation
46 std::optional<std::string> message;
53 std::function<
bool(T)> validator;
54 std::optional<std::string> message;
58 using UnsupportedKeywords = std::map<std::string, UnsupportedKeywordProperties>;
62 using PartiallySupportedKeywordItems = std::map<size_t, PartiallySupportedKeywordProperties<T>>;
66 using PartiallySupportedKeywords = std::map<std::string, PartiallySupportedKeywordItems<T>>;
75 std::optional<size_t> item_number;
76 std::optional<std::string> item_value;
77 std::optional<std::string> user_message;
84 std::string get_error_report(
const std::vector<ValidationError>&
errors,
116 void validateDeck(
const Deck& deck,
126 template <
typename T>
130 const size_t record_number,
131 const size_t item_number,
133 std::vector<ValidationError>&
errors)
const;
136 template <
typename T>
139 std::vector<ValidationError>&
errors)
const;
141 const UnsupportedKeywords m_keywords;
145 const std::unordered_map<std::string, std::function<
void(
const DeckKeyword&
keyword, std::vector<ValidationError>&
errors)>> m_special_validation;
150 template <
typename T>
157 m_allowed_values.push_back(
item);
161 bool operator()(
const T& value)
const
163 return std::find(m_allowed_values.begin(), m_allowed_values.end(), value) != m_allowed_values.end();
167 std::vector<T> m_allowed_values;
Definition AquiferInterface.hpp:35
Definition KeywordValidation.hpp:96
Definition KeywordValidation.hpp:152
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition BlackoilPhases.hpp:27
Definition KeywordValidation.hpp:51
Definition KeywordValidation.hpp:44
Definition KeywordValidation.hpp:71