36 Foam::PDRblock::outerControl::controlType
38 Foam::PDRblock::outerControl::controlNames_
40 { controlType::OUTER_NONE,
"none" },
41 { controlType::OUTER_EXTEND,
"extend" },
42 { controlType::OUTER_BOX,
"box" },
43 { controlType::OUTER_SPHERE,
"sphere" },
69 Foam::PDRblock::outerControl::outerControl()
71 type_(controlType::OUTER_NONE),
72 expandType_(expansionType::EXPAND_RATIO),
84 type_ = controlType::OUTER_NONE;
85 expandType_ = expansionType::EXPAND_RATIO;
89 expansion_ = vector2D::uniform(1);
93 void 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;
109 bool Foam::PDRblock::outerControl::active()
const 111 return (controlType::OUTER_NONE != type_);
115 bool Foam::PDRblock::outerControl::isSphere()
const 117 return (controlType::OUTER_SPHERE == type_);
121 bool Foam::PDRblock::outerControl::onGround()
const 127 bool 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;
static Vector2D< T > getLazyPair(const word &name, const dictionary &dict)
ITstream & lookup(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return an entry data stream. FatalIOError if not found, or not a stream. ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
A token holds an item read from Istream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
#define WarningInFunction
Report a warning using Foam::Warning.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
static Vector2D< Cmpt > uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
Templated 2D Vector derived from VectorSpace adding construction from 2 components, element access using x() and y() member functions and the inner-product (dot-product).
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)