MeshedSurfaceProxy< Face > Class Template Reference

A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats. More...

Inheritance diagram for MeshedSurfaceProxy< Face >:
[legend]
Collaboration diagram for MeshedSurfaceProxy< Face >:
[legend]

Public Types

typedef Face face_type
 The face type. More...
 
typedef point point_type
 The point type. More...
 

Public Member Functions

 ClassName ("MeshedSurfaceProxy")
 Declare type-name (with debug switch) More...
 
 MeshedSurfaceProxy (const pointField &pointLst, const UList< Face > &faceLst, const UList< surfZone > &zoneLst=UList< surfZone >::null(), const labelUList &faceMap=labelUList::null(), const labelUList &faceIdLst=labelUList::null())
 Construct from component references. More...
 
virtual ~MeshedSurfaceProxy ()=default
 Destructor. More...
 
 declareMemberFunctionSelectionTable (void, MeshedSurfaceProxy, write, fileExtension,(const fileName &name, const MeshedSurfaceProxy< Face > &surf, IOstreamOption streamOpt, const dictionary &options),(name, surf, streamOpt, options))
 
label size () const
 The surface size is the number of faces. More...
 
const pointFieldpoints () const
 Return const access to the points. More...
 
const UList< Face > & surfFaces () const
 Return const access to the faces. More...
 
const UList< surfZone > & surfZones () const
 Const access to the surface zones. More...
 
const labelUListfaceMap () const
 Const access to the faceMap, zero-sized when unused. More...
 
const labelUListfaceIds () const
 Const access to the faceIds, zero-sized when unused. More...
 
bool useFaceMap () const
 Can/should use faceMap? More...
 
bool useFaceIds () const
 Possible to use faceIds? More...
 
label nTriangles () const
 Count number of triangles. More...
 
