50constexpr const char*
const faMeshPrefix =
"finite-area";
56int main(
int argc,
char *argv[])
60 "List volume regions from constant/regionProperties,\n"
61 "or area regions from constant/finite-area/regionProperties"
73 "List constant/finite-area/regionProperties (if available)"
79 "A missing regionProperties is not treated as an error"
84 "Make reading optional and add verbosity"
94 const bool dryRun =
args.dryRun();
95 int optVerbose =
args.verbose();
97 if (dryRun && !optVerbose)
103 const bool isOptional =
args.found(
"optional");
106 const bool doFiniteArea =
args.found(
"finite-area");
109 const label nFilters = (
args.size()-1);
113 if (dryRun || isOptional || doFiniteArea)
139 if (regionProps.
empty())
143 InfoErr<<
"No finite-area region types" <<
nl;
160 << regionProps.
count() <<
" regions" <<
nl <<
nl;
168 if (isOptional && regionProps.
empty())
172 else if (nFilters > 0)
184 for (label argi = 1; argi <
args.size(); ++argi)
194 regionTypes.
push_back(std::move(regType));
199 InfoErr<<
"No region-type: " << regType <<
nl;
211 for (
const word& regionType : regionTypes)
213 if (
const auto iter = regionProps.
cfind(regionType); iter.good())
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void reserve_exact(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
void push_back(const T &val)
Copy append an element to the end of this list.
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
Foam::List< Key > sortedToc(const Compare &comp) const
bool empty() const noexcept
True if the hash table is empty.
bool contains(const Key &key) const
True if hashed key is contained (found) in table.
const_iterator cfind(const Key &key) const
Find and return an const_iterator set at the hashed entry.
label size() const noexcept
The number of elements in table.
readOption
Enumeration defining read preferences.
@ READ_IF_PRESENT
Reading is optional [identical to LAZY_READ].
@ MUST_READ
Reading required.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
static word controlDictName
The default control dictionary name (normally "controlDict").
bool contains(const T &val) const
True if the value is contained in the list.
static void noBanner()
Disable emitting the banner information.
static void noFunctionObjects(bool addWithOption=false)
Remove '-noFunctionObjects' option and ignore any occurrences.
static void addVerboseOption(const string &usage="", bool advanced=false)
Enable a 'verbose' bool option, with usage information.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void noJobInfo()
Suppress JobInfo, overriding controlDict setting.
static void addDryRunOption(const string &usage, bool advanced=false)
Enable a 'dry-run' bool option, with usage information.
static void noMandatoryArgs()
Flag command arguments as being optional (non-mandatory).
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
Add a bool option to validOptions with usage information.
static void noParallel()
Remove the parallel options.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Simple class to hold region information for coupled region simulations.
label count() const
Total count of all region names.
A class for handling words, derived from Foam::string.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
messageStream Info
Information stream (stdout output on master, null elsewhere).
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
messageStream InfoErr
Information stream (stderr output on master, null elsewhere).
constexpr char nl
The newline '\n' character (0x0a).
Foam::argList args(argc, argv)