62 template<
class ZonesType>
63 void removeZone(ZonesType& zones,
const word& setName)
65 label zoneID = zones.findIndex(setName);
69 Info<<
"Removing zone " << setName <<
" at index " << zoneID <<
endl;
80 oldToNew[zoneID] = newI;
81 zones.reorder(oldToNew);
83 zones.setSize(zones.size()-1);
84 zones.clearAddressing();
117 Info<<
"Removing file " <<
object <<
endl;
122 if (setType == cellZoneSet::typeName)
130 else if (setType == faceZoneSet::typeName)
138 else if (setType == pointZoneSet::typeName)
157 Info<<
" mesh not changed." <<
endl;
162 Info<<
" points moved; topology unchanged." <<
endl;
167 Info<<
" topology changed; patches unchanged." <<
nl
174 Info<<
" topology changed and patches changed." <<
nl
183 <<
"Illegal mesh update state "
193 int main(
int argc,
char *argv[])
202 "do not synchronise selection across coupled patches"
209 <<
"topoSet has been superseded by createZones"
210 " and is now deprecated."
232 meshReadUpdate(
mesh);
256 Info<<
"Created " << currentSet().type() <<
" "
272 Info<<
"Read set " << currentSet().type() <<
" "
273 << setName <<
" with size "
296 source().applyToSet(action, currentSet());
298 if (!noSync) currentSet().sync(
mesh);
299 currentSet().write();
322 currentSet().
name() +
"_old2",
327 currentSet().
clear();
331 currentSet().subset(oldSet());
333 if (!noSync) currentSet().sync(
mesh);
334 currentSet().write();
340 Info<<
" Clearing " << currentSet().type() <<
endl;
341 currentSet().
clear();
342 currentSet().write();
347 Info<<
" Inverting " << currentSet().type() <<
endl;
348 currentSet().invert(currentSet().maxSize(
mesh));
349 currentSet().write();
355 removeSet(
mesh, setType, setName);
361 <<
"Unhandled action " << action <<
endl;
365 if (currentSet.
valid())
367 Info<<
" " << currentSet().type() <<
" "
368 << currentSet().name()
#define forAll(list, i)
Loop across all elements in list.
List of IOobjects with searching and retrieving facilities.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
Return the location of "dir" containing the file "name".
word userTimeName() const
Return current user time name with units.
label size() const
Return the number of elements in the UPtrList.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool optionFound(const word &opt) const
Return true if the named option is found.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
void clear()
Delete object (if the pointer is valid) and set pointer to.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const dictionary & optionalSubDict(const word &) const
Find and return a sub-dictionary if found.
const word & name() const
Return const reference to name.
A class for handling file names.
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
const Time & time() const
Return the top-level database.
readUpdateState readUpdate(const stitchType stitch=stitchType::geometric)
Update the mesh based on the mesh files saved in time.
label nTotalFaces() const
Return total number of faces in decomposed mesh. Not.
label nTotalPoints() const
Return total number of points in decomposed mesh. Not.
label nTotalCells() const
Return total number of cells in decomposed mesh.
Mesh consisting of general polyhedral cells.
const pointZoneList & pointZones() const
Return point zones.
const fileName & facesInstance() const
Return the current instance directory for faces.
const cellZoneList & cellZones() const
Return cell zones.
readUpdateState
Enumeration defining the state of the mesh after a read update.
const globalMeshData & globalData() const
Return parallel info.
const faceZoneList & faceZones() const
Return face zones.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
const boundBox & bounds() const
Return mesh bounding box.
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0)
static setAction toAction(const word &actionName)
Convert string to action.
setAction
Enumeration defining the valid actions.
static autoPtr< topoSetSource > New(const word &topoSetSourceType, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected topoSetSource.
static autoPtr< topoSet > New(const word &setType, const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Return a pointer to a toposet read from file.
A class for handling words, derived from string.
static const word null
An empty word.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
int main(int argc, char *argv[])
static instantList timeDirs
#define WarningInFunction
Report a warning using Foam::Warning.
const fileOperation & fileHandler()
Get current file handler.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManip< error > abort(error &err)
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
IOdictionary systemDict(const word &dictName, const argList &args, const objectRegistry &ob, const word ®ionName=polyMesh::defaultRegion, const fileName &path=fileName::null)
Foam::argList args(argc, argv)