surfaceFormatsCore Class Reference

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

Inheritance diagram for surfaceFormatsCore:
[legend]
Collaboration diagram for surfaceFormatsCore:
[legend]

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)
 
static fileName findFile (const IOobject &io, const dictionary &dict, const bool isGlobal=true)
 

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")
 
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 66 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 42 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 82 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 59 of file surfaceFormatsCore.C.

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

Referenced by MeshedSurface< Face >::subsetMesh().

Here is the call graph for this function:
Here is the caller 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 177 of file surfaceFormatsCore.C.

References string::expand(), f(), Foam::fileHandler(), fileOperation::filePath(), io(), and fileName::isAbsolute().

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 256 of file surfaceFormatsCore.C.

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

Referenced by triSurface::checkFile(), distributedTriSurfaceMesh::distributedTriSurfaceMesh(), 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 281 of file surfaceFormatsCore.C.

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

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 325 of file surfaceFormatsCore.C.

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

Here is the call 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 203 of file surfaceFormatsCore.C.

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

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 225 of file surfaceFormatsCore.C.

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

Here is the call graph for this function:

Friends And Related Function Documentation

◆ ::Foam::triSurface

friend class ::Foam::triSurface
friend

Definition at line 71 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 140 of file surfaceFormatsCore.H.


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