36 Foam::PDRblock::outerControl::controlType
38Foam::PDRblock::outerControl::controlNames_
40 { controlType::OUTER_NONE,
"none" },
41 { controlType::OUTER_EXTEND,
"extend" },
42 { controlType::OUTER_BOX,
"box" },
43 { controlType::OUTER_SPHERE,
"sphere" },
69Foam::PDRblock::outerControl::outerControl()
71 type_(controlType::OUTER_NONE),
72 expandType_(expansionType::EXPAND_RATIO),
82void Foam::PDRblock::outerControl::clear()
84 type_ = controlType::OUTER_NONE;
85 expandType_ = expansionType::EXPAND_RATIO;
89 expansion_ = vector2D::uniform(1);
97 os <<
"Has outer region: " << controlNames_[type_] <<
nl
98 <<
" onGround : " << Switch::name(onGround_) <<
nl
99 <<
" sizes : " << relSize_ <<
nl
100 <<
" nCells : " << nCells_ <<
nl;
104 os <<
"No outer region" <<
nl;
109bool Foam::PDRblock::outerControl::active()
const
111 return (controlType::OUTER_NONE != type_);
115bool Foam::PDRblock::outerControl::isSphere()
const
117 return (controlType::OUTER_SPHERE == type_);
121bool Foam::PDRblock::outerControl::onGround()
const
127bool Foam::PDRblock::outerControl::onGround(
const bool on)
139 type_ = controlNames_.getOrDefault(
"type",
dict, controlType::OUTER_NONE);
140 onGround_ =
dict.getOrDefault(
"onGround",
false);
142 if (controlType::OUTER_NONE == type_)
149 nCells_ = getLazyPair<label>(
"nCells",
dict);
150 relSize_ = getLazyPair<scalar>(
"size",
dict);
153 expansionNames_.getOrDefault
157 expansionType::EXPAND_RATIO
161 if (
dict.found(
"ratios"))
163 expansion_ = getLazyPair<scalar>(
"ratios",
dict);
167 if (expandType_ != expansionType::EXPAND_UNIFORM)
169 expandType_ = expansionType::EXPAND_UNIFORM;
174 if (expandType_ == expansionType::EXPAND_UNIFORM)
176 expansion_ = vector2D::uniform(1);
183 if (nCells_.x() <= 1 || nCells_.y() <= 1)
190 <<
"Too few outer cells: " << nCells_ <<
nl;
193 if (relSize_.x() <= 1 || relSize_.y() <= 1)
200 <<
"Outer dimensions must be > 1. Had " << relSize_ <<
nl;
213 controlType::OUTER_BOX == type_
214 || controlType::OUTER_SPHERE == type_
217 if (relSize_.x() < 2 || relSize_.y() < 2)
220 <<
"Outer dimensions "
221 << relSize_ <<
" too small for "
222 << controlNames_[type_] <<
" - switching to "
223 << controlNames_[controlType::OUTER_EXTEND] <<
nl;
225 type_ = controlType::OUTER_EXTEND;
229 if (controlType::OUTER_SPHERE == type_)
231 if (relSize_.x() < 3 || relSize_.y() < 3)
234 <<
"Outer dimensions "
235 << relSize_ <<
" too small for "
236 << controlNames_[type_] <<
" - switching to "
237 << controlNames_[controlType::OUTER_BOX] <<
nl;
239 type_ = controlType::OUTER_EXTEND;
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
virtual bool read()
Re-read model coefficients if they have changed.
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
void report()
Report the current profiling information.
A token holds an item read from Istream.
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
static Vector2D< T > getLazyPair(const word &name, const dictionary &dict)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)