Go to the documentation of this file.
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);
153 blocks.
reserve(blocks.size() + nBlock*pts.size());
154 cylinders.
reserve(cylinders.size() + nCyl*pts.size());
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;
A keyword and a list of tokens is an 'entry'.
Preparation of fields for PDRFoam.
A class for handling words, derived from Foam::string.
static Form uniform(const Cmpt &s)
A class for handling file names.
static constexpr const zero Zero
Input from file stream, using an ISstream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Different types of constants.
Foam::PDRparams pars
Globals for program parameters (ugly hack)
Istream & operator>>(Istream &, directionInfo &)
void reserve(const label len)
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
volumeType trim(const boundBox &bb)
#define FatalIOErrorInLookup(ios, lookupTag, lookupName, lookupTable)
An enumeration wrapper for classification of a location as being inside/outside of a volume.
Generic templated field type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
DynamicList< T, SizeMin > & append(const T &val)
@ MIXED
A location that is partly inside and outside.
bool readEntry(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX, bool mandatory=true) const
label max(const labelHashSet &set, label maxValue=labelMin)
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
static scalar readFiles(const fileName &obsFileDir, const wordList &obsFileNames, const boundBox &meshBb, DynamicList< PDRobstacle > &blocks, DynamicList< PDRobstacle > &cylinders)
errorManipArg< error, int > exit(error &err, const int errNo=1)
static bool isCylinder(const label id)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Obstacle definitions for PDR.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
A bounding box defined in terms of min/max extrema points.
void scale(const scalar factor)
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
@ OUTSIDE
A location outside the volume.
scalar def_grating_slat_w