56int main(
int argc,
char *argv[])
60 "Add patches (regions) to a surface with a user-selectable method"
88 meshDict.getOrDefault(
"singleRegionName",
true)
94 for (
const entry& dEntry : surfacesDict)
98 const word& surfName = dEntry.keyword();
105 bool changed =
false;
108 if (surfDict.
found(
"type"))
127 if (surfDict.
found(
"regions"))
131 for (
const entry&
e : regionsDict)
151 if (modifier().modify(regionIDs, surf))
162 surf.
rename(oldName.lessExt() +
"_patched." + oldName.ext());
164 Info<<
"Writing repatched surface " << oldName <<
" to "
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
@ MUST_READ
Reading required.
@ NO_WRITE
Ignore writing from objectRegistry::writeObject().
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const word & name() const noexcept
Return the object name.
void size(const label n)
Older name for setAddressableSize.
static void noParallel()
Remove the parallel options.
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Add an option to validOptions with usage information.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a T. FatalIOError if not found, or if the number of tokens is incorrect.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
A keyword and a list of tokens is an 'entry'.
virtual bool write(const bool writeOnProc=true) const
Write using setting from DB.
virtual void rename(const word &newName)
Rename.
static autoPtr< searchableSurfaceModifier > New(const word &type, const searchableSurfaces &, const dictionary &dict)
Return a reference to the selected searchableSurfaceModifier.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual const wordList & regions() const =0
Names of regions.
Container for searchableSurfaces. The collection is specified as a dictionary. For example,...
static word meshSubDir
Return the mesh sub-directory name (usually "triSurface").
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
static labelList matching(const wordRe &select, const UList< StringType > &input, const bool invert=false)
Determine the list indices for all matches.
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
const IOdictionary & meshDict
const word dictName("faMeshDefinition")
List< label > labelList
A List of labels.
messageStream Info
Information stream (stdout output on master, null elsewhere).
Ostream & endl(Ostream &os)
Add newline and flush stream.
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i), works like std::iota() but returning a...
constexpr char nl
The newline '\n' character (0x0a).