Go to the documentation of this file.
67 template<
class ZoneType>
78 Info<<
"Removing zone " << setName <<
" at index " <<
zoneID <<
endl;
90 zones.reorder(oldToNew);
92 zones.setSize(zones.size()-1);
125 if (objects.found(setName))
128 fileName object = objects[setName]->objectPath();
129 Info<<
"Removing file " <<
object <<
endl;
134 if (setType == cellZoneSet::typeName)
142 else if (setType == faceZoneSet::typeName)
150 else if (setType == pointZoneSet::typeName)
169 Info<<
" mesh not changed." <<
endl;
174 Info<<
" points moved; topology unchanged." <<
endl;
179 Info<<
" topology changed; patches unchanged." <<
nl
186 Info<<
" topology changed and patches changed." <<
nl
195 <<
"Illegal mesh update state "
205 int main(
int argc,
char *argv[])
209 "Operates on cellSets/faceSets/pointSets through a dictionary,"
210 " normally system/topoSetDict"
221 "Do not synchronise selection across coupled patches"
231 const bool noSync =
args.
found(
"noSync");
249 meshReadUpdate(
mesh);
273 Info<<
"Created " << currentSet().type() <<
' '
289 Info<<
"Read set " << currentSet().type() <<
' '
290 << setName <<
" with size "
306 Info<<
" Applying source " << sourceType <<
endl;
314 source().applyToSet(action, currentSet());
316 if (!noSync) currentSet().sync(
mesh);
317 if (!currentSet().
write())
320 <<
"Failed writing set "
321 << currentSet().objectPath() <<
endl;
331 Info<<
" Applying source " << sourceType <<
endl;
346 currentSet().
name() +
"_old2",
351 currentSet().
clear();
355 currentSet().subset(oldSet());
357 if (!noSync) currentSet().sync(
mesh);
358 if (!currentSet().
write())
361 <<
"Failed writing set "
362 << currentSet().objectPath() <<
endl;
369 Info<<
" Clearing " << currentSet().type() <<
endl;
370 currentSet().
clear();
371 if (!currentSet().
write())
374 <<
"Failed writing set "
375 << currentSet().objectPath() <<
endl;
381 Info<<
" Inverting " << currentSet().type() <<
endl;
382 currentSet().invert(currentSet().maxSize(
mesh));
383 if (!currentSet().
write())
386 <<
"Failed writing set "
387 << currentSet().objectPath() <<
endl;
394 removeSet(
mesh, setType, setName);
399 <<
"Unhandled action " << action <<
endl;
406 << currentSet().type() <<
' '
407 << currentSet().name() <<
" now size "
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ ADD
Add elements to current set.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
@ CLEAR
Clear the set, possibly creating it.
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)
const word dictName("faMeshDefinition")
static word timeName(const scalar t, const int precision=precision_)
virtual void flush() const
static void addNote(const string ¬e)
const fileName & facesInstance() const
bool rm(const fileName &file)
const fileOperation & fileHandler()
const polyBoundaryMesh & boundaryMesh() const
Ostream & endl(Ostream &os)
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)
@ NEW
Create a new set and ADD elements to it.
EnumType get(const word &enumName) const
Mesh consisting of general polyhedral cells.
virtual readUpdateState readUpdate()
const cellZoneMesh & cellZones() const noexcept
A tuple of keyType and dictionary, which can be used when reading named or unnamed dictionary entries...
const faceZoneMesh & faceZones() const noexcept
static instantList selectIfPresent(Time &runTime, const argList &args)
@ SUBSET
Union of elements with current set.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
@ SUBTRACT
Subtract elements from current set.
const labelIOList & zoneID
label nTotalPoints() const noexcept
static autoPtr< topoSetSource > New(const word &topoSetSourceType, const polyMesh &mesh, const dictionary &dict)
errorManip< error > abort(error &err)
label findZoneID(const word &zoneName) const
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
const boundBox & bounds() const
const word & name() const noexcept
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
#define FatalErrorInFunction
static void addOptions(const bool constant=true, const bool withZero=false)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
virtual void setTime(const Time &t)
@ REMOVE
Remove the set (from the file system)
const pointZoneMesh & pointZones() const noexcept
const dictionary & optionalSubDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
void write(vtk::formatter &fmt, const Type &val, const label n=1)
@ INVERT
Invert the elements in the current set.
word name(const expressions::valueTypeCode typeCode)
const Time & time() const
label nTotalCells() const noexcept
const globalMeshData & globalData() const
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
#define WarningInFunction
label nTotalFaces() const noexcept
bool found(const word &optName) const
static const Enum< setAction > actionNames