surfaceFormatsCore Class Reference

A collection of helper functions for reading/writing surface formats. More...

Inheritance diagram for surfaceFormatsCore:
Collaboration diagram for surfaceFormatsCore:

Public Member Functions

 surfaceFormatsCore ()=default
 Default construct. More...
 
virtual ~surfaceFormatsCore ()=default
 Destructor. More...
 

Static Public Member Functions

static bool checkSupport (const wordHashSet &available, const word &fileType, const bool verbose=false, const char *functionName=nullptr)
 Verbose checking of fileType in the list of available types. More...
 
static fileName findFile (const IOobject &io, const bool isGlobal=true)
 Use IOobject information to resolve file to load from, or empty if the file does not exist. More...
 
static fileName findFile (const IOobject &io, const dictionary &dict, const bool isGlobal=true)
 Use IOobject information to resolve file to load from, or empty if the file does not exist. More...
 

Static Public Attributes

static word nativeExt
 The file extension corresponding to 'native' surface format. More...
 

Static Protected Member Functions

static string getLineNoComment (ISstream &is, const char comment='#')
 Read non-empty and non-comment line. More...
 
template<class Container >
static List< surfZoneoneZone (const Container &container, const word &name="zone0")
 Return a surfZone list with a single entry, the size of which corresponds to that of the container. More...
 
static labelList getSelectedPatches (const surfZoneList &patches, const wordRes &allow, const wordRes &deny=wordRes())
 Return ids for zone/patch that match by name. More...
 
static fileName relativeFilePath (const IOobject &io, const fileName &f, const bool isGlobal=true)
 Return fileName. More...
 
static fileName checkFile (const IOobject &io, const bool isGlobal=true)
 Return fileName to load IOobject from. More...
 
static fileName checkFile (const IOobject &io, const dictionary &dict, const bool isGlobal=true)
 Return fileName to load IOobject from. More...
 

Friends

class ::Foam::triSurface
 

Detailed Description

A collection of helper functions for reading/writing surface formats.

Source files

Definition at line 62 of file surfaceFormatsCore.H.

Constructor & Destructor Documentation

◆ surfaceFormatsCore()

surfaceFormatsCore ( )
default

Default construct.

◆ ~surfaceFormatsCore()

virtual ~surfaceFormatsCore ( )
virtualdefault

Destructor.

Member Function Documentation

◆ getLineNoComment()

Foam::string getLineNoComment ( ISstream is,
const char  comment = '#' 
)
staticprotected

Read non-empty and non-comment line.

Definition at line 36 of file surfaceFormatsCore.C.

References ISstream::getLine(), and IOstream::good().

Here is the call graph for this function:

◆ oneZone()

static List<surfZone> oneZone ( const Container &  container,
const word name = "zone0" 
)
inlinestaticprotected

Return a surfZone list with a single entry, the size of which corresponds to that of the container.

Definition at line 83 of file surfaceFormatsCore.H.

References Foam::name().

Here is the call graph for this function:

◆ getSelectedPatches()

Foam::labelList getSelectedPatches ( const surfZoneList patches,
const wordRes allow,
const wordRes deny = wordRes() 
)
staticprotected

Return ids for zone/patch that match by name.

Uses a combination of allow and deny lists.

See also
Foam::stringListOps::findMatching for details about matching

Definition at line 53 of file surfaceFormatsCore.C.

References Foam::PtrListOps::findMatching(), and patches.

Here is the call graph for this function:

◆ relativeFilePath()

Foam::fileName relativeFilePath ( const IOobject io,
const fileName f,
const bool  isGlobal = true 
)
staticprotected

Return fileName.

If fileName is relative gets treated as local to IOobject. Duplicate of triSurfaceMesh::relativeFilePath

Parameters
isGlobalresolve as a global file

Definition at line 171 of file surfaceFormatsCore.C.

References string::expand(), f(), Foam::fileHandler, io(), fileName::isAbsolute(), and word::null.

Referenced by triSurface::relativeFilePath().

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

◆ checkFile() [1/2]

Foam::fileName checkFile ( const IOobject io,
const bool  isGlobal = true 
)
staticprotected

Return fileName to load IOobject from.

Fatal if the file does not exist

Parameters
isGlobalresolve as a global file

Definition at line 250 of file surfaceFormatsCore.C.

References Foam::exit(), Foam::FatalError, FatalErrorInFunction, io(), Foam::nl, and word::null.

Referenced by triSurface::checkFile(), and UnsortedMeshedSurface< Face >::UnsortedMeshedSurface().

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

◆ checkFile() [2/2]

Foam::fileName checkFile ( const IOobject io,
const dictionary dict,
const bool  isGlobal = true 
)
staticprotected

Return fileName to load IOobject from.

Supports optional override of fileName with "file" entry Fatal if the file does not exist

Parameters
isGlobalresolve as a global file

Definition at line 275 of file surfaceFormatsCore.C.

References dict, Foam::exists(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, io(), keyType::LITERAL, Foam::nl, and word::null.

Here is the call graph for this function:

◆ checkSupport()

bool checkSupport ( const wordHashSet available,
const word fileType,
const bool  verbose = false,
const char *  functionName = nullptr 
)
static

Verbose checking of fileType in the list of available types.

Definition at line 319 of file surfaceFormatsCore.C.

References Foam::flatOutput(), HashTable< T, Key, Hash >::found(), Foam::Info, Foam::nl, and HashTable< T, Key, Hash >::sortedToc().

Referenced by triSurface::canReadType(), and triSurface::canWriteType().

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

◆ findFile() [1/2]

Foam::fileName findFile ( const IOobject io,
const bool  isGlobal = true 
)
static

Use IOobject information to resolve file to load from, or empty if the file does not exist.

Parameters
isGlobalresolve as a global file

Definition at line 197 of file surfaceFormatsCore.C.

References Foam::exists(), io(), and word::null.

Referenced by triSurface::findFile().

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

◆ findFile() [2/2]

Foam::fileName findFile ( const IOobject io,
const dictionary dict,
const bool  isGlobal = true 
)
static

Use IOobject information to resolve file to load from, or empty if the file does not exist.

Supports optional override of fileName with "file" entry

Parameters
isGlobalresolve as a global file

Definition at line 219 of file surfaceFormatsCore.C.

References dict, Foam::exists(), io(), keyType::LITERAL, and word::null.

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ::Foam::triSurface

friend class ::Foam::triSurface
friend

Definition at line 67 of file surfaceFormatsCore.H.

Member Data Documentation

◆ nativeExt

Foam::word nativeExt
static

The file extension corresponding to 'native' surface format.

Normally "ofs" (mnemonic: OF = OpenFOAM, S = Surface)

Definition at line 155 of file surfaceFormatsCore.H.


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