41 const word obsType(is);
44 auto* mfuncPtr = readdictionaryMemberFunctionTable(obsType);
53 *readdictionaryMemberFunctionTablePtr_
57 mfuncPtr(*
this,
dict);
78 label nProtruding = 0;
82 if (!obsFileNames.
empty())
84 Info<<
"Reading obstacle files" <<
nl;
89 for (
const word& inputFile : obsFileNames)
91 Info<<
" file: " << inputFile <<
nl;
98 const scalar scaleFactor = inputDict.getOrDefault<scalar>(
"scale", 0);
100 const label verbose = inputDict.getOrDefault<label>(
"verbose", 0);
102 for (
const entry& dEntry : inputDict)
104 if (!dEntry.isDict())
117 label obsGroupId = 0;
120 maxGroup =
max(maxGroup, obsGroupId);
124 obsGroupId = ++maxGroup;
143 obs.
scale(scaleFactor);
151 const label nBlock = (obsInput.size() - nCyl);
158 Info<<
"Read " << obsInput.size() <<
" obstacles (" 159 << nCyl <<
" cylinders) with " 165 <<
"obstacles " << obsInput <<
nl;
183 const scalar shift2 = shift * 2.0;
186 switch (scanObs.typeId)
199 obs.
pt -= point::uniform(shift);
237 totVolume += obs.
volume();
254 obs.
pt -= point::uniform(shift);
259 totVolume += obs.
volume();
289 obs.
pt -= point::uniform(shift);
290 obs.
span += point::uniform(shift2);
312 totVolume += obs.
volume();
325 if (nOutside || nProtruding)
327 Info<<
"Warning: " << nOutside <<
" obstacles outside domain, " 328 << nProtruding <<
" obstacles partly outside domain" <<
nl;
337 Info<<
"Number of obstacles: " 338 << (blocks.
size() + cylinders.
size()) <<
" (" 339 << cylinders.
size() <<
" cylinders)" <<
nl;
Different types of constants.
static bool isCylinder(const label id)
Is obstacle type id cylinder-like?
scalar volume() const
Volume of the obstacle.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void resize(const label len)
Adjust allocated size of list.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
scalar sortBias
Bias for position sorting.
scalar def_grating_slat_w
Default slat thickness grating.
A bounding box defined in terms of min/max extrema points.
An enumeration wrapper for classification of a location as being inside/outside of a volume...
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, IOobjectOption::readOption readOpt=IOobjectOption::MUST_READ) const
Find entry and assign to T val. FatalIOError if it is found and the number of tokens is incorrect...
scalar min_width
Ignore obstacles with second dimension (or diameter) less than this.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
label groupId
The group-id.
Preparation of fields for PDRFoam.
void append(const T &val)
Copy append an element to the end of this list.
A location outside the volume.
volumeType trim(const boundBox &bb)
Trim obstacle to ensure it is within the specified bounding box and return the intersection type...
void reserve(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
A location that is partly inside and outside.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Input from file stream, using an ISstream.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
PtrList< volScalarField > & Y
vector span
The obstacle dimensions (for boxes)
Foam::PDRparams pars
Globals for program parameters (ugly hack)
messageStream Info
Information stream (stdout output on master, null elsewhere)
int typeId
The obstacle type-id.
static scalar readFiles(const fileName &obsFileDir, const wordList &obsFileNames, const boundBox &meshBb, DynamicList< PDRobstacle > &blocks, DynamicList< PDRobstacle > &cylinders)
Read obstacle files and set the lists.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T, or return the given default value. FatalIOError if it is found and the number of...
direction orient
The x/y/z orientation (0,1,2)
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
void scale(const scalar factor)
Scale obstacle dimensions by specified scaling factor.
point pt
The obstacle location.
Obstacle definitions for PDR.
List< treeBoundBox > meshBb(1, treeBoundBox(coarseMesh.points()).extend(rndGen, 1e-3))
A keyword and a list of tokens is an 'entry'.
bool read(Istream &is)
Read name / dictionary.
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)