69 Info<<
"constructed scalarRange: " << *
this <<
endl;
78 return type_ == EMPTY;
84 return type_ != EMPTY;
90 return type_ == EXACT;
136 return value >= value_;
139 return value <= value_;
142 return value >= value_ && value <= value2_;
145 return value == value_;
161 && value_ ==
range.value_
162 && value2_ ==
range.value2_
177 range.type_ = scalarRange::EXACT;
188 is.
check(
"scalarRange token read");
192 toks[nTok].isPunctuation()
201 toks[nTok-1].isPunctuation()
205 range.type_ = scalarRange::UPPER;
206 is.
read(toks[nTok++]);
207 is.
check(
"scalarRange token read");
211 if (!toks[nTok-1].isNumber())
214 range.type_ = scalarRange::EMPTY;
216 Info<<
"rejected ill-formed or empty range:";
217 for (
label i=0; i<nTok; ++i)
219 Info<<
" " << toks[i];
225 range.value_ = toks[nTok-1].number();
226 is.
read(toks[nTok++]);
227 is.
check(
"scalarRange token read");
232 for (
label i=0; i<nTok; ++i)
234 Info<<
" " << toks[i];
242 toks[nTok-1].isPunctuation()
246 if (
range.type_ == scalarRange::UPPER)
249 range.type_ = scalarRange::EMPTY;
251 Info<<
"rejected ill-formed range:";
252 for (
label i=0; i<nTok; ++i)
254 Info<<
" " << toks[i];
260 is.
read(toks[nTok++]);
261 is.
check(
"scalarRange token read");
266 for (
label i=0; i<nTok; ++i)
268 Info<<
" " << toks[i];
275 if (toks[nTok-1].isNumber())
277 range.type_ = scalarRange::RANGE;
278 range.value2_ = toks[nTok-1].number();
279 is.
read(toks[nTok++]);
280 is.
check(
"scalarRange token read");
284 range.type_ = scalarRange::LOWER;
291 for (
label i=0; i<nTok; ++i)
293 Info<<
" " << toks[i];
306 !toks[nTok-1].isPunctuation()
312 range.type_ = scalarRange::EMPTY;
315 Info<<
"rejected ill-formed range:";
316 for (
label i=0; i<nTok; ++i)
318 Info<<
" " << toks[i];
331 case scalarRange::LOWER:
332 os <<
range.value_ <<
" <=> Inf";
335 case scalarRange::UPPER:
336 os <<
"-Inf <=> " <<
range.value_;
339 case scalarRange::RANGE:
340 os <<
range.value_ <<
" <=> " <<
range.value2_;
343 case scalarRange::EXACT:
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void setBad()
Set stream to be bad.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
virtual Istream & read(token &)=0
Return next token from stream.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A scalar range specifier.
bool selected(const scalar) const
Return true if the value is within the range.
scalar lower() const
The lower limit.
bool valid() const
Is the range non-empty?
scalar value() const
The value constituting an 'EXACT' match.
bool isExact() const
Is the range 'EXACT'?
bool empty() const
Is the range empty?
bool operator!=(const scalarRange &) const
scalar upper() const
The upper limit.
scalarRange()
Construct an empty range.
bool operator==(const scalarRange &) const
int debugSwitch(const char *name, const int defaultValue=0)
Lookup debug switch or add default value.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< fvMatrix< Type > > operator==(const fvMatrix< Type > &, const fvMatrix< Type > &)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Istream & operator>>(Istream &, pistonPointEdgeData &)
Ostream & operator<<(Ostream &os, const fvConstraints &constraints)