82 (r == IOobject::MUST_READ)
83 || (r == IOobject::MUST_READ_IF_MODIFIED)
84 || (r == IOobject::READ_IF_PRESENT && zoneID != -1)
87 const cellZone& fz = cellZones[zoneID];
97 cellZoneSet::cellZoneSet
113 cellZoneSet::cellZoneSet
115 const polyMesh&
mesh,
123 addressing_(
refCast<const cellZoneSet>(set).addressing())
131 cellZoneSet::~cellZoneSet()
142 for (
label celli = 0; celli < maxLen; celli++)
151 addressing_.setSize(
n);
154 for (
label celli = 0; celli < maxLen; celli++)
158 addressing_[
n] = celli;
169 DynamicList<label> newAddressing(addressing_.size());
171 const cellZoneSet& fSet = refCast<const cellZoneSet>(set);
173 forAll(fSet.addressing(), i)
175 label celli = fSet.addressing()[i];
179 newAddressing.append(celli);
183 addressing_.transfer(newAddressing);
188 void cellZoneSet::addSet(
const topoSet& set)
190 DynamicList<label> newAddressing(addressing_);
192 const cellZoneSet& fSet = refCast<const cellZoneSet>(set);
194 forAll(fSet.addressing(), i)
196 label celli = fSet.addressing()[i];
200 newAddressing.append(celli);
204 addressing_.transfer(newAddressing);
209 void cellZoneSet::deleteSet(
const topoSet& set)
211 DynamicList<label> newAddressing(addressing_.size());
213 const cellZoneSet& fSet = refCast<const cellZoneSet>(set);
217 label celli = addressing_[i];
219 if (!fSet.found(celli))
222 newAddressing.append(celli);
226 addressing_.transfer(newAddressing);
231 void cellZoneSet::sync(
const polyMesh&
mesh)
236 addressing_ = sortedToc();
241 label cellZoneSet::maxSize(
const polyMesh&
mesh)
const
247 bool cellZoneSet::writeObject
249 IOstream::streamFormat
s,
250 IOstream::versionNumber v,
251 IOstream::compressionType
c,
258 bool ok = cellSet::writeObject(
s, v,
c,
write);
259 const_cast<word&
>(
type()) = oldTypeName;
262 cellZoneList& cellZones =
const_cast<polyMesh&
>(mesh_).cellZones();
263 label zoneID = cellZones.findIndex(
name());
267 zoneID = cellZones.size();
269 cellZones.setSize(zoneID+1);
283 cellZones[zoneID] = addressing_;
286 return ok && cellZones.write(
write);
290 void cellZoneSet::topoChange(
const polyTopoChangeMap& map)
293 labelList newAddressing(addressing_.size());
298 label celli = addressing_[i];
299 label newCelli = map.reverseCellMap()[celli];
302 newAddressing[
n] = newCelli;
306 newAddressing.setSize(
n);
308 addressing_.transfer(newAddressing);
314 void cellZoneSet::writeDebug
317 const primitiveMesh&
mesh,
321 cellSet::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.
cellZoneSet(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 cellSet part consistent with addressing.
const cellZoneList & cellZones() const
Return cell 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.