Go to the documentation of this file.
66 template<
class ZoneType>
77 Info<<
"Removing zone " << setName <<
" at index " <<
zoneID <<
endl;
89 zones.reorder(oldToNew);
91 zones.setSize(zones.size()-1);
124 if (objects.found(setName))
127 fileName object = objects[setName]->objectPath();
128 Info<<
"Removing file " <<
object <<
endl;
133 if (setType == cellZoneSet::typeName)
141 else if (setType == faceZoneSet::typeName)
149 else if (setType == pointZoneSet::typeName)
168 Info<<
" mesh not changed." <<
endl;
173 Info<<
" points moved; topology unchanged." <<
endl;
178 Info<<
" topology changed; patches unchanged." <<
nl
185 Info<<
" topology changed and patches changed." <<
nl
194 <<
"Illegal mesh update state "
204 int main(
int argc,
char *argv[])
208 "Operates on cellSets/faceSets/pointSets through a dictionary,"
209 " normally system/topoSetDict"
220 "Do not synchronise selection across coupled patches"
230 const bool noSync =
args.
found(
"noSync");
248 meshReadUpdate(
mesh);
267 Info<<
"Created " << currentSet().type() <<
' '
283 Info<<
"Read set " << currentSet().type() <<
' '
284 << setName <<
" with size "
300 Info<<
" Applying source " << sourceType <<
endl;
308 source().applyToSet(action, currentSet());
310 if (!noSync) currentSet().sync(
mesh);
311 if (!currentSet().
write())
314 <<
"Failed writing set "
315 << currentSet().objectPath() <<
endl;
325 Info<<
" Applying source " << sourceType <<
endl;
340 currentSet().
name() +
"_old2",
345 currentSet().
clear();
349 currentSet().subset(oldSet());
351 if (!noSync) currentSet().sync(
mesh);
352 if (!currentSet().
write())
355 <<
"Failed writing set "
356 << currentSet().objectPath() <<
endl;
363 Info<<
" Clearing " << currentSet().type() <<
endl;
364 currentSet().
clear();
365 if (!currentSet().
write())
368 <<
"Failed writing set "
369 << currentSet().objectPath() <<
endl;
375 Info<<
" Inverting " << currentSet().type() <<
endl;
376 currentSet().invert(currentSet().maxSize(
mesh));
377 if (!currentSet().
write())
380 <<
"Failed writing set "
381 << currentSet().objectPath() <<
endl;
388 removeSet(
mesh, setType, setName);
393 <<
"Unhandled action " << action <<
endl;
397 if (currentSet.
valid())
400 << currentSet().type() <<
' '
401 << currentSet().name() <<
" now size "
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Clear the set, possibly creating it.
const word & name() const
Return name.
A class for handling words, derived from Foam::string.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
label nTotalPoints() const
Return total number of points in decomposed mesh. Not.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static word timeName(const scalar t, const int precision=precision_)
virtual void flush() const
Forcibly wait until all output done. Flush any cached data.
label nTotalCells() const
Return total number of cells in decomposed mesh.
static void addNote(const string ¬e)
Add extra notes for the usage information.
const word dictName("blockMeshDict")
const fileName & facesInstance() const
Return the current instance directory for faces.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
bool rm(const fileName &file)
Remove a file (or its gz equivalent), returning true if successful.
const fileOperation & fileHandler()
Get current file handler.
bool valid() const noexcept
True if the managed pointer is non-null.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
label nTotalFaces() const
Return total number of faces in decomposed mesh. Not.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
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.
Create a new set and ADD elements to it.
EnumType get(const word &enumName) const
The enumeration corresponding to the given name.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
const faceZoneMesh & faceZones() const
Return face zone mesh.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in time.
messageStream Info
Information stream (uses stdout - output is on the master only)
const pointZoneMesh & pointZones() const
Return point zone mesh.
word name(const complex &c)
Return string representation of complex.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
static instantList selectIfPresent(Time &runTime, const argList &args)
Subset with elements in the set.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Subtract elements from the set.
const labelIOList & zoneID
static autoPtr< topoSetSource > New(const word &topoSetSourceType, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected topoSetSource.
errorManip< error > abort(error &err)
label findZoneID(const word &zoneName) const
Find zone index given a name, return -1 if not found.
List of IOobjects with searching and retrieving facilities.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
readUpdateState
Enumeration defining the state of the mesh after a read update.
const boundBox & bounds() const
Return mesh bounding box.
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static void addOptions(const bool constant=true, const bool withZero=false)
Add timeSelector options to argList::validOptions.
virtual void setTime(const Time &t)
Reset the time and time-index to those of the given time.
Remove the set (from the file system)
static const word null
An empty word.
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary, otherwise return this dictionary.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void clear() noexcept
Same as reset(nullptr)
Invert the elements in the set.
const Time & time() const
Return the top-level database.
void clearAddressing()
Clear addressing.
const globalMeshData & globalData() const
Return parallel info.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
Foam::argList args(argc, argv)
#define WarningInFunction
Report a warning using Foam::Warning.
bool found(const word &optName) const
Return true if the named option is found.
static const Enum< setAction > actionNames
The setActions text representations.