ensightPart Class Reference

Base class for ensightPartCells and ensightPartFaces. More...

Inheritance diagram for ensightPart:
Collaboration diagram for ensightPart:

Classes

class  localPoints
 Track the points used by the part and map global to local indices. More...
 

Public Member Functions

 TypeName ("ensightPart")
 Runtime type information. More...
 
 ensightPart ()
 Construct null. More...
 
 ensightPart (label partNumber, const string &partDescription)
 Construct empty part with number and description. More...
 
 ensightPart (label partNumber, const string &partDescription, const pointField &points)
 Construct part with number, description and points reference. More...
 
 ensightPart (const ensightPart &)
 Copy constructor. More...
 
 declareRunTimeSelectionTable (autoPtr, ensightPart, istream,(Istream &is),(is))
 
autoPtr< ensightPartclone () const
 Construct and return clone. More...
 
virtual ~ensightPart ()
 Destructor. More...
 
virtual const List< word > & elementTypes () const
 
label size () const
 Number of elements in this part. More...
 
bool isCellData () const
 Represents cell data. More...
 
bool isFaceData () const
 Represents face data. More...
 
label number () const
 Part number. More...
 
const stringname () const
 Part name or description. More...
 
label materialId () const
 Material id. More...
 
void name (const string &value)
 non-const access to part name or description More...
 
void materialId (const label value)
 non-const access to material id More...
 
const labelListListelemLists () const
 Simple labelList with a name. More...
 
label offset () const
 Offset for element ids. More...
 
void renumber (const labelUList &)
 Renumber elements. More...
 
bool writeSummary (Ostream &) const
 Write summary information about the object. More...
 
bool writeData (Ostream &) const
 Write reconstruction information for the object. More...
 
virtual void writeGeometry (ensightGeoFile &) const
 Write geometry. More...
 
void writeGeometry (ensightGeoFile &, const pointField &) const
 Helper: write geometry given the pointField. More...
 
void writeScalarField (ensightFile &, const List< scalar > &field, const bool perNode=false) const
 Write scalar field. More...
 
void writeVectorField (ensightFile &, const List< scalar > &field0, const List< scalar > &field1, const List< scalar > &field2, const bool perNode=false) const
 Write vector field components. More...
 
template<class Type >
void writeField (ensightFile &, const Field< Type > &, const bool perNode=false) const
 Write generalised field components. More...
 
void operator= (const ensightPart &)=delete
 Disallow default bitwise assignment. More...
 

Static Public Member Functions

static autoPtr< ensightPartNew (Istream &)
 Reconstruct part characteristics on freestore from Istream. More...
 

Protected Member Functions

void reconstruct (Istream &)
 Reconstruct part characteristics (eg, element types) from Istream. More...
 
bool isFieldDefined (const List< scalar > &) const
 Check for fully defined fields. More...
 
void writeHeader (ensightFile &, bool withDescription=false) const
 Write the part header. More...
 
void writeFieldList (ensightFile &os, const List< scalar > &field, const labelUList &idList) const
 Write a scalar field for idList. More...
 
virtual localPoints calcLocalPoints () const
 Track points used. More...
 
virtual void writeConnectivity (ensightGeoFile &, const word &key, const labelUList &idList, const labelUList &pointMap) const
 Write connectivities. More...
 

Protected Attributes

label number_
 Part number. More...
 
string name_
 Part name (or description) More...
 
labelListList elemLists_
 Simple labelList with a name. More...
 
label offset_
 Start offset for elemLists_. More...
 
label size_
 Number of elements in this part. More...
 
bool isCellData_
 Cell or face data. More...
 
label matId_
 Material id (numeric) More...
 
const pointFieldpoints_
 pointField referenced More...
 

Friends

Ostreamoperator<< (Ostream &, const ensightPart &)
 Write data (reconstruction information) More...
 
ensightGeoFileoperator<< (ensightGeoFile &, const ensightPart &)
 Write geometry. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ ensightPart() [1/4]

Construct null.

Definition at line 66 of file ensightPart.C.

Referenced by ensightPart::clone().

Here is the caller graph for this function:

◆ ensightPart() [2/4]

ensightPart ( label  partNumber,
const string partDescription 
)

Construct empty part with number and description.

Definition at line 80 of file ensightPart.C.

◆ ensightPart() [3/4]

ensightPart ( label  partNumber,
const string partDescription,
const pointField points 
)

Construct part with number, description and points reference.

Definition at line 97 of file ensightPart.C.

◆ ensightPart() [4/4]

ensightPart ( const ensightPart part)

Copy constructor.

Definition at line 115 of file ensightPart.C.

◆ ~ensightPart()

~ensightPart ( )
virtual

Destructor.

Definition at line 155 of file ensightPart.C.

Member Function Documentation

