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;
110 const polyMesh&
mesh,
116 pointZoneSet(
mesh,
name, label(0), wOpt)
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)
168 for (
const label
id : elems)
172 newAddressing.push_back(
id);
176 addressing_.transfer(newAddressing);
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);
222 this->addSet(zonePtr->addressing());
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);
282 return mesh.nPoints();
289 const bool writeOnProc
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);
343 const primitiveMesh&
mesh,
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void push_back(const T &val)
Copy append an element to the end of this list.
List< Key > sortedToc() const
The table of contents (the keys) in sorted order.
void reserve(label numEntries)
Reserve space for at least the specified number of elements (not the number of buckets) and regenerat...
void clearStorage()
Remove all entries from table and the table itself.
label size() const noexcept
The number of elements in table.
bool isAnyRead() const noexcept
True if any reading may be required (ie, != NO_READ).
static bool isReadRequired(readOption opt) noexcept
True if (MUST_READ | READ_MODIFIED) bits are set.
readOption
Enumeration defining read preferences.
writeOption
Enumeration defining write preferences.
static bool isAnyRead(readOption opt) noexcept
True if any reading may be required (ie, != NO_READ).
A simple container for options an IOstream can normally have.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
const labelList & reversePointMap() const noexcept
Reverse point map.
pointSet(const IOobject &io)
Construct from IOobject.
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.
Like pointSet but -reads data from pointZone -updates pointZone when writing.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write pointZone using stream options.
virtual void invert(const label maxLen)
Invert contents.
pointZoneSet(const polyMesh &mesh, const word &name, IOobjectOption::readOption rOpt=IOobjectOption::MUST_READ, IOobjectOption::writeOption wOpt=IOobjectOption::NO_WRITE)
Construct from objectRegistry and name.
virtual label maxSize(const polyMesh &mesh) const
Return max index+1.
virtual void sync(const polyMesh &mesh)
Sync pointZoneSet across coupled patches.
virtual void subset(const labelUList &elems)
Subset contents. Only elements present in both sets remain.
virtual void subtractSet(const labelUList &elems)
Subtract given elements from the set.
virtual void writeDebug(Ostream &os, const primitiveMesh &, const label maxLen) const
Write maxLen items with label and coordinates.
virtual void updateMesh(const mapPolyMesh &morphMap)
Update any stored data for new labels.
virtual void addSet(const labelUList &elems)
Add given elements to the set.
void updateSet()
Sort addressing and make pointSet part consistent with addressing.
Mesh consisting of general polyhedral cells.
void clearAddressing(const bool isMeshUpdate=false)
Clear addressing.
Cell-face mesh analysis engine.
virtual bool writeObject(IOstreamOption streamOpt, const bool writeOnProc) const
Write using stream options.
General set of labels of mesh quantity (points, cells, faces).
virtual bool set(const label id)
Set an index.
virtual void check(const label maxSize)
Check limits on addressable range.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Type & refCast(U &obj)
A dynamic_cast (for references) to Type reference.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
List< T > subset(const BoolListType &select, const UList< T > &input, const bool invert=false)
Extract elements of the input list when select is true.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
const word GlobalIOList< Tuple2< scalar, vector > >::typeName("scalarVectorTable")
const Type * isA(const U &obj)
Attempt dynamic_cast to Type.
void sort(UList< T > &list)
Sort the list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
UList< label > labelUList
A UList of labels.
constexpr char nl
The newline '\n' character (0x0a).