41 const word obsType(is);
44 auto* mfuncPtr = readdictionaryMemberFunctionTable(obsType);
53 *readdictionaryMemberFunctionTablePtr_
57 mfuncPtr(*
this,
dict);
78 label nProtruding = 0;
80 scalar shift =
pars.obs_expand;
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;
172 if (scanObs.tooSmall(
pars.min_width))
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: "
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)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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)
Trim obstacle to ensure it is within the specified bounding box and return the intersection type.
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.
bool empty() const noexcept
True if List is empty (ie, size() is zero).
void size(const label n)
Older name for setAddressableSize.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
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,...
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,...
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...
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...
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.
List< word > wordList
List of word.
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).
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
vector point
Point is a vector.
static constexpr const zero Zero
Global zero (0).
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).
List< treeBoundBox > meshBb(1, treeBoundBox(coarseMesh.points()).extend(rndGen, 1e-3))