40 #ifndef Foam_PDRobstacle_H 41 #define Foam_PDRobstacle_H 62 Istream&
operator>>(Istream& is, PDRobstacle& obs);
63 Ostream& operator<<(Ostream& os, const InfoProxy<PDRobstacle>& info);
131 inline scalar
dia()
const {
return span[vector::X]; }
133 inline scalar
len()
const {
return span[vector::Z]; }
135 inline scalar&
dia() {
return span[vector::X]; }
137 inline scalar&
len() {
return span[vector::Z]; }
226 inline scalar
x()
const {
return pt.x(); }
227 inline scalar
y()
const {
return pt.y(); }
228 inline scalar
z()
const {
return pt.z(); }
229 inline scalar&
x() {
return pt.x(); }
230 inline scalar&
y() {
return pt.y(); }
231 inline scalar&
z() {
return pt.z(); }
235 inline static bool isCylinder(
const label
id);
245 void scale(
const scalar factor);
251 bool tooSmall(
const scalar minWidth)
const;
260 const int groupTypeId,
261 const string& buffer,
262 const label lineNo = -1,
309 bool operator<(
const PDRobstacle& a,
const PDRobstacle&
b);
312 inline bool operator!=(
const PDRobstacle& a,
const PDRobstacle&
b)
328 class obstacleGrouping
330 public DynamicList<point>
391 return size() * nObstacle_;
397 return size() * nCylinder_;
403 return size() * (nObstacle_ + nCylinder_);
410 void append(
const scalar
x,
const scalar
y,
const scalar z)
scalar volume() const
Volume of the obstacle.
void addObstacle()
Increment the number of obstacles.
A class for handling file names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
label nCylinder() const
The number of cylinder-like obstacles.
labelPair readObstacleFiles(const fileName &obsFileDir, const wordList &obsFileNames, Map< obstacleGrouping > &groups)
Read obstacle files, do counting only.
static scalar legacyReadFiles(const fileName &obsFileDir, const wordList &obsFileNames, const boundBox &meshBb, DynamicList< PDRobstacle > &blocks, DynamicList< PDRobstacle > &cylinders)
Read obstacle files and add to the lists.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Write faces/points (optionally with fields) as a vtp file or a legacy vtk file.
scalar sortBias
Bias for position sorting.
static label addPieces(vtk::surfaceWriter &surfWriter, const UList< PDRobstacle > &list, label pieceId=0)
Add pieces to vtp output.
Begin list [isseparator].
void clear()
Reset to a zero obstacle.
A bounding box defined in terms of min/max extrema points.
static constexpr int maxBlowoffPressure
The max blowoff pressure [bar].
An enumeration wrapper for classification of a location as being inside/outside of a volume...
bool operator<(const IOstreamOption::versionNumber &a, const IOstreamOption::versionNumber &b) noexcept
Version A older than B.
label nObstacle() const
The number of obstacles.
declareMemberFunctionSelectionTable(void, PDRobstacle, read, dictionary,(PDRobstacle &obs, const dictionary &dict),(obs, dict))
constexpr const char *const group
Group name for atomic constants.
void append(const scalar x, const scalar y, const scalar z)
Add a location.
InfoProxy< PDRobstacle > info() const noexcept
Return info proxy, used to print information to a stream.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
A class for handling words, derived from Foam::string.
Istream & operator>>(Istream &, directionInfo &)
Locations for each instance of an obstacle group.
static const word null
An empty word.
label groupId
The group-id.
PDRobstacle()
Construct zero-initialized.
obstacleGrouping()
Construct null.
void append(const point &val)
Copy append an element to the end of this list.
label nTotalCylinder() const
The number of locations x number of cylinder-like obstacles.
bool isCylinder() const
Is obstacle cylinder-like?
volumeType trim(const boundBox &bb)
Trim obstacle to ensure it is within the specified bounding box and return the intersection type...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void addCylinder()
Increment the number of cylinder-like obstacles.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
static void generateVtk(const fileName &outputDir, const UList< PDRobstacle > &obslist, const UList< PDRobstacle > &cyllist)
Generate multi-piece VTK (vtp) file of obstacles.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
label size() const noexcept
The number of elements in the container.
label nTotalObstacle() const
The number of locations x number of obstacles.
OBJstream os(runTime.globalPath()/outputName)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
label nTotal() const
The number of locations x number of obstacles.
void readProperties(const dictionary &dict)
Read the 'name' identifier if present.
Macros to ease declaration of member function selection tables.
A helper class for outputting values to Ostream.
vector point
Point is a vector.
bool setFromLegacy(const int groupTypeId, const string &buffer, const label lineNo=-1, const word &inputFile=word::null)
Set values from single-line, multi-column format.
legacyTypes
Obstacle types (legacy numbering)
PtrList< volScalarField > & Y
vector span
The obstacle dimensions (for boxes)
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.
bool operator!=(const eddy &a, const eddy &b)
bool tooSmall(const scalar minWidth) const
True if the obstacle is considered to be too small.
direction orient
The x/y/z orientation (0,1,2)
void scale(const scalar factor)
Scale obstacle dimensions by specified scaling factor.
friend Istream & operator>>(Istream &is, PDRobstacle &obs)
point pt
The obstacle location.
scalar x() const
Obstacle position accessors.
Obstacle definitions for PDR.
meshedSurface surface() const
Surface (points, faces) representation.
List< treeBoundBox > meshBb(1, treeBoundBox(coarseMesh.points()).extend(rndGen, 1e-3))
void clear()
Clear obstacle count and locations.
A HashTable to objects of type <T> with a label key.
bool read(Istream &is)
Read name / dictionary.