41 { loadingOption::SINGLE_REGION,
"single" },
42 { loadingOption::FILE_REGION,
"file" },
43 { loadingOption::OFFSET_REGION,
"offset" },
44 { loadingOption::MERGE_REGION,
"merge" },
52 directory_(directory),
62 directory_(
runTime.constantPath()/
"triSurface"),
88 names.insert(
f.name());
91 available_ = names.sortedToc();
93 return available_.
size();
99 selected_ = available_;
100 return selected_.size();
106 if (available_.found(
name))
109 selected_.first() =
name;
116 return selected_.size();
126 selected_ =
wordList(available_, foundIds);
128 else if (available_.found(
static_cast<const word&
>(mat)))
131 selected_.first() = mat;
136 <<
"Specified the surfaces " << mat <<
nl
137 <<
" - but could not find it"
141 return selected_.size();
161 for (
const wordRe& mat : matcher)
168 for (
const label idx : indices)
170 if (hashedFound.
insert(idx))
178 const word& plain = mat;
179 const label idx = available_.find(plain);
183 if (hashedFound.
insert(idx))
188 else if (hashedMissing.
insert(plain))
198 <<
"Specified the surfaces " <<
flatOutput(matcher) <<
nl
199 <<
" - but could not find " <<
flatOutput(missing)
203 selected_ =
wordList(available_, foundIds);
204 return selected_.size();
211 const scalar scaleFactor
216 if (selected_.empty())
220 else if (selected_.size() == 1)
229 opt == loadingOption::SINGLE_REGION
230 || opt == loadingOption::FILE_REGION
238 if (surf.patches().size())
244 surf.patches().append
267 triSurface addsurf(directory_/selected_[surfi]);
288 case loadingOption::SINGLE_REGION:
303 case loadingOption::FILE_REGION:
319 case loadingOption::OFFSET_REGION:
333 f.region() += regoff;
339 case loadingOption::MERGE_REGION:
346 forAll(addpatches, patchi)
359 patchId = patchNameLookup[patchName];
370 f.region() = oldToNew[
f.region()];
390 if (scaleFactor > VSMALL)
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
A HashTable similar to std::unordered_map.
bool insert(const Key &key, const T &obj)
Copy insert a new entry, not overwriting existing entries.
void clear()
Clear all entries from table.
const word & name() const noexcept
Return the object name.
void transfer(List< T > &list)
void append(const T &val)
Append an element at the end of the list.
void resize(const label len)
Adjust allocated size of list.
A HashTable to objects of type <T> with a label key.
void append(T *ptr)
Append an element to the end of the list.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T & first()
Return the first element of the list.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
void size(const label n)
Older name for setAddressableSize.
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
label size() const noexcept
The number of elements in the list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
virtual tmp< triSurfacePointScalarField > load()
Load the cell size field.
A class for handling file names.
Identifies a surface patch/zone by name and index, with geometric type.
A triFace with additional (region) index.
Convenience class for loading single or multiple surface files from the constant/triSurface (or other...
static const Enum< loadingOption > loadingOptionNames
The loading enumeration names.
label readDir()
Read directory and populate the 'available' files.
label selectAll()
Populates 'selected' with all available files.
label select(const word &name)
Populates 'selected' with a subset of the available files.
loadingOption
The file loading options for triSurfaceLoader.
Triangulated surface description with patch information.
const geometricSurfacePatchList & patches() const noexcept
virtual void swapPoints(pointField &pts)
Swap points. Similar to movePoints, but returns the old points.
static bool canRead(const fileName &name, bool verbose=false)
Can we read this file format?
void swapFaces(List< labelledTri > &faceLst)
Swap the list of faces being addressed.
A wordRe is a Foam::word, but can contain a regular expression for matching words or strings.
bool isPattern() const noexcept
The wordRe is a pattern, not a literal string.
A class for handling words, derived from Foam::string.
const polyBoundaryMesh & patches
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
List< word > wordList
A List of words.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
void sort(UList< T > &list)
Sort the list.
static Ostream & output(Ostream &os, const IntRange< T > &range)
fileNameList readDir(const fileName &directory, const fileName::Type type=fileName::FILE, const bool filtergz=true, const bool followLink=true)
Read a directory and return the entries as a fileName List.
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)
labelList findStrings(const regExp &matcher, const UList< StringType > &input, const bool invert=false)
Return list indices for strings matching the regular expression.
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.