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()))
146bool Foam::blockMesh::readPointTransforms(
const dictionary&
dict)
148 transformType_ = transformTypes::NO_TRANSFORM;
150 const dictionary* dictptr;
155 transform_ = coordSystem::cartesian(*dictptr);
160 transformType_ |= transformTypes::TRANSLATION;
164 if (!transform_.
R().is_identity(ROOTVSMALL))
166 transformType_ |= transformTypes::ROTATION;
177 prescaling_ = vector::uniform(1);
187 transformType_ |= transformTypes::PRESCALING;
189 else if (scaleType == 3)
191 transformType_ |= transformTypes::PRESCALING3;
198 scaling_ = vector::uniform(1);
206 {{
"convertToMeters", 1012}},
214 transformType_ |= transformTypes::SCALING;
216 else if (scaleType == 3)
218 transformType_ |= transformTypes::SCALING3;
222 return bool(transformType_);
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();
355 forAll(topoPatches, patchi)
358 topoPatches[patchi].write(
os);
390 if (patches_.empty())
401 return topology().boundaryMesh().names();
423 for (
const block& blk : blocks)
425 if (blk.zoneName().size())
437 return bool(transformType_);
448 if (transformType_ & transformTypes::PRESCALING)
452 p *= prescaling_.x();
455 else if (transformType_ & transformTypes::PRESCALING3)
463 if (transformType_ & transformTypes::ROTATION)
465 const tensor rot(transform_.R());
467 if (transformType_ & transformTypes::TRANSLATION)
469 const point origin(transform_.origin());
484 else if (transformType_ & transformTypes::TRANSLATION)
486 const point origin(transform_.origin());
494 if (transformType_ & transformTypes::SCALING)
501 else if (transformType_ & transformTypes::SCALING3)
516 if (hasPointTransforms())
520 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
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,...
Input from string buffer, using a ISstream. Always UNCOMPRESSED.
An input stream of tokens.
const token & peek() const
Failsafe peek at what the next read would return,.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
label size() const noexcept
The number of elements in the list.
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
static bool verboseOutput
The default verbosity (true)
wordList patchNames() const
Return the patch names.
int verbose() const noexcept
Output verbosity level.
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 valid() const noexcept
True if the blockMesh topology exists.
bool inplacePointTransforms(pointField &pts) const
Apply coordinate transforms and scaling.
const cellShapeList & cells() const
Return cell shapes list.
const pointField & points() const
PtrList< dictionary > patchDicts() const
Patch information from the topology mesh.
Creates a single block of cells from point coordinates, numbers of cells in each direction and an exp...
virtual const point & origin() const
Return origin.
virtual const tensor & R() const
Return const reference to the rotation tensor.
virtual void clear()
Reset origin and rotation to an identity coordinateSystem.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
const entry * findCompat(const word &keyword, std::initializer_list< std::pair< const char *, int > > compat, enum keyType::option matchOpt) const
dictionary * findDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find and return a sub-dictionary pointer if present.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
entry * findEntry(const word &keyword, enum keyType::option matchOpt=keyType::REGEX)
Find for an entry (non-const access) with the given keyword.
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
static constexpr direction nComponents
Number of components in bool is 1.
constant condensation/saturation model.
Lookup type of boundary radiation properties.
A class for managing temporary objects.
bool isNumber() const noexcept
Token is LABEL, FLOAT or DOUBLE.
A class for handling words, derived from Foam::string.
Foam::word regionName(Foam::polyMesh::defaultRegion)
#define defineDebugSwitch(Type, Value)
Define the debug information.
OBJstream os(runTime.globalPath()/outputName)
dimensionSet transform(const dimensionSet &ds)
Return the argument; transformations do not change the dimensions.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool equal(const T &s1, const T &s2)
Compare two values for equality.
int readScaling(const entry *eptr, vector &scale)
pointField vertices(const blockVertexList &bvl)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
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.