36 #ifndef OPM_PARAMETERREQUIREMENT_HEADER
37 #define OPM_PARAMETERREQUIREMENT_HEADER
53 std::string operator()(
const T&)
const {
63 std::string operator()(
double x)
const {
64 if ( (x < 0.0) || (x > 1.0) ) {
65 std::ostringstream stream;
66 stream <<
"The value '" << x
67 <<
"' is not in the interval [0, 1].";
82 std::string operator()(
const T& x)
const {
86 std::ostringstream stream;
87 stream <<
"The value '" << x <<
"' is not positive.";
100 std::string operator()(
const T& x)
const {
104 std::ostringstream stream;
105 stream <<
"The value '" << x <<
"' is not negative.";
118 std::string operator()(
const T& x)
const {
120 std::ostringstream stream;
121 stream <<
"The value '" << x <<
"' is positive.";
136 std::string operator()(
const T& x)
const {
138 std::ostringstream stream;
139 stream <<
"The value '" << x <<
"' is negative.";
154 std::string operator()(
const T& x)
const {
158 return "The value was zero.";
168 std::string operator()(
const std::string& x)
const {
170 return "The string was empty.";
182 template<
class Requirement1,
class Requirement2>
188 std::string operator()(
const T& t)
const {
189 std::string e1 = r1_(t);
190 std::string e2 = r2_(t);
193 }
else if (e2 ==
"") {
196 return e1 +
" AND " + e2;
200 const Requirement1 r1_;
201 const Requirement2 r2_;
209 : elements_(elements) {
210 assert(elements_.size() > 0);
218 if (std::find(elements_.begin(), elements_.end(), x) == elements_.end()) {
219 if (elements_.size() == 1) {
220 return "The string '" + x +
"' is not '" + elements_[0] +
"'.";
222 std::ostringstream stream;
223 stream <<
"The string '" << x <<
"' is not among '";
224 for (
int i = 0; i < int(elements_.size()) - 2; ++i) {
225 stream << elements_[i] <<
"', '";
227 stream << elements_[elements_.size() - 2]
229 << elements_[elements_.size() - 1]
237 const std::vector<std::string> elements_;
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: ParameterRequirement.hpp:183
Definition: ParameterRequirement.hpp:207
std::string operator()(const std::string &x) const
Definition: ParameterRequirement.hpp:217
Definition: ParameterRequirement.hpp:98
Definition: ParameterRequirement.hpp:167
Definition: ParameterRequirement.hpp:134
Definition: ParameterRequirement.hpp:116
Definition: ParameterRequirement.hpp:152
Definition: ParameterRequirement.hpp:51
Definition: ParameterRequirement.hpp:80
Definition: ParameterRequirement.hpp:62