44Foam::blockMesh::strategyNames_
46 { mergeStrategy::MERGE_TOPOLOGY,
"topology" },
47 { mergeStrategy::MERGE_POINTS,
"points" },
97 if ((val > 0) && !
equal(val, 1))
109 bool nonUnity =
false;
112 if (scale[cmpt] <= 0)
116 else if (!
equal(scale[cmpt], 1))
124 if (
equal(scale.x(), scale.y()) &&
equal(scale.x(), scale.z()))
148 transformType_ = transformTypes::NO_TRANSFORM;
151 auto csysPtr = coordinateSystem::NewIfPresent(
dict,
"transform");
155 transform_ = csysPtr();
158 if (
magSqr(transform_.origin()) > ROOTVSMALL)
160 transformType_ |= transformTypes::TRANSLATION;
164 if (!transform_.R().is_identity(ROOTVSMALL))
166 transformType_ |= transformTypes::ROTATION;
187 transformType_ |= transformTypes::PRESCALING;
189 else if (scaleType == 3)
191 transformType_ |= transformTypes::PRESCALING3;
206 {{
"convertToMeters", 1012}},
214 transformType_ |= transformTypes::SCALING;
216 else if (scaleType == 3)
218 transformType_ |= transformTypes::SCALING3;
222 return bool(transformType_);
228Foam::blockMesh::blockMesh
232 mergeStrategy strategy,
238 checkFaceCorrespondence_
240 meshDict_.getOrDefault(
"checkFaceCorrespondence", true)
242 mergeStrategy_(strategy),
243 transformType_(transformTypes::NO_TRANSFORM),
255 meshDict_.
found(
"geometry")
256 ? meshDict_.subDict(
"geometry")
262 meshDict_.
lookup(
"vertices"),
269 topologyPtr_(createTopology(meshDict_,
regionName))
273 strategyNames_.
readIfPresent(
"mergeType", meshDict_, mergeStrategy_);
284 <<
"Detected collapsed blocks "
285 <<
"- using merge points instead of merge topology" <<
nl
295 calcGeometricalMerge();
300 calcTopologicalMerge();
309 return bool(topologyPtr_);
336 if (applyTransform && hasPointTransforms())
340 inplacePointTransforms(tpts.ref());
351 const polyPatchList& topoPatches = topology().boundaryMesh();
353 PtrList<dictionary>
patchDicts(topoPatches.size());
358 forAll(topoPatches, patchi)
361 topoPatches[patchi].write(
os);
394 if (patches_.empty())
405 return topology().boundaryMesh().names();
429 if (blk.zoneName().size())
441 return bool(transformType_);
452 if (transformType_ & transformTypes::PRESCALING)
456 p *= prescaling_.x();
459 else if (transformType_ & transformTypes::PRESCALING3)
467 if (transformType_ & transformTypes::ROTATION)
469 const tensor rot(transform_.R());
471 if (transformType_ & transformTypes::TRANSLATION)
473 const point origin(transform_.origin());
488 else if (transformType_ & transformTypes::TRANSLATION)
490 const point origin(transform_.origin());
498 if (transformType_ & transformTypes::SCALING)
505 else if (transformType_ & transformTypes::SCALING3)
520 if (hasPointTransforms())
524 inplacePointTransforms(tpts.ref());
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool readIfPresent(const word &key, const dictionary &dict, EnumType &val, const bool warnOnly=false) const
Find an entry if present, and assign to T val.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
void reset(const char *buffer, size_t nbytes)
Reset input area, position to buffer start and clear errors.
An input stream of tokens.
const token & peek() const noexcept
Failsafe peek at what the next read would return, including handling of any putback.
An OSstream with internal List storage.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
constexpr PtrList() noexcept
label size() const noexcept
The number of entries in the list.
label count() const noexcept
The number of non-nullptr entries in the list.
static constexpr direction nComponents
Number of components in this vector space.
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
A multi-block mesh generator.
const faceListList & patches() const
Return the patch face lists.
bool hasPointTransforms() const noexcept
True if scaling and/or transformations are needed.
const pointField & vertices() const noexcept
Reference to point field defining the blocks, these points are unscaled and non-transformed.
static bool verboseOutput
The default verbosity (true).
wordList patchNames() const
Return the patch names.
int verbose() const noexcept
Output verbosity level.
bool good() const noexcept
True if the blockMesh topology exists.
tmp< pointField > globalPosition(const pointField &localPoints) const
Apply coordinate transforms and scaling.
mergeStrategy
The block merging strategy.
@ DEFAULT_MERGE
Default (TOPOLOGY), not selectable.
@ MERGE_POINTS
"points" merge by point geometry
label numZonedBlocks() const
Number of blocks with specified zones.
bool inplacePointTransforms(pointField &pts) const
Apply coordinate transforms and scaling.
const cellShapeList & cells() const
Return cell shapes list.
const pointField & points() const
The points for the entire mesh. These points are scaled and transformed.
PtrList< dictionary > patchDicts() const
Patch information from the topology mesh.
const polyMesh & topology() const
The blockMesh topology as a polyMesh unscaled and non-transformed.
PtrList< block > blockList
The list of blocks is stored as a PtrList.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
void checkITstream(const ITstream &is) const
Check after reading if the input token stream has unconsumed tokens remaining or if there were no tok...
Lookup type of boundary radiation properties.
A class for managing temporary objects.
static tmp< T > New(Args &&... args)
Construct tmp with forwarding arguments.
bool isNumber() const noexcept
Token is (signed/unsigned) integer type, FLOAT or DOUBLE.
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
#define defineDebugSwitch(Type, Value)
Define the debug information.
OBJstream os(runTime.globalPath()/outputName)
Different types of constants.
PtrList< polyPatch > polyPatchList
Store lists of polyPatch as a PtrList.
List< word > wordList
List of word.
bool equal(const T &a, const T &b)
Compare two values for equality.
refinementData transform(const tensor &, const refinementData val)
No-op rotational transform for base types.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
int readScaling(const entry *eptr, vector &scale)
List< faceList > faceListList
List of faceList.
pointField vertices(const blockVertexList &bvl)
vector point
Point is a vector.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
vectorField pointField
pointField is a vectorField.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
List< cellShape > cellShapeList
List of cellShape.
static int getVerbosity(const dictionary &dict, int verbosity)
constexpr char nl
The newline '\n' character (0x0a).
PtrList< dictionary > patchDicts
#define forAll(list, i)
Loop across all elements in list.