virtual void write (const fileName &name, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
 Write to file, choosing writer based on the file extension. More...
 
virtual void write (const fileName &name, const word &fileType, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null) const
 Write to file with given format type. More...
 
virtual void write (const Time &t, const word &surfName=word::null) const
 Write to database. More...
 
- Public Member Functions inherited from surfaceFormatsCore
 surfaceFormatsCore ()=default
 Default construct. More...
 
virtual ~surfaceFormatsCore ()=default
 Destructor. More...
 

Static Public Member Functions

static wordHashSet writeTypes ()
 The file format types that can be written via MeshedSurfaceProxy. More...
 
static bool canWriteType (const word &fileType, bool verbose=false)
 Can this file format type be written via MeshedSurfaceProxy? More...
 
static void write (const fileName &name, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 Write to file, select based on its extension. More...
 
static void write (const fileName &name, const word &fileType, const MeshedSurfaceProxy &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &options=dictionary::null)
 Write to file with given format type. More...
 
- Static Public Member Functions inherited from surfaceFormatsCore
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)
 

Additional Inherited Members

- Static Public Attributes inherited from surfaceFormatsCore
static word nativeExt
 The file extension corresponding to 'native' surface format. More...
 
- Static Protected Member Functions inherited from surfaceFormatsCore
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...
 

Detailed Description

template<class Face>
class Foam::MeshedSurfaceProxy< Face >

A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.

The constructor interface is fat and ugly, but is largely encapsulated by conversion operators in other classes.

Source files

Definition at line 64 of file MeshedSurfaceProxy.H.

Member Typedef Documentation

◆ face_type

typedef Face face_type

The face type.

Definition at line 86 of file MeshedSurfaceProxy.H.

◆ point_type

typedef point point_type

The point type.

Definition at line 89 of file MeshedSurfaceProxy.H.

Constructor & Destructor Documentation

◆ MeshedSurfaceProxy()

MeshedSurfaceProxy ( const pointField pointLst,
const UList< Face > &  faceLst,
const UList< surfZone > &  zoneLst = UList<surfZone>::null(),
const labelUList faceMap = labelUList::null(),
const labelUList faceIdLst = labelUList::null() 
)

Construct from component references.

Definition at line 236 of file MeshedSurfaceProxy.C.

References Foam::faceMap().

Here is the call graph for this function:

◆ ~MeshedSurfaceProxy()

virtual ~MeshedSurfaceProxy ( )
virtualdefault

Destructor.

Member Function Documentation

◆ ClassName()

ClassName ( "MeshedSurfaceProxy< Face >"  )

Declare type-name (with debug switch)

◆ writeTypes()

Foam::wordHashSet writeTypes
static

The file format types that can be written via MeshedSurfaceProxy.

Definition at line 39 of file MeshedSurfaceProxy.C.

Referenced by surfaceWriter::New().

Here is the caller graph for this function:

◆ canWriteType()

bool canWriteType ( const word fileType,
bool  verbose = false 
)
static

Can this file format type be written via MeshedSurfaceProxy?

Definition at line 46 of file MeshedSurfaceProxy.C.

◆ declareMemberFunctionSelectionTable()

declareMemberFunctionSelectionTable ( void  ,
MeshedSurfaceProxy< Face >  ,
write  ,
fileExtension  ,
(const fileName &name, const MeshedSurfaceProxy< Face > &surf, IOstreamOption streamOpt, const dictionary &options)  ,
(name, surf, streamOpt, options)   
)

◆ write() [1/5]

void write ( const fileName name,
const MeshedSurfaceProxy< Face > &  surf,
IOstreamOption  streamOpt = IOstreamOption(),
const dictionary options = dictionary::null 
)
static

Write to file, select based on its extension.

Definition at line 63 of file MeshedSurfaceProxy.C.

References word::ext(), Foam::name(), and write().

Referenced by proxyWriter::write(), starcdWriter::write(), x3dWriter::write(), triSurface::write(), MeshedSurface< Face >::write(), UnsortedMeshedSurface< Face >::write(), and surfMesh::write().

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

◆ write() [2/5]

void write ( const fileName name,
const word fileType,
const MeshedSurfaceProxy< Face > &  surf,
IOstreamOption  streamOpt = IOstreamOption(),
const dictionary options = dictionary::null 
)
static

Write to file with given format type.

If the format type is "", uses the file extension.

Definition at line 76 of file MeshedSurfaceProxy.C.

References DebugInFunction, Foam::exit(), word::ext(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::name(), Foam::nl, and write().

Here is the call graph for this function:

◆ size()

label size ( ) const
inline

The surface size is the number of faces.

Definition at line 165 of file MeshedSurfaceProxy.H.

References UList< T >::size().

Here is the call graph for this function:

◆ points()

◆ surfFaces()

◆ surfZones()

const UList< surfZone > & surfZones ( ) const
inline

◆ faceMap()

◆ faceIds()

const labelUList & faceIds ( ) const
inline

Const access to the faceIds, zero-sized when unused.

Definition at line 197 of file MeshedSurfaceProxy.H.

Referenced by ABAQUSsurfaceFormat< Face >::write(), NASsurfaceFormat< Face >::write(), and STARCDsurfaceFormat< Face >::write().

Here is the caller graph for this function:

◆ useFaceMap()

bool useFaceMap ( ) const
inline

Can/should use faceMap?

Definition at line 203 of file MeshedSurfaceProxy.H.

References UList< T >::size().

Referenced by ABAQUSsurfaceFormat< Face >::write(), AC3DsurfaceFormat< Face >::write(), NASsurfaceFormat< Face >::write(), OBJsurfaceFormat< Face >::write(), OFFsurfaceFormat< Face >::write(), SMESHsurfaceFormat< Face >::write(), STARCDsurfaceFormat< Face >::write(), TRIsurfaceFormat< Face >::write(), X3DsurfaceFormat< Face >::write(), VTKsurfaceFormat< Face >::write(), VTPsurfaceFormat< Face >::write(), FLMAsurfaceFormat< Face >::write(), STLsurfaceFormat< Face >::writeAscii(), and STLsurfaceFormat< Face >::writeBinary().

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

◆ useFaceIds()

bool useFaceIds ( ) const
inline

Possible to use faceIds?

Definition at line 209 of file MeshedSurfaceProxy.H.

References UList< T >::size().

Here is the call graph for this function:

◆ nTriangles()

Foam::label nTriangles
inline

Count number of triangles.

Definition at line 256 of file MeshedSurfaceProxy.C.

References f().

Referenced by STLsurfaceFormat< Face >::writeBinary().

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

◆ write() [3/5]

virtual void write ( const fileName name,
IOstreamOption  streamOpt = IOstreamOption(),
const dictionary options = dictionary::null 
) const
inlinevirtual

Write to file, choosing writer based on the file extension.

Definition at line 221 of file MeshedSurfaceProxy.H.

References Foam::name(), and write().

Here is the call graph for this function:

◆ write() [4/5]

virtual void write ( const fileName name,
const word fileType,
IOstreamOption  streamOpt = IOstreamOption(),
const dictionary options = dictionary::null 
) const
inlinevirtual

Write to file with given format type.

If the format type is "", uses the file extension.

Definition at line 233 of file MeshedSurfaceProxy.H.

◆ write() [5/5]

void write ( const Time t,
const word surfName = word::null 
) const
virtual

Write to database.

Definition at line 122 of file MeshedSurfaceProxy.C.

References DebugInFunction, Foam::endl(), Foam::faceMap(), io(), Foam::isDir(), mkDir(), Foam::name(), os(), points, Time::timeName(), Time::timePath(), IOobject::writeEndDivider(), and Time::writeStreamOption().

Here is the call graph for this function:

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