Go to the documentation of this file.
41 const word obsType(is);
44 const auto mfIter = readdictReadMemberFunctionTablePtr_->cfind(obsType);
49 <<
"Unknown obstacle type: " << obsType <<
nl
50 <<
"Valid types:" <<
nl
51 << readdictReadMemberFunctionTablePtr_->sortedToc() <<
nl
55 mfIter()(*
this,
dict);
76 label nProtruding = 0;
80 if (!obsFileNames.empty())
82 Info<<
"Reading obstacle files" <<
nl;
87 for (
const word& inputFile : obsFileNames)
89 Info<<
" file: " << inputFile <<
nl;
96 const scalar scaleFactor = inputDict.getOrDefault<scalar>(
"scale", 0);
98 const label verbose = inputDict.getOrDefault<label>(
"verbose", 0);
100 for (
const entry& dEntry : inputDict)
102 if (!dEntry.isDict())
115 label obsGroupId = 0;
118 maxGroup =
max(maxGroup, obsGroupId);
122 obsGroupId = ++maxGroup;
141 obs.
scale(scaleFactor);
149 const label nBlock = (obsInput.size() - nCyl);
151 blocks.
reserve(blocks.size() + nBlock*pts.size());
152 cylinders.
reserve(cylinders.size() + nCyl*pts.size());
156 Info<<
"Read " << obsInput.size() <<
" obstacles ("
157 << nCyl <<
" cylinders) with "
158 << pts.size() <<
" locations" <<
nl;
162 Info<<
"locations " << pts <<
nl
163 <<
"obstacles " << obsInput <<
nl;
175 for (
const point& origin : pts)
181 const scalar shift2 = shift * 2.0;
184 switch (scanObs.typeId)
235 totVolume += obs.
volume();
257 totVolume += obs.
volume();
310 totVolume += obs.
volume();
323 if (nOutside || nProtruding)
325 Info<<
"Warning: " << nOutside <<
" obstacles outside domain, "
326 << nProtruding <<
" obstacles partly outside domain" <<
nl;
335 Info<<
"Number of obstacles: "
336 << (blocks.size() + cylinders.size()) <<
" ("
337 << 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 Vector< Cmpt > uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
A class for handling file names.
static constexpr const zero Zero
Global zero (0)
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 &)
List< treeBoundBox > meshBb(1, treeBoundBox(boundBox(coarseMesh.points(), false)).extend(rndGen, 1e-3))
volumeType trim(const boundBox &bb)
Trim obstacle to ensure it is within the specified bounding box.
void reserve(const label nElem)
Reserve allocation space for at least this size.
direction orient
The x/y/z orientation (0,1,2)
int typeId
The obstacle type-id.
An enumeration wrapper for classification of a location as being inside/outside of a volume.
vector span
The obstacle dimensions (for boxes)
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
point pt
The obstacle location.
DynamicList< T, SizeMin > & append(const T &val)
Append an element to the end of this list.
void clear()
Clear the addressed list, i.e. set the size to zero.
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)
Find the max value in labelHashSet, optionally limited by second argument.
scalar min_width
Ignore obstacles with second dimension (or diameter) less than this.
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)
Read obstacle files and set the lists.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool read(Istream &is)
Read name / dictionary.
static bool isCylinder(const label id)
Is obstacle type id cylinder-like?
scalar sortBias
Bias for position sorting.
Obstacle definitions for PDR.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
A bounding box defined in terms of min/max extrema points.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void scale(const scalar factor)
Scale obstacle dimensions by specified scaling 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
A location outside the volume.
scalar volume() const
Volume of the obstacle.
scalar def_grating_slat_w
Default slat thickness grating.
label groupId
The group-id.