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;
93void Foam::PDRblock::outerControl::report(Ostream&
os)
const
97 os <<
"Has outer region: " << controlNames_[type_] <<
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_)
161 if (
dict.found(
"ratios"))
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...
static const Enum< expansionType > expansionNames_
Named enumerations for the expansion type.
@ EXPAND_UNIFORM
Uniform expansion (ie, no expansion).
@ EXPAND_RATIO
End/start ratio.
static const char * name(bool b) noexcept
A string representation of bool as "false" / "true".
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
static Vector2D< Cmpt > uniform(const Cmpt &s)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void clear()
Reset to (0,0,0) sizing.
A token holds an item read from Istream.
bool isNumber() const noexcept
Token is (signed/unsigned) integer type, 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.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static Vector2D< T > getLazyPair(const word &name, const dictionary &dict)
static constexpr const zero Zero
Global zero (0).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
constexpr char nl
The newline '\n' character (0x0a).