FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

UnsortedMeshedSurface< Face > Class Template Reference

A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated with each face. More...

#include <surfMesh/UnsortedMeshedSurface.H>


Detailed Description

template<class Face>
class Foam::UnsortedMeshedSurface< Face >

A surface geometry mesh, in which the surface zone information is conveyed by the 'zoneId' associated with each face.

This form of surface description is particularly useful for reading in surface meshes from third-party formats (eg, obj, stl, gts, etc.). It can also be particularly useful for situations in which the surface many be adjusted in an arbitrary manner without worrying about needed to adjust the zone information (eg, surface refinement).

See also:
The Foam::MeshedSurface - which is organized as a surface mesh, but with independent zone information.
Source files

Definition at line 76 of file UnsortedMeshedSurface.H.

Inheritance diagram for UnsortedMeshedSurface< Face >:
Collaboration diagram for UnsortedMeshedSurface< Face >:

List of all members.

Public Member Functions

 TypeName ("UnsortedMeshedSurface")
 Runtime type information.
 UnsortedMeshedSurface ()
 Construct null.
 UnsortedMeshedSurface (const Xfer< pointField > &, const Xfer< List< Face > > &, const Xfer< List< label > > &zoneIds, const Xfer< surfZoneIdentifierList > &)
 Construct by transferring components.
 UnsortedMeshedSurface (const Xfer< pointField > &, const Xfer< List< Face > > &, const UList< label > &zoneSizes=UList< label >(), const UList< word > &zoneNames=UList< word >())
 Construct by transferring points, faces.
 UnsortedMeshedSurface (const UnsortedMeshedSurface< Face > &)
 Construct as copy.
 UnsortedMeshedSurface (const MeshedSurface< Face > &)
 Construct from a meshedSurface.
 UnsortedMeshedSurface (const Xfer< UnsortedMeshedSurface< Face > > &)
 Construct by transferring the contents from a UnsortedMeshedSurface.
 UnsortedMeshedSurface (const Xfer< MeshedSurface< Face > > &)
 Construct by transferring the contents from a meshedSurface.
 UnsortedMeshedSurface (const fileName &)
 Construct from file name (uses extension to determine type)
 UnsortedMeshedSurface (const fileName &, const word &)
 Construct from file name (uses extension to determine type)
 UnsortedMeshedSurface (Istream &)
 Construct from Istream.
 UnsortedMeshedSurface (const Time &, const word &surfName="")
 Construct from objectRegistry and a named surface.
 declareRunTimeSelectionTable (autoPtr, UnsortedMeshedSurface, fileExtension,(const fileName &name),(name))
virtual  ~UnsortedMeshedSurface ()
 declareMemberFunctionSelectionTable (void, UnsortedMeshedSurface, write, fileExtension,(const fileName &name, const UnsortedMeshedSurface< Face > &surf),(name, surf))
label  size () const
 The surface size is the number of faces.
void  setSize (const label)
 Reset size of face and zone list.
const List< label > &  zoneIds () const
 Return const access to the zone ids.
const List< surfZoneIdentifier > &  zoneToc () const
 Return const access to the zone table-of-contents.
surfZoneList  sortedZones (labelList &faceMap) const
 Sort faces according to zoneIds.
void  setOneZone ()
 Set zones to 0 and set a single zone.
void  setZones (const surfZoneList &)
 Set zone ids and zones.
void  setZones (const UList< label > &sizes, const UList< word > &names)
 Set zone ids and zones.
void  setZones (const UList< label > &sizes)
 Set zone ids and zones with default names.
virtual void  clear ()
 Clear all storage.
UnsortedMeshedSurface  subsetMesh (const labelHashSet &include, labelList &pointMap, labelList &faceMap) const
 Return new surface.
UnsortedMeshedSurface  subsetMesh (const labelHashSet &include) const
 Return new surface.
virtual void  reset (const Xfer< pointField > &, const Xfer< List< Face > > &, const Xfer< List< label > > &zoneIds)
 Transfer components (points, faces, zone ids).
virtual void  reset (const Xfer< List< point > > &, const Xfer< List< Face > > &, const Xfer< List< label > > &zoneIds)
 Transfer components (points, faces, zone ids).
void  transfer (UnsortedMeshedSurface< Face > &)
 Transfer the contents of the argument and annull the argument.
void  transfer (MeshedSurface< Face > &)
 Transfer the contents of the argument and annull the argument.
