65 const label initialCapacity,
84 const auto& zones =
mesh.pointZones();
85 const auto* zonePtr = zones.cfindZone(
name);
92 <<
"Zone named " <<
name <<
" not found. " 93 <<
"List of available zone names: " << zones.names() <<
nl 99 const auto& zn = *zonePtr;
118 const auto* zonePtr = isA<pointZoneSet>(
set);
122 addressing_ = zonePtr->addressing();
126 addressing_ =
set.sortedToc();
140 for (label
id = 0;
id < maxLen; ++id)
149 addressing_.resize_nocopy(
n);
152 for (label
id = 0;
id < maxLen; ++id)
166 DynamicList<label> newAddressing(addressing_.size());
168 for (
const label
id : elems)
172 newAddressing.push_back(
id);
176 addressing_.transfer(newAddressing);
183 const auto* zonePtr = isA<pointZoneSet>(
set);
188 this->
subset(zonePtr->addressing());
200 DynamicList<label> newAddressing(addressing_);
202 for (
const label
id : elems)
206 newAddressing.push_back(
id);
210 addressing_.transfer(newAddressing);
217 const auto* zonePtr = isA<pointZoneSet>(
set);
222 this->addSet(zonePtr->addressing());
227 this->addSet(refCast<const pointSet>(
set).
sortedToc());
234 DynamicList<label> newAddressing(addressing_.size());
238 for (
const label
id : addressing_)
243 newAddressing.push_back(
id);
247 addressing_.
transfer(newAddressing);
254 DynamicList<label> newAddressing(addressing_.size());
256 for (
const label
id : addressing_)
261 newAddressing.push_back(
id);
265 addressing_.transfer(newAddressing);
289 const bool writeOnProc
293 const word oldTypeName = typeName;
294 const_cast<word&
>(
type()) = pointSet::typeName;
296 const_cast<word&
>(
type()) = oldTypeName;
299 auto& zones =
const_cast<polyMesh&
>(mesh_).pointZones();
300 auto* zonePtr = zones.findZone(
name());
304 zonePtr->resetAddressing(addressing_);
318 return ok && zones.write(writeOnProc);
324 DynamicList<label> newAddressing(addressing_.size());
326 for (
const label pointi : addressing_)
328 const label
newPointi = morphMap.reversePointMap()[pointi];
335 addressing_.transfer(newAddressing);
writeOption
Enumeration defining write preferences.
void size(const label n)
Older name for setAddressableSize.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void clearAddressing(const bool isMeshUpdate=false)
Clear addressing.
label nPoints() const noexcept
Number of mesh points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const word & name() const noexcept
Return the object name.
Cell-face mesh analysis engine.
constexpr char nl
The newline '\n' character (0x0a)
virtual bool set(const label id)
Set an index.
A simple container for options an IOstream can normally have.
bool isAnyRead() const noexcept
True if any reading may be required (ie, != NO_READ)
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
void updateSet()
Sort addressing and make pointSet part consistent with addressing.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
virtual void addSet(const labelUList &elems)
Add given elements to the set.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
defineTypeName(manifoldCellsMeshObject)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A class for handling words, derived from Foam::string.
void sort(UList< T > &list)
Sort the list.
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
bool isReadRequired() const noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
General set of labels of mesh quantity (points, cells, faces).
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write pointZone using stream options.
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
void transfer(HashTable< T, Key, Hash > &rhs)
Transfer contents into this table.
virtual void subtractSet(const labelUList &elems)
Subtract given elements from the set.
List< label > sortedToc(const UList< bool > &bools)
Return the (sorted) values corresponding to 'true' entries.
virtual void invert(const label maxLen)
Invert contents.
Mesh consisting of general polyhedral cells.
virtual void sync(const polyMesh &mesh)
Sync set across coupled patches. Adds coupled points to set.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
virtual void check(const label maxSize)
Check limits on addressable range.
virtual void subset(const labelUList &elems)
Subset contents. Only elements present in both sets remain.
virtual void sync(const polyMesh &mesh)
Sync pointZoneSet across coupled patches.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
void clearStorage()
Remove all entries from table and the table itself.
Like pointSet but -reads data from pointZone -updates pointZone when writing.
pointZoneSet(const polyMesh &mesh, const word &name, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE)
Construct from objectRegistry and name.
readOption
Enumeration defining read preferences.