80 label zoneID = pointZones.findIndex(
name);
84 r == IOobject::MUST_READ
85 || r == IOobject::MUST_READ_IF_MODIFIED
86 || (r == IOobject::READ_IF_PRESENT && zoneID != -1)
89 const pointZone& fz = pointZones[zoneID];
99 pointZoneSet::pointZoneSet
101 const polyMesh&
mesh,
115 pointZoneSet::pointZoneSet
117 const polyMesh&
mesh,
123 pointSet(
mesh,
name, set.size(), w),
125 addressing_(
refCast<const pointZoneSet>(set).addressing())
133 pointZoneSet::~pointZoneSet()
144 for (
label pointi = 0; pointi < maxLen; pointi++)
153 addressing_.setSize(
n);
156 for (
label pointi = 0; pointi < maxLen; pointi++)
160 addressing_[
n] = pointi;
170 DynamicList<label> newAddressing(addressing_.size());
172 const pointZoneSet& fSet = refCast<const pointZoneSet>(set);
174 forAll(fSet.addressing(), i)
176 label pointi = fSet.addressing()[i];
180 newAddressing.append(pointi);
184 addressing_.transfer(newAddressing);
189 void pointZoneSet::addSet(
const topoSet& set)
191 DynamicList<label> newAddressing(addressing_);
193 const pointZoneSet& fSet = refCast<const pointZoneSet>(set);
195 forAll(fSet.addressing(), i)
197 label pointi = fSet.addressing()[i];
201 newAddressing.append(pointi);
205 addressing_.transfer(newAddressing);
210 void pointZoneSet::deleteSet(
const topoSet& set)
212 DynamicList<label> newAddressing(addressing_.size());
214 const pointZoneSet& fSet = refCast<const pointZoneSet>(set);
218 label pointi = addressing_[i];
220 if (!fSet.found(pointi))
223 newAddressing.append(pointi);
227 addressing_.transfer(newAddressing);
232 void pointZoneSet::sync(
const polyMesh&
mesh)
234 pointSet::sync(
mesh);
237 addressing_ = sortedToc();
242 label pointZoneSet::maxSize(
const polyMesh&
mesh)
const
248 bool pointZoneSet::writeObject
250 IOstream::streamFormat
s,
251 IOstream::versionNumber v,
252 IOstream::compressionType
c,
259 bool ok = pointSet::writeObject(
s, v,
c,
write);
260 const_cast<word&
>(
type()) = oldTypeName;
263 pointZoneList& pointZones =
const_cast<polyMesh&
>(mesh_).pointZones();
264 label zoneID = pointZones.findIndex(
name());
268 zoneID = pointZones.size();
270 pointZones.setSize(zoneID+1);
284 pointZones[zoneID] = addressing_;
287 return ok && pointZones.write(
write);
291 void pointZoneSet::topoChange(
const polyTopoChangeMap& map)
294 labelList newAddressing(addressing_.size());
299 label pointi = addressing_[i];
307 newAddressing.setSize(
n);
309 addressing_.transfer(newAddressing);
315 void pointZoneSet::writeDebug
318 const primitiveMesh&
mesh,
322 pointSet::writeDebug(os,
mesh, maxLen);
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
bool insert(const label &key)
Insert a new entry.
void clearStorage()
Clear the table entries and the table itself.
void resize(const label newSize)
Resize the hash table for efficiency.
void size(const label)
Override size to be inconsistent with allocated storage.
pointZoneSet(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Construct from objectRegistry and name.
void updateSet()
Sort addressing and make pointSet part consistent with addressing.
const pointZoneList & pointZones() const
Return point zones.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(lagrangian::Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.name(), lagrangian::cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
const dimensionedScalar c
Speed of light in a vacuum.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
To & refCast(From &r)
Reference type cast template function.
labelList invert(const label len, const labelUList &)
Invert one-to-one map. Unmapped elements will be -1.
String typeName(const std::type_info &info)
Return the un-mangled name given the standard type info.
int order(const scalar s)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
void sortedOrder(const UList< T > &, labelList &order)
Generate the (stable) sort order for the list.
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
ListType subset(const UList< T > &select, const T &value, const ListType &)
Extract elements of List when select is a certain value.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
void inplaceReorder(const labelUList &oldToNew, ListType &)
Inplace reorder the elements of a list.