triSurfaceLoader Class Reference

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

Collaboration diagram for triSurfaceLoader:
[legend]

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 fileNamedirectory () const noexcept
 The directory being used. More...
 
const wordListavailable () const noexcept
 The list of available files. More...
 
const wordListselected () 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< triSurfaceload (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< loadingOptionloadingOptionNames
 The loading enumeration names. More...
 

Detailed Description

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.

Source files

Definition at line 62 of file triSurfaceLoader.H.

Member Enumeration Documentation

◆ 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 67 of file triSurfaceLoader.H.

Constructor & Destructor Documentation

◆ triSurfaceLoader() [1/2]

triSurfaceLoader ( const fileName directory)

Construct with directory name.

Definition at line 50 of file triSurfaceLoader.C.

References triSurfaceLoader::readDir().

Here is the call graph for this function:

◆ triSurfaceLoader() [2/2]

triSurfaceLoader ( const Time runTime)

Construct with time. Selects "constant/triSurface" directory.

Definition at line 60 of file triSurfaceLoader.C.

References triSurfaceLoader::readDir().

Here is the call graph for this function:

◆ ~triSurfaceLoader()

~triSurfaceLoader ( )
default

Destructor.

Member Function Documentation

◆ directory()

const fileName & directory ( ) const
inlinenoexcept

The directory being used.

Definition at line 121 of file triSurfaceLoader.H.

◆ available()

const wordList & available ( ) const
inlinenoexcept

The list of available files.

Definition at line 127 of file triSurfaceLoader.H.

◆ selected()

const wordList & selected ( ) const
inlinenoexcept

The list of selected files.

Definition at line 133 of file triSurfaceLoader.H.

◆ readDir()

Foam::label readDir ( )

Read directory and populate the 'available' files.

Automatically called on construction.

Definition at line 72 of file triSurfaceLoader.C.

References triSurface::canRead(), f(), fileName::FILE, Foam::readDir(), and UList< T >::size().

Referenced by triSurfaceLoader::triSurfaceLoader().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ selectAll()

Foam::label selectAll ( )

Populates 'selected' with all available files.

Definition at line 97 of file triSurfaceLoader.C.

◆ select() [1/3]

Foam::label select ( const word name)

Populates 'selected' with a subset of the available files.

Definition at line 104 of file triSurfaceLoader.C.

References Foam::name().

Here is the call graph for this function:

◆ select() [2/3]

Foam::label select ( const wordRe mat)

Populates 'selected' with a subset of the available files.

Definition at line 120 of file triSurfaceLoader.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findStrings(), wordRe::isPattern(), Foam::nl, and Foam::sort().

Here is the call graph for this function:

◆ select() [3/3]

Foam::label select ( const UList< wordRe > &  matcher)

Populates 'selected' with a subset of the available files.

Definition at line 145 of file triSurfaceLoader.C.

References DynamicList< T, SizeMin >::append(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::findStrings(), Foam::flatOutput(), HashSet< Key, Hash >::insert(), Foam::nl, UList< T >::size(), and Foam::sort().

Here is the call graph for this function:

◆ load()

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 208 of file triSurfaceLoader.C.

References List< T >::append(), PtrList< T >::append(), HashTable< T, Key, Hash >::clear(), UList< T >::empty(), UPtrList< 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(), UPtrList< T >::size(), UList< T >::size(), triSurface::swapFaces(), triSurface::swapPoints(), and List< T >::transfer().

Here is the call graph for this function:

Member Data Documentation

◆ loadingOptionNames

const Foam::Enum< Foam::triSurfaceLoader::loadingOption > loadingOptionNames
static

The loading enumeration names.

Definition at line 76 of file triSurfaceLoader.H.


The documentation for this class was generated from the following files: