63 auto* ctorPtr = wordConstructorTable(setType);
71 *wordConstructorTablePtr_
89 auto* ctorPtr = sizeConstructorTable(setType);
97 *sizeConstructorTablePtr_
115 auto* ctorPtr = setConstructorTable(setType);
123 *setConstructorTablePtr_
153 bool changed =
false;
155 for (
const label oldId : labels)
157 if (oldId < 0 || oldId >= map.
size())
160 <<
"Illegal content " << oldId <<
" of set:" <<
name()
161 <<
" of type " <<
type() <<
nl
162 <<
"Value should be between [0," << map.
size() <<
')'
167 const label newId = map[oldId];
189 for (
const label oldId : labels)
191 const label newId = map[oldId];
195 newLabels.
set(newId);
207 for (
const label oldId : labels)
209 if (oldId < 0 || oldId >= maxSize)
212 <<
"Illegal content " << oldId <<
" of set:" <<
name()
213 <<
" of type " <<
type() <<
nl
214 <<
"Value should be between [0," << maxSize <<
')'
233 for (; (iter != cend()) && (
n < maxElem); ++iter)
235 if (
n && ((
n % 10) == 0))
239 os << iter.key() <<
' ';
259 for (; (iter != cend()) && (
n < maxElem); ++iter)
261 if (
n && ((
n % 3) == 0))
265 os << iter.key() << coords[iter.key()] <<
' ';
283 os <<
"Set bounding box: min = "
284 << bb.
min() <<
" max = " << bb.
max() <<
" metres." <<
nl <<
endl;
290 if (size() <= maxLen)
292 writeDebug(
os, coords, maxLen, iter,
n);
296 label halfLen = maxLen/2;
298 os <<
"Size larger than " << maxLen <<
". Printing first and last "
299 << halfLen <<
" elements:" <<
nl <<
endl;
301 writeDebug(
os, coords, halfLen, iter,
n);
305 for (;
n < size() - halfLen; ++
n)
310 writeDebug(
os, coords, halfLen, iter,
n);
408 const word& wantedType,
549 for (label
id=0;
id < maxLen; ++id)
551 if (!original.
found(
id))
582 this->subtractSet(set);
598 if (size() <= maxLen)
600 writeDebug(
os, maxLen, iter,
n);
604 label halfLen = maxLen/2;
606 os <<
"Size larger than " << maxLen <<
". Printing first and last "
607 << halfLen <<
" elements:" <<
nl <<
endl;
609 writeDebug(
os, halfLen, iter,
n);
613 for (;
n < size() - halfLen; ++
n)
618 writeDebug(
os, halfLen, iter,
n);
625 return (
os << *
this).good();
virtual fileName localPath() const
Output directory.
void invert()
Return the matrix inverse into itself if no elem is equal to zero.
bool unset(const Key &key)
Unset the specified key - same as erase.
bool set(const Key &key)
Same as insert (no value to overwrite)
void operator=(const this_type &rhs)
Copy assign.
bool found(const Key &key) const
Return true if hashed entry is found in table.
void transfer(HashTable< T, Key, Hash > &rhs)
Transfer contents into this table.
label size() const noexcept
The number of elements in table.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
readOption readOpt() const noexcept
The read option.
bool typeHeaderOk(const bool checkType=true, const bool search=true, const bool verbose=true)
Read header (uses typeFilePath to find file) and check its info.
bool good() const noexcept
Did last readHeader() succeed?
writeOption
Enumeration defining the write options.
fileName path() const
The complete path.
readOption
Enumeration defining the read options.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
word findInstance(const fileName &dir, const word &name=word::null, const IOobject::readOption rOpt=IOobject::MUST_READ, const word &stopInstance=word::null) const
void size(const label n)
Older name for setAddressableSize.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A const_iterator for iterating across on values.
A bounding box defined in terms of min/max extrema points.
const point & min() const
Minimum describing the bounding box.
const point & max() const
Maximum describing the bounding box.
void removeFiles() const
Remove all files from mesh instance()
A class for handling file names.
void sync()
Do all: synchronise all IOFields and objectRegistry.
const Time & time() const
Return the top-level database.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
void updateMesh()
Update for new mesh topology.
Mesh consisting of general polyhedral cells.
const fileName & facesInstance() const
Return the current instance directory for faces.
virtual const fileName & dbDir() const
Override the objectRegistry dbDir for a single-region case.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
void writeDebug() const
Debug write.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
void close()
Close Istream.
Istream & readStream(const word &, const bool valid=true)
Return Istream and check object type against that given.
bool headerOk()
Read and check header info. Does not check the headerClassName.
General set of labels of mesh quantity (points, cells, faces).
virtual bool writeData(Ostream &) const
Write contents.
static IOobject findIOobject(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Find IOobject in the polyMesh/sets (used as constructor helper)
void operator=(const topoSet &)
Copy labelHashSet part only.
virtual void subtractSet(const topoSet &set)
Subtract elements present in set.
virtual void deleteSet(const topoSet &set)
Deprecated(2018-10) subtract elements present in set.
static int disallowGenericSets
Debug switch to disallow the use of generic sets.
virtual void addSet(const topoSet &set)
Add elements present in set.
virtual void subset(const topoSet &set)
Subset contents. Only elements present in both sets remain.
virtual void updateLabels(const labelUList &map)
Update map from map.
virtual void check(const label maxSize)
Check limits on addressable range.
bool set() const
Are all the vector set.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
patchWriters resize(patchIds.size())
#define FatalErrorInLookup(lookupTag, lookupName, lookupTable)
Report an error message using Foam::FatalError.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
#define DebugInfo
Report an information message using Foam::Info.
#define DebugVar(var)
Report a variable name and value.
int debugSwitch(const char *name, const int deflt=0)
Lookup debug switch or add default value.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
vectorField pointField
pointField is a vectorField.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
errorManip< error > abort(error &err)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a)
#define defineRunTimeSelectionTable(baseType, argNames)
Define run-time selection table.