68#ifndef Foam_PDRblock_H
69#define Foam_PDRblock_H
126 void reset(
const scalar low,
const scalar upp,
const label
nCells);
138 inline
bool contains(const scalar
p) const;
141 inline const scalar&
min() const;
144 inline const scalar&
max() const;
147 inline scalar
centre() const;
150 inline scalar
length() const;
156 inline scalar
width(const label i) const;
160 inline scalar
C(const label i) const;
171 label findCell(const scalar
p) const;
176 label
findIndex(const scalar
p, const scalar tol) const;
180 inline const scalar&
clamp(const scalar& val) const;
183 const scalar&
clip(const scalar& val)
const {
return clamp(val); }
211 void append(
const scalar
p, label nDiv, scalar expRatio=1);
214 void prepend(
const scalar
p, label nDiv, scalar expRatio=1);
246 enum controlType : uint8_t
255 const static Enum<controlType> controlNames_;
292 bool isSphere()
const;
295 bool onGround()
const;
299 bool onGround(
const bool on);
340 static bool checkMonotonic
347 void addDefaultPatches();
357 const scalar scaleFactor = -1,
370 label addInternalFaces
380 label addBoundaryFaces
502 inline scalar
dx(
const label i)
const;
508 inline scalar
dy(
const label j)
const;
514 inline scalar
dz(
const label
k)
const;
520 inline vector span(
const label i,
const label j,
const label
k)
const;
526 inline point grid(
const label i,
const label j,
const label
k)
const;
532 inline point C(
const label i,
const label j,
const label
k)
const;
538 inline scalar
V(
const label i,
const label j,
const label
k)
const;
545 inline scalar
width(
const label i,
const label j,
const label
k)
const;
569 Ostream&
blockMeshDict(Ostream&
os,
const bool withHeader=
false)
const;
578 autoPtr<polyMesh>
mesh(
const IOobject&
io)
const;
582 autoPtr<polyMesh>
innerMesh(
const IOobject&
io)
const;
static const Foam::dimensionedScalar C("", Foam::dimTemperature, 234.5)
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Grid locations in an axis direction.
scalar length() const
The difference between min/max values, zero for an empty list.
label findIndex(const scalar p, const scalar tol) const
Find the grid index, within the given tolerance.
void checkIndex(const label i) const
Check that element index is within valid range.
const scalar & clamp(const scalar &val) const
Return value clamped to min/max limits.
bool good() const noexcept
The location list is valid if it contains 2 or more points.
label findCell(const scalar p) const
Find the cell index enclosing this location.
scalar centre() const
Mid-point location, zero for an empty list.
scalarMinMax edgeLimits() const
Return min/max edge lengths.
label nPoints() const noexcept
The number of points in this direction.
void reset(const scalar low, const scalar upp, const label nCells)
Reset with min/max range and number of divisions.
const scalar & min() const
The first() value is considered the min value.
label nCells() const noexcept
The number of cells in this direction.
const scalar & clip(const scalar &val) const
Return value clamped to min/max limits.
gradingDescriptors grading() const
Return edge grading descriptors for the locations.
const scalar & max() const
The last() value is considered the max value.
scalar width(const label i) const
Cell size at element position.
bool contains(const scalar p) const
True if the location is within the range.
A single block x-y-z rectilinear mesh addressable as i,j,k with simplified creation....
scalar V(const label i, const label j, const label k) const
Cell volume at i,j,k position.
const scalarMinMax & edgeLimits() const noexcept
The min/max edge length.
static const Enum< expansionType > expansionNames_
Named enumerations for the expansion type.
scalar dx(const label i) const
Cell size in x-direction at i position.
point C(const label i, const label j, const label k) const
Cell centre at i,j,k position.
bool read(const dictionary &dict)
Read dictionary.
void reset(const UList< scalar > &xgrid, const UList< scalar > &ygrid, const UList< scalar > &zgrid)
Reset grid locations and mesh i-j-k sizing.
vector span(const label i, const label j, const label k) const
Cell dimensions at i,j,k position.
PDRblock()
Default construct, zero-size, inverted bounds etc.
autoPtr< polyMesh > innerMesh(const IOobject &io) const
Create polyMesh for inner-mesh only, ignore any outer block definitions.
const Vector< location > & grid() const noexcept
The grid point locations in the i,j,k (x,y,z) directions.
scalar dy(const label j) const
Cell size in y-direction at j position.
const boundBox & bounds() const noexcept
The mesh bounding box.
static const PDRblock & null() noexcept
Return a null PDRblock (reference to a nullObject).
scalar dz(const label k) const
Cell size in z-direction at k position.
Vector< gradingDescriptors > grading() const
Equivalent edge grading descriptors in (x,y,z) directions.
expansionType
The expansion type.
@ EXPAND_RELATIVE
Relative expansion ratio.
@ EXPAND_UNIFORM
Uniform expansion (ie, no expansion).
@ EXPAND_RATIO
End/start ratio.
void writeBlockMeshDict(const IOobject &io) const
Write an equivalent blockMeshDict.
scalar width(const label i, const label j, const label k) const
Characteristic cell size at i,j,k position.
dictionary blockMeshDict() const
Content for an equivalent blockMeshDict.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
UList(const UList< scalar > &) noexcept=default
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A multi-block mesh generator.
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,...
List of gradingDescriptor for the sections of a block with additional IO functionality.
void checkIndex(const label i, const label j, const label k, const bool allowExtra=false) const
Check indices are within ni,nj,nk range.
const labelVector & sizes() const noexcept
The (i,j,k) addressing dimensions.
void clear()
Reset to (0,0,0) sizing.
A simple i-j-k (row-major order) to linear addressing for a rectilinear mesh. Since the underlying me...
ijkMesh()
Construct zero-sized.
label nCells() const
The number of mesh cells (nx*ny*nz) in the i-j-k mesh.
Mesh consisting of general polyhedral cells.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
dimensionedScalar pos(const dimensionedScalar &ds)
label findIndex(const ListType &input, typename ListType::const_reference val, const label start=0)
Deprecated(2017-10) search for first occurrence of the given element.
const T & NullObjectRef() noexcept
Const reference (of type T) to the nullObject.
List< label > labelList
A List of labels.
Vector< label > labelVector
Vector of labels.
Vector2D< scalar > vector2D
A 2D vector of scalars obtained from the generic Vector2D.
dimensionSet clamp(const dimensionSet &a, const dimensionSet &range)
MinMax< scalar > scalarMinMax
A scalar min/max range.
Vector2D< label > labelVector2D
A 2D vector of labels obtained from the generic Vector2D.
vector point
Point is a vector.
vectorField pointField
pointField is a vectorField.
List< scalar > scalarList
List of scalar.
The begin/end nodes for each segment, with divisions and expansion for each segment.
gradingDescriptors grading() const
Return edge grading descriptors for the locations.
scalarList expansion_
The expansion ratio per segment.
labelList divisions_
The number of division per segment.
void prepend(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to front of list (push_front).
void append(const scalar p, label nDiv, scalar expRatio=1)
Add point/divisions/expand to end of list (push_back).
void resize(label len)
Resize lists.
label nCells() const
Total number of cells in this direction.
void writeDict(Ostream &os, const direction cmpt) const
Write as dictionary contents for specified vector direction.