◆ reconstruct()

void reconstruct ( Istream is)
protected

Reconstruct part characteristics (eg, element types) from Istream.

A part reconstructed in this manner can be used when writing fields, but cannot be used to write a new geometry

Definition at line 101 of file ensightPartIO.C.

References IOstream::check(), dict, forAll, dictionary::lookup(), and dictionary::readIfPresent().

Referenced by ensightPartCells::ensightPartCells(), and ensightPartFaces::ensightPartFaces().

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

◆ isFieldDefined()

bool isFieldDefined ( const List< scalar > &  field) const
protected

Check for fully defined fields.

Definition at line 44 of file ensightPart.C.

References ensightPart::elemLists_, forAll, and List< T >::size().

Here is the call graph for this function:

◆ writeHeader()

void writeHeader ( ensightFile os,
bool  withDescription = false 
) const
protected

Write the part header.

Definition at line 35 of file ensightPartIO.C.

References ensightPart::name(), ensightFile::newline(), ensightPart::number(), and ensightFile::write().

Referenced by ensightPart::writeField().

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

◆ writeFieldList()

void writeFieldList ( ensightFile os,
const List< scalar > &  field,
const labelUList idList 
) const
protected

Write a scalar field for idList.

A null reference for idList writes the perNode values

Definition at line 55 of file ensightPartIO.C.

References forAll, ensightFile::newline(), Foam::notNull(), List< T >::size(), ensightFile::write(), and ensightFile::writeUndef().

Referenced by ensightPart::writeField().

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

◆ calcLocalPoints()

virtual localPoints calcLocalPoints ( ) const
inlineprotectedvirtual

Track points used.

Definition at line 153 of file ensightPart.H.

◆ writeConnectivity()

virtual void writeConnectivity ( ensightGeoFile ,
const word key,
const labelUList idList,
const labelUList pointMap 
) const
inlineprotectedvirtual

Write connectivities.

Definition at line 159 of file ensightPart.H.

◆ TypeName()

TypeName ( "ensightPart"  )

Runtime type information.

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
ensightPart  ,
istream  ,
(Istream &is)  ,
(is)   
)

◆ clone()

autoPtr<ensightPart> clone ( ) const
inline

Construct and return clone.

Definition at line 210 of file ensightPart.H.

References ensightPart::ensightPart().

Here is the call graph for this function:

◆ New()

Foam::autoPtr< Foam::ensightPart > New ( Istream is)
static

Reconstruct part characteristics on freestore from Istream.

See also
reconstruct

Definition at line 130 of file ensightPart.C.

References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, and Foam::nl.

Here is the call graph for this function:

◆ elementTypes()

virtual const List<word>& elementTypes ( ) const
inlinevirtual

Reimplemented in ensightPartFaces, and ensightPartCells.

Definition at line 226 of file ensightPart.H.

Referenced by ensightPart::writeField().

Here is the caller graph for this function:

◆ size()

label size ( ) const
inline

Number of elements in this part.

Definition at line 235 of file ensightPart.H.

References ensightPart::size_.

Referenced by ensightPartFaces::classify(), and ensightPart::writeField().

Here is the caller graph for this function:

◆ isCellData()

bool isCellData ( ) const
inline

Represents cell data.

Definition at line 241 of file ensightPart.H.

References ensightPart::isCellData_.

◆ isFaceData()

bool isFaceData ( ) const
inline

Represents face data.

Definition at line 247 of file ensightPart.H.

References ensightPart::isCellData_.

◆ number()

label number ( ) const
inline

Part number.

Definition at line 253 of file ensightPart.H.

References ensightPart::number_.

Referenced by ensightPart::writeHeader().

Here is the caller graph for this function:

◆ name() [1/2]

const string& name ( ) const
inline

Part name or description.

Definition at line 259 of file ensightPart.H.

References ensightPart::name_.

Referenced by ensightPart::writeHeader().

Here is the caller graph for this function:

◆ materialId() [1/2]

label materialId ( ) const
inline

Material id.

Definition at line 265 of file ensightPart.H.

References ensightPart::matId_.

◆ name() [2/2]

void name ( const string value)
inline

non-const access to part name or description

Definition at line 271 of file ensightPart.H.

References ensightPart::name_.

◆ materialId() [2/2]

void materialId ( const label  value)
inline

non-const access to material id

Definition at line 277 of file ensightPart.H.

References ensightPart::matId_.

◆ elemLists()

const labelListList& elemLists ( ) const
inline

Simple labelList with a name.

Definition at line 283 of file ensightPart.H.

References ensightPart::elemLists_.

◆ offset()

label offset ( ) const
inline

Offset for element ids.

Definition at line 289 of file ensightPart.H.

References ensightPart::offset_.

◆ renumber()

void renumber ( const labelUList origId)

Renumber elements.

Definition at line 161 of file ensightPart.C.

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

Here is the call graph for this function:

◆ writeSummary()

bool writeSummary ( Ostream os) const

Write summary information about the object.

Definition at line 127 of file ensightPartIO.C.

References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, Foam::endl(), Foam::incrIndent(), Foam::indent(), Foam::name(), Foam::nl, Foam::offset(), Foam::type(), and Foam::writeEntry().

Here is the call graph for this function:

◆ writeData()

bool writeData ( Ostream os) const

Write reconstruction information for the object.

Definition at line 144 of file ensightPartIO.C.

References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, Foam::endl(), forAll, Foam::incrIndent(), Foam::indent(), Foam::name(), Foam::nl, Foam::offset(), Foam::type(), and Foam::writeEntry().

Here is the call graph for this function:

◆ writeGeometry() [1/2]

virtual void writeGeometry ( ensightGeoFile ) const
inlinevirtual

Write geometry.

Reimplemented in ensightPartFaces, and ensightPartCells.

Definition at line 307 of file ensightPart.H.

Referenced by ensightPartCells::writeGeometry(), and ensightPartFaces::writeGeometry().

Here is the caller graph for this function:

◆ writeGeometry() [2/2]

void writeGeometry ( ensightGeoFile os,
const pointField points 
) const

◆ writeScalarField()

void writeScalarField ( ensightFile os,
const List< scalar > &  field,
const bool  perNode = false 
) const

Write scalar field.

optionally write data per node

Definition at line 216 of file ensightPartIO.C.

References ensightFile::allowUndef(), forAll, UList< label >::null(), UList< T >::size(), List< T >::size(), Foam::vtkWriteOps::writeHeader(), and ensightFile::writeKeyword().

Here is the call graph for this function:

◆ writeVectorField()

void writeVectorField ( ensightFile os,
const List< scalar > &  field0,
const List< scalar > &  field1,
const List< scalar > &  field2,
const bool  perNode = false 
) const

Write vector field components.

optionally write data per node

Definition at line 249 of file ensightPartIO.C.

References ensightFile::allowUndef(), forAll, UList< label >::null(), UList< T >::size(), List< T >::size(), Foam::vtkWriteOps::writeHeader(), and ensightFile::writeKeyword().

Here is the call graph for this function:

◆ writeField()

void writeField ( ensightFile os,
const Field< Type > &  field,
const bool  perNode = false 
) const

Write generalised field components.

optionally write data per node

Definition at line 34 of file ensightPartTemplates.C.

References Field< Type >::component(), ensightPart::elementTypes(), ensightPart::elemLists_, forAll, UList< label >::null(), UList< T >::size(), ensightPart::size(), List< T >::size(), ensightPart::writeFieldList(), ensightPart::writeHeader(), and ensightFile::writeKeyword().

Here is the call graph for this function:

◆ operator=()

void operator= ( const ensightPart )
delete

Disallow default bitwise assignment.

Friends And Related Function Documentation

◆ operator<< [1/2]

Ostream& operator<< ( Ostream ,
const ensightPart  
)
friend

Write data (reconstruction information)

◆ operator<< [2/2]

ensightGeoFile& operator<< ( ensightGeoFile ,
const ensightPart  
)
friend

Write geometry.

Member Data Documentation

◆ number_

label number_
protected

Part number.

Definition at line 78 of file ensightPart.H.

Referenced by ensightPart::number().

◆ name_

string name_
protected

Part name (or description)

Definition at line 81 of file ensightPart.H.

Referenced by ensightPart::name().

◆ elemLists_

labelListList elemLists_
protected

Simple labelList with a name.

Definition at line 84 of file ensightPart.H.

Referenced by ensightPartFaces::classify(), ensightPart::elemLists(), ensightPart::isFieldDefined(), and ensightPart::writeField().

◆ offset_

label offset_
protected

Start offset for elemLists_.

Definition at line 87 of file ensightPart.H.

Referenced by ensightPartFaces::ensightPartFaces(), and ensightPart::offset().

◆ size_

label size_
protected

Number of elements in this part.

Definition at line 90 of file ensightPart.H.

Referenced by ensightPartFaces::classify(), ensightPartFaces::ensightPartFaces(), and ensightPart::size().

◆ isCellData_

bool isCellData_
protected

Cell or face data.

Definition at line 93 of file ensightPart.H.

Referenced by ensightPartFaces::ensightPartFaces(), ensightPart::isCellData(), and ensightPart::isFaceData().

◆ matId_

label matId_
protected

Material id (numeric)

Definition at line 96 of file ensightPart.H.

Referenced by ensightPart::materialId().

◆ points_

const pointField& points_
protected

pointField referenced

Definition at line 99 of file ensightPart.H.


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