49 void printMesh(
const Time& runTime,
const polyMesh& mesh)
60 template<
class ZoneType>
71 Info<<
"Removing zone " << setName <<
" at index " << zoneID <<
endl;
82 oldToNew[zoneID] = newI;
114 if (objects.found(setName))
117 fileName object = objects[setName]->objectPath();
118 Info<<
"Removing file " <<
object <<
endl;
123 if (setType == cellZoneSet::typeName)
127 const_cast<cellZoneMesh&>(mesh.
cellZones()),
131 else if (setType == faceZoneSet::typeName)
135 const_cast<faceZoneMesh&>(mesh.
faceZones()),
139 else if (setType == pointZoneSet::typeName)
143 const_cast<pointZoneMesh&>(mesh.
pointZones()),
158 Info<<
" mesh not changed." <<
endl;
163 Info<<
" points moved; topology unchanged." <<
endl;
168 Info<<
" topology changed; patches unchanged." <<
nl 175 Info<<
" topology changed and patches changed." << nl
184 <<
"Illegal mesh update state " 194 int main(
int argc,
char *argv[])
207 "do not synchronise selection across coupled patches" 231 runTime.
setTime(timeDirs[timeI], timeI);
235 meshReadUpdate(mesh);
259 currentSet =
topoSet::New(setType, mesh, setName, 10000);
260 Info<<
"Created " << currentSet().type() <<
" " 276 Info<<
"Read set " << currentSet().type() <<
" " 277 << setName <<
" with size " 301 source().applyToSet(action, currentSet());
303 if (!noSync) currentSet().sync(mesh);
304 currentSet().write();
326 currentSet().
name() +
"_old2",
331 currentSet().
clear();
335 currentSet().subset(oldSet());
337 if (!noSync) currentSet().sync(mesh);
338 currentSet().write();
343 Info<<
" Clearing " << currentSet().type() <<
endl;
344 currentSet().
clear();
345 currentSet().write();
349 Info<<
" Inverting " << currentSet().type() <<
endl;
350 currentSet().invert(currentSet().maxSize(mesh));
351 currentSet().write();
356 removeSet(mesh, setType, setName);
362 <<
"Unhandled action " << action <<
endl;
366 if (currentSet.
valid())
368 Info<<
" " << currentSet().type() <<
" " 369 << currentSet().name()
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
#define forAll(list, i)
Loop across all elements in list.
void clearAddressing()
Clear addressing.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
A class for handling file names.
List of IOobjects with searching and retrieving facilities.
const faceZoneMesh & faceZones() const
Return face zone mesh.
const fileName & facesInstance() const
Return the current instance directory for faces.
A list of keyword definitions, which are a keyword followed by any number of values (e...
void reorder(const labelUList &)
Reorders elements. Ordering does not have to be done in.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label nTotalPoints() const
Return total number of points in decomposed mesh. Not.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
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".
label nTotalCells() const
Return total number of cells in decomposed mesh.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
void clear()
Delete object (if the pointer is valid) and set pointer to.
label nTotalFaces() const
Return total number of faces in decomposed mesh. Not.
label findZoneID(const word &zoneName) const
Find zone index given a name.
const pointZoneMesh & pointZones() const
Return point zone mesh.
A class for handling words, derived from string.
const cellZoneMesh & cellZones() const
Return cell zone mesh.
setAction
Enumeration defining the valid actions.
static const word null
An empty word.
const globalMeshData & globalData() const
Return parallel info.
const word dictName("particleTrackDict")
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0)
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
errorManip< error > abort(error &err)
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
const Time & time() const
Return time.
static autoPtr< topoSetSource > New(const word &topoSetSourceType, const polyMesh &mesh, const dictionary &dict)
Return a reference to the selected topoSetSource.
word name(const complex &)
Return a string representation of a complex.
IOobject dictIO(dictName, runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)
static float maxThreadFileBufferSize
Max size of thread buffer size. This is the overall size of.
label size() const
Return the number of elements in the UPtrList.
const boundBox & bounds() const
Return mesh bounding box.
#define WarningInFunction
Report a warning using Foam::Warning.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
static setAction toAction(const word &actionName)
Convert string to action.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Mesh consisting of general polyhedral cells.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
readUpdateState
Enumeration defining the state of the mesh after a read update.
virtual readUpdateState readUpdate()
Update the mesh based on the mesh files saved in.
bool rm(const fileName &)
Remove a file, returning true if successful otherwise false.
virtual bool write(const bool valid=true) const
Write using setting from DB.
Foam::argList args(argc, argv)
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.