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 "
160 << pts.
size() <<
" locations" <<
nl;
164 Info<<
"locations " << pts <<
nl
165 <<
"obstacles " << obsInput <<
nl;
177 for (
const point& origin : pts)
183 const scalar shift2 = shift * 2.0;
186 switch (scanObs.typeId)
237 totVolume += obs.
volume();
259 totVolume += obs.
volume();
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;
Preparation of fields for PDRFoam.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void append(const T &val)
Copy append an element to the end of this list.
void reserve(const label len)
Input from file stream, using an ISstream.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void resize(const label len)
Adjust allocated size of list.
Obstacle definitions for PDR.
static bool isCylinder(const label id)
Is obstacle type id cylinder-like?
scalar volume() const
Volume of the obstacle.
scalar sortBias
Bias for position sorting.
point pt
The obstacle location.
direction orient
The x/y/z orientation (0,1,2)
volumeType trim(const boundBox &bb)
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.
label groupId
The group-id.
void clear()
Reset to a zero obstacle.
vector span
The obstacle dimensions (for boxes)
bool read(Istream &is)
Read name / dictionary.
int typeId
The obstacle type-id.
void scale(const scalar factor)
Scale obstacle dimensions by specified scaling factor.
scalar def_grating_slat_w
Default slat thickness grating.
scalar min_width
Ignore obstacles with second dimension (or diameter) less than this.
virtual bool read()
Re-read model coefficients if they have changed.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
A bounding box defined in terms of min/max extrema points.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
A keyword and a list of tokens is an 'entry'.
A class for handling file names.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
@ OUTSIDE
A location outside the volume.
@ MIXED
A location that is partly inside and outside.
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalIOError.
Different types of constants.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Istream & operator>>(Istream &, directionInfo &)
Foam::PDRparams pars
Globals for program parameters (ugly hack)
static constexpr const zero Zero
Global zero (0)
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))