Xfer< UnsortedMeshedSurface
< Face > >  
xfer ()
 Transfer contents to the Xfer container.
bool  read (const fileName &, const word &ext)
 Read from file. Chooses reader based on explicit extension.
virtual bool  read (const fileName &)
 Read from file. Chooses reader based on detected extension.
virtual void  write (const fileName &name) const
 Generic write routine. Chooses writer based on extension.
void  write (const Time &, const word &surfName="") const
 Write to database.
void  operator= (const UnsortedMeshedSurface< Face > &)
 operator MeshedSurfaceProxy< Face > () const
 Conversion operator to MeshedSurfaceProxy.

Static Public Member Functions

static bool  canReadType (const word &ext, const bool verbose=false)
 Can we read this file format?
static bool  canRead (const fileName &, const bool verbose=false)
 Can we read this file format?
static bool  canWriteType (const word &ext, const bool verbose=false)
 Can we write this file format?
static wordHashSet  readTypes ()
static wordHashSet  writeTypes ()
static autoPtr
< UnsortedMeshedSurface >  
New (const fileName &, const word &ext)
 Select constructed from filename (explicit extension)
static autoPtr
< UnsortedMeshedSurface >  
New (const fileName &)
 Select constructed from filename (implicit extension)
static void  write (const fileName &, const UnsortedMeshedSurface< Face > &)
 Write to file.

Protected Member Functions

List< label > &  storedZoneIds ()
 Return non-const access to the zone Ids.
List< surfZoneIdentifier > &  storedZoneToc ()
 Return non-const access to the zone table-of-contents.
virtual void  remapFaces (const UList< label > &faceMap)
 Set new zones from faceMap.

Friends

class  MeshedSurface
class  UnsortedMeshedSurface
class  surfMesh

Constructor & Destructor Documentation

Construct null.

UnsortedMeshedSurface ( const Xfer< pointField > &   pointLst,
const Xfer< List< Face > > &   faceLst,
const Xfer< List< label > > &   zoneIds,
const Xfer< surfZoneIdentifierList > &   zoneTofc  
)

Construct by transferring components.

(points, faces, zone ids, zone info).

Definition at line 160 of file UnsortedMeshedSurface.C.

UnsortedMeshedSurface ( const Xfer< pointField > &   pointLst,
const Xfer< List< Face > > &   faceLst,
const UList< label > &   zoneSizes = UList<label>(),
const UList< word > &   zoneNames = UList<word>()  
)

Construct by transferring points, faces.

Use zone information, or set single default zone

Definition at line 175 of file UnsortedMeshedSurface.C.

References UList< T >::size().

UnsortedMeshedSurface ( const UnsortedMeshedSurface< Face > &   surf  )

Construct as copy.

Definition at line 204 of file UnsortedMeshedSurface.C.

UnsortedMeshedSurface ( const MeshedSurface< Face > &   surf  )

Construct from a meshedSurface.

Definition at line 220 of file UnsortedMeshedSurface.C.

References MeshedSurface< Face >::surfZones().

UnsortedMeshedSurface ( const Xfer< UnsortedMeshedSurface< Face > > &   surf  )

Construct by transferring the contents from a UnsortedMeshedSurface.

Definition at line 236 of file UnsortedMeshedSurface.C.

UnsortedMeshedSurface ( const Xfer< MeshedSurface< Face > > &   surf  )

Construct by transferring the contents from a meshedSurface.

Definition at line 248 of file UnsortedMeshedSurface.C.

UnsortedMeshedSurface ( const fileName &   name  )

Construct from file name (uses extension to determine type)

Definition at line 272 of file UnsortedMeshedSurface.C.

UnsortedMeshedSurface ( const fileName &   name,
const word &   ext  
)

Construct from file name (uses extension to determine type)

Definition at line 260 of file UnsortedMeshedSurface.C.

Construct from Istream.

UnsortedMeshedSurface ( const Time &   t,
const word &   surfName = ""  
)

Construct from objectRegistry and a named surface.

Definition at line 282 of file UnsortedMeshedSurface.C.

~UnsortedMeshedSurface (  ) [virtual]

Definition at line 297 of file UnsortedMeshedSurface.C.


Member Function Documentation

List<label>& storedZoneIds (  ) [inline, protected]

Return non-const access to the zone Ids.

Definition at line 121 of file UnsortedMeshedSurface.H.

List<surfZoneIdentifier>& storedZoneToc (  ) [inline, protected]

Return non-const access to the zone table-of-contents.

Definition at line 127 of file UnsortedMeshedSurface.H.

void remapFaces ( const UList< label > &   faceMap  ) [protected, virtual]

Set new zones from faceMap.

Reimplemented from MeshedSurface< Face >.

Definition at line 399 of file UnsortedMeshedSurface.C.

References forAll, and UList< T >::size().

TypeName ( "UnsortedMeshedSurface< Face >"    )

Runtime type information.

bool canReadType ( const word &   ext,
const bool   verbose = false  
) [static]

Can we read this file format?

Reimplemented from MeshedSurface< Face >.

Definition at line 53 of file UnsortedMeshedSurface.C.

bool canRead ( const fileName &   name,
const bool   verbose = false  
) [static]

Can we read this file format?

Reimplemented from MeshedSurface< Face >.

Definition at line 87 of file UnsortedMeshedSurface.C.

References fileName::ext(), and fileName::lessExt().

bool canWriteType ( const word &   ext,
const bool   verbose = false  
) [static]

Can we write this file format?

Reimplemented from MeshedSurface< Face >.

Definition at line 70 of file UnsortedMeshedSurface.C.

Foam::wordHashSet readTypes (  ) [static]

Reimplemented from MeshedSurface< Face >.

Definition at line 38 of file UnsortedMeshedSurface.C.

Foam::wordHashSet writeTypes (  ) [static]

Reimplemented from MeshedSurface< Face >.

Definition at line 45 of file UnsortedMeshedSurface.C.

declareRunTimeSelectionTable ( autoPtr   ,
UnsortedMeshedSurface< Face >   ,
fileExtension   ,
(const fileName &name)   ,
(name)    
)
Foam::autoPtr< Foam::UnsortedMeshedSurface< Face > > New ( const fileName &   name,
const word &   ext  
) [static]

Select constructed from filename (explicit extension)

Reimplemented from MeshedSurface< Face >.

Definition at line 32 of file UnsortedMeshedSurfaceNew.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorIn, HashTable< T, Key, Hash >::found(), Foam::Info, name(), and Foam::nl.

Foam::autoPtr< Foam::UnsortedMeshedSurface< Face > > New ( const fileName &   name  ) [static]

Select constructed from filename (implicit extension)

Reimplemented from MeshedSurface< Face >.

Reimplemented in FTRsurfaceFormat< Face >, and GTSsurfaceFormat< Face >.

Definition at line 80 of file UnsortedMeshedSurfaceNew.C.

References fileName::ext(), and fileName::lessExt().

declareMemberFunctionSelectionTable ( void   ,
UnsortedMeshedSurface< Face >   ,
write   ,
fileExtension   ,
(const fileName &name, const UnsortedMeshedSurface< Face > &surf)   ,
(name, surf)    
)
void write ( const fileName &   name,
const UnsortedMeshedSurface< Face > &   surf  
) [static]
label size (  ) const [inline]

The surface size is the number of faces.

Reimplemented from MeshedSurface< Face >.

Definition at line 263 of file UnsortedMeshedSurface.H.

References MeshedSurface< Face >::size().

Referenced by GTSsurfaceFormat< Face >::write(), and AC3DsurfaceFormat< Face >::write().

void setSize ( const label   s  )

Reset size of face and zone list.

Reimplemented from List< Face >.

Definition at line 432 of file UnsortedMeshedSurface.C.

const List<label>& zoneIds (  ) const [inline]
const List<surfZoneIdentifier>& zoneToc (  ) const [inline]

Return const access to the zone table-of-contents.

Definition at line 278 of file UnsortedMeshedSurface.H.

Referenced by TRIsurfaceFormat< Face >::write(), GTSsurfaceFormat< Face >::write(), and STLsurfaceFormat< Face >::writeAscii().

void setOneZone (  )

Set zones to 0 and set a single zone.

Definition at line 304 of file UnsortedMeshedSurface.C.

void setZones ( const surfZoneList &   zoneLst  )

Set zone ids and zones.

Definition at line 327 of file UnsortedMeshedSurface.C.

References forAll, surfZone::size(), List< T >::size(), and surfZone::start().

void setZones ( const UList< label > &   sizes,
const UList< word > &   names  
)

Set zone ids and zones.

Definition at line 348 of file UnsortedMeshedSurface.C.

References forAll, and UList< T >::size().

void setZones ( const UList< label > &   sizes  )

Set zone ids and zones with default names.

Definition at line 372 of file UnsortedMeshedSurface.C.

References forAll, Foam::name(), and UList< T >::size().

void clear (  ) [virtual]

Clear all storage.

Reimplemented from MeshedSurface< Face >.

Definition at line 441 of file UnsortedMeshedSurface.C.

References clear().

Referenced by OFSsurfaceFormat< Face >::read(), UnsortedMeshedSurface< Face >::transfer(), and MeshedSurface< Face >::transfer().

Foam::UnsortedMeshedSurface< Face > subsetMesh ( const labelHashSet &   include,
labelList &   pointMap,
labelList &   faceMap  
) const

Return new surface.

Returns return pointMap, faceMap from subsetMeshMap

Reimplemented from MeshedSurface< Face >.

Definition at line 537 of file UnsortedMeshedSurface.C.

References f(), forAll, List< T >::size(), PatchTools::subsetMap(), Foam::xferCopy(), and Foam::xferMove().

Referenced by AC3DsurfaceFormat< Face >::write().

Foam::UnsortedMeshedSurface< Face > subsetMesh ( const labelHashSet &   include  ) const

Return new surface.

Reimplemented from MeshedSurface< Face >.

Definition at line 591 of file UnsortedMeshedSurface.C.

void reset ( const Xfer< pointField > &   pointLst,
const Xfer< List< Face > > &   faceLst,
const Xfer< List< label > > &   zoneIds  
) [virtual]

Transfer components (points, faces, zone ids).

Definition at line 602 of file UnsortedMeshedSurface.C.

void reset ( const Xfer< List< point > > &   pointLst,
const Xfer< List< Face > > &   faceLst,
const Xfer< List< label > > &   zoneIds  
) [virtual]

Transfer components (points, faces, zone ids).

Definition at line 624 of file UnsortedMeshedSurface.C.

void transfer ( MeshedSurface< Face > &   surf  )

Transfer the contents of the argument and annull the argument.

Reimplemented from MeshedSurface< Face >.

Definition at line 666 of file UnsortedMeshedSurface.C.

References MeshedSurface< Face >::clear(), MeshedSurface< Face >::storedFaces(), MeshedSurface< Face >::storedPoints(), MeshedSurface< Face >::surfZones(), and Foam::xferMove().

Foam::Xfer< Foam::UnsortedMeshedSurface< Face > > xfer (  )

Transfer contents to the Xfer container.

Reimplemented from MeshedSurface< Face >.

Definition at line 684 of file UnsortedMeshedSurface.C.

References Foam::xferMove().

bool read ( const fileName &   name,
const word &   ext  
)

Read from file. Chooses reader based on explicit extension.

Reimplemented from MeshedSurface< Face >.

Definition at line 710 of file UnsortedMeshedSurface.C.

References clear().

bool read ( const fileName &   name  ) [virtual]

Read from file. Chooses reader based on detected extension.

Reimplemented from MeshedSurface< Face >.

Reimplemented in FTRsurfaceFormat< Face >, and GTSsurfaceFormat< Face >.

Definition at line 692 of file UnsortedMeshedSurface.C.

References fileName::ext(), and fileName::lessExt().

virtual void write ( const fileName &   name  ) const [inline, virtual]

Generic write routine. Chooses writer based on extension.

Reimplemented from MeshedSurface< Face >.

Reimplemented in GTSsurfaceFormat< Face >.

Definition at line 358 of file UnsortedMeshedSurface.H.

References UnsortedMeshedSurface< Face >::write().

void write ( const Time &   t,
const word &   surfName = ""  
) const

Write to database.

Reimplemented from MeshedSurface< Face >.

Definition at line 725 of file UnsortedMeshedSurface.C.

References MeshedSurfaceProxy< Face >::write().

operator MeshedSurfaceProxy< Face > (  ) const

Conversion operator to MeshedSurfaceProxy.

Reimplemented from MeshedSurface< Face >.


Friends And Related Function Documentation

friend class MeshedSurface [friend]

Reimplemented from MeshedSurface< Face >.

Definition at line 81 of file UnsortedMeshedSurface.H.

Reimplemented from MeshedSurface< Face >.

Definition at line 82 of file UnsortedMeshedSurface.H.

friend class surfMesh [friend]

Reimplemented from MeshedSurface< Face >.

Definition at line 83 of file UnsortedMeshedSurface.H.


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