MeshedSurfaceProxy< Face > Class Template Reference

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

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...
 

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...
 

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 82 of file MeshedSurface.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 237 of file MeshedSurfaceProxy.C.

◆ ~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 47 of file MeshedSurfaceProxy.C.

Referenced by surfaceWriter::supportedType().

Here is the caller graph for this function:

◆ 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 64 of file MeshedSurfaceProxy.C.

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

Referenced by MeshedSurfaceProxy< Face >::write(), UnsortedMeshedSurface< Face >::write(), surfMesh::write(), MeshedSurface< Foam::face >::write(), and triSurface::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 77 of file MeshedSurfaceProxy.C.

References DebugInFunction, Foam::exit(), word::ext(), Foam::FatalError, FatalErrorInFunction, Foam::flatOutput(), Foam::name(), Foam::nl, and Foam::vtk::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.

◆ 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(), STARCDsurfaceFormat< Face >::write(), and NASsurfaceFormat< Face >::write().

Here is the caller graph for this function:

◆ useFaceMap()

◆ useFaceIds()

bool useFaceIds ( ) const
inline

Possible to use faceIds?

Definition at line 209 of file MeshedSurfaceProxy.H.

◆ nTriangles()

Foam::label nTriangles ( ) const
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 222 of file MeshedSurfaceProxy.H.

References Foam::name(), and MeshedSurfaceProxy< Face >::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 234 of file MeshedSurfaceProxy.H.

References Foam::name(), and MeshedSurfaceProxy< Face >::write().

Here is the call graph for this function:

◆ write() [5/5]

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

Write to database.

Definition at line 123 of file MeshedSurfaceProxy.C.

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

Here is the call graph for this function:

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