Convenience class for loading single or multiple surface files from the constant/triSurface (or other) directory. More...

Public Types | |
| enum | loadingOption { SINGLE_REGION, FILE_REGION, OFFSET_REGION, MERGE_REGION } |
| The file loading options for triSurfaceLoader. More... | |
Public Member Functions | |
| triSurfaceLoader (const fileName &directory) | |
| Construct with directory name. More... | |
| triSurfaceLoader (const Time &runTime) | |
| Construct with time. Selects "constant/triSurface" directory. More... | |
| ~triSurfaceLoader ()=default | |
| Destructor. More... | |
| const fileName & | directory () const noexcept |
| The directory being used. More... | |
| const wordList & | available () const noexcept |
| The list of available files. More... | |
| const wordList & | selected () const noexcept |
| The list of selected files. More... | |
| label | readDir () |
| Read directory and populate the 'available' files. More... | |
| label | selectAll () |
| Populates 'selected' with all available files. More... | |
| label | select (const word &name) |
| Populates 'selected' with a subset of the available files. More... | |
| label | select (const wordRe &mat) |
| Populates 'selected' with a subset of the available files. More... | |
| label | select (const UList< wordRe > &matcher) |
| Populates 'selected' with a subset of the available files. More... | |
| autoPtr< triSurface > | load (const enum loadingOption opt=loadingOption::OFFSET_REGION, const scalar scaleFactor=-1) const |
| Load a single file, or load and combine multiple selected files. More... | |
Static Public Attributes | |
| static const Enum< loadingOption > | loadingOptionNames |
| The loading enumeration names. More... | |
Convenience class for loading single or multiple surface files from the constant/triSurface (or other) directory.
Surfaces selection based on word, wordRe, list of wordRe. If multiple surfaces are selected, they are concatenated into a single surface with offset faces,points,regions.
Definition at line 58 of file triSurfaceLoader.H.
| enum loadingOption |
The file loading options for triSurfaceLoader.
| Enumerator | |
|---|---|
| SINGLE_REGION | "single" = One region for all files |
| FILE_REGION | "file" = One region for each file |
| OFFSET_REGION | "offset" = Offset regions per file |
| MERGE_REGION | "merge" = Merge regions by name |
Definition at line 65 of file triSurfaceLoader.H.
| triSurfaceLoader | ( | const fileName & | directory | ) |
Construct with directory name.
Definition at line 43 of file triSurfaceLoader.C.
References triSurfaceLoader::readDir().

| triSurfaceLoader | ( | const Time & | runTime | ) |
Construct with time. Selects "constant/triSurface" directory.
Definition at line 53 of file triSurfaceLoader.C.
References triSurfaceLoader::readDir().

|
default |
Destructor.
|
inlinenoexcept |
The directory being used.
Definition at line 139 of file triSurfaceLoader.H.
|
inlinenoexcept |
The list of available files.
Definition at line 147 of file triSurfaceLoader.H.
|
inlinenoexcept |
The list of selected files.
Definition at line 155 of file triSurfaceLoader.H.
| Foam::label readDir | ( | ) |
Read directory and populate the 'available' files.
Automatically called on construction.
Definition at line 65 of file triSurfaceLoader.C.
References triSurface::canRead(), f(), fileName::FILE, Foam::PtrListOps::names(), Foam::readDir(), and UList< T >::size().
Referenced by triSurfaceLoader::triSurfaceLoader().


| Foam::label selectAll | ( | ) |
Populates 'selected' with all available files.
Definition at line 90 of file triSurfaceLoader.C.
| Foam::label select | ( | const word & | name | ) |
Populates 'selected' with a subset of the available files.
Definition at line 97 of file triSurfaceLoader.C.
References Foam::name().

| Foam::label select | ( | const wordRe & | mat | ) |
Populates 'selected' with a subset of the available files.
Definition at line 113 of file triSurfaceLoader.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, wordRe::isPattern(), wordRes::matching(), Foam::nl, and Foam::sort().

Populates 'selected' with a subset of the available files.
Definition at line 138 of file triSurfaceLoader.C.
References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), wordRes::matching(), Foam::nl, UList< T >::size(), and Foam::sort().

| Foam::autoPtr< Foam::triSurface > load | ( | const enum loadingOption | opt = loadingOption::OFFSET_REGION, |
| const scalar | scaleFactor = -1 |
||
| ) | const |
Load a single file, or load and combine multiple selected files.
Optionally scale the surface(s) on input, with a zero or negative scale factor treated as no scaling.
Definition at line 202 of file triSurfaceLoader.C.
References PtrList< T >::append(), List< T >::append(), HashTable< T, Key, Hash >::clear(), UPtrList< T >::empty(), UList< T >::empty(), f(), UList< T >::first(), forAll, HashTable< T, Key, Hash >::insert(), IOobject::name(), Foam::output(), p, patches, triSurface::patches(), patchId(), points, List< T >::resize(), UList< T >::size(), UPtrList< T >::size(), triSurface::swapFaces(), triSurface::swapPoints(), and List< T >::transfer().

|
static |
The loading enumeration names.
Definition at line 76 of file triSurfaceLoader.H.