34 Foam::functionObjects::fieldSelection::fieldSelection
37 const bool includeComponents
41 includeComponents_(includeComponents)
47 template<
class Container>
48 bool Foam::functionObjects::fieldSelection::resetFieldFiltersImpl
50 const Container&
names 53 static std::string cmptStr(
".component(");
60 const auto n =
name.find(cmptStr);
61 if (
n != std::string::npos)
65 if (!includeComponents_)
68 <<
"Component specification not allowed for " <<
name 75 <<
"Cannot use \".component option\" in combination with " 76 <<
"wildcards for " <<
name 80 const word baseName(
name.substr(0,
n));
83 const auto closei =
name.find(
')',
n);
85 if (closei == std::string::npos)
88 <<
"Invalid field component specification for " 90 <<
". Field should be expressed as <field>.component(i)" 94 const auto cmptWidth = (closei -
n - len);
101 nameAndComponent.emplace_back(wordRe(baseName),
component);
105 nameAndComponent.emplace_back(
name);
109 this->transfer(nameAndComponent);
120 return resetFieldFiltersImpl(
names);
131 return resetFieldFiltersImpl(
names);
142 return resetFieldFilters(
fields);
180 <<
"Field " << fi.
name() <<
" not found" virtual bool checkSelection()
Check that all requested fielda have been found.
A HashTable with keys but without contents that is similar to std::unordered_set. ...
void size(const label n)
Older name for setAddressableSize.
List< word > names(const UPtrList< T > &list, const UnaryMatchPredicate &matcher)
List of names generated by calling name() for each list item and filtered for matches.
virtual bool containsPattern() const
Return whether the field names contain a pattern.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Helper class to store a wordRe and label used by Foam::functionObjects::fieldSelection.
Ostream & endl(Ostream &os)
Add newline and flush stream.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
bool found() const noexcept
Return the found state.
multivariateSurfaceInterpolationScheme< scalar >::fieldTable fields
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
virtual bool updateSelection()
Update the selection.
graph_traits< Graph >::vertices_size_type size_type
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings...
virtual void clearSelection()
Clear the current selection.
virtual bool read(const dictionary &dict)
Read the fieldSelection data from dictionary.
virtual bool resetFieldFilters(const HashSet< wordRe > &names)
Reset the field filters to the given field names.
#define WarningInFunction
Report a warning using Foam::Warning.
const wordRe & name() const noexcept
Return the selector pattern for the field name(s)
Registry of regIOobjects.
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
bool isPattern() const noexcept
The wordRe is a pattern, not a literal string.