Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
ensightPart Class Reference

Base class for ensightPartCells and ensightPartFaces. More...

Inheritance diagram for ensightPart:
Inheritance graph
[legend]
Collaboration diagram for ensightPart:
Collaboration graph
[legend]

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 &)
 Construct as copy. 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 generalized field components. More...
 
void operator= (const ensightPart &)
 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

Base class for ensightPartCells and ensightPartFaces.

Source files

Definition at line 65 of file ensightPart.H.

Constructor & Destructor Documentation

◆ ensightPart() [1/4]

Construct null.

Definition at line 67 of file ensightPart.C.

Referenced by ensightPart::clone(), ensightPart::ensightPart(), ensightPart::isFieldDefined(), and ensightPart::writeConnectivity().

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 81 of file ensightPart.C.

References ensightPart::ensightPart().

Here is the call graph for this function:

◆ ensightPart() [3/4]

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

Construct part with number, description and points reference.

Definition at line 98 of file ensightPart.C.

◆ ensightPart() [4/4]

ensightPart ( const ensightPart part)

Construct as copy.

Definition at line 115 of file ensightPart.C.

◆ ~ensightPart()

~ensightPart ( )
virtual

Destructor.

Definition at line 155 of file ensightPart.C.

Referenced by ensightPart::clone().

Here is the caller graph for this function:

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(), List< T >::clear(), dict, ensightPart::elementTypes(), ensightPart::elemLists_, forAll, dictionary::lookup(), ensightPart::name_, ensightPart::number_, ensightPart::offset_, dictionary::readIfPresent(), List< T >::setSize(), List< T >::size(), ensightPart::size(), and ensightPart::size_.

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

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::ensightPart(), forAll, and List< T >::size().

Referenced by ensightPart::localPoints::localPoints(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().

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

◆ writeHeader()

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

Write the part header.

Definition at line 36 of file ensightPartIO.C.

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

Referenced by ensightPart::localPoints::localPoints(), ensightPart::writeGeometry(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().

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 56 of file ensightPartIO.C.

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

Referenced by ensightPart::localPoints::localPoints(), ensightPart::writeHeader(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().

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.

References ensightPart::localPoints::localPoints(), and ensightPart::writeConnectivity().

Referenced by ensightPart::writeGeometry().

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

◆ writeConnectivity()

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

Write connectivities.

Definition at line 160 of file ensightPart.H.

References ensightPart::declareRunTimeSelectionTable(), ensightPart::ensightPart(), points, and ensightPart::TypeName().

Referenced by ensightPart::calcLocalPoints(), and ensightPart::writeGeometry().

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

◆ TypeName()

TypeName ( "ensightPart"  )

Runtime type information.

Referenced by ensightPart::writeConnectivity().

Here is the caller graph for this function:

◆ declareRunTimeSelectionTable()

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

Referenced by ensightPart::writeConnectivity().

Here is the caller graph for this function:

◆ clone()

autoPtr<ensightPart> clone ( ) const
inline

Construct and return clone.

Definition at line 210 of file ensightPart.H.

References ensightPart::ensightPart(), ensightPart::New(), and 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.

Referenced by ensightPart::clone().

Here is the call graph for this function:
Here is the caller 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::reconstruct(), ensightPart::writeData(), ensightPart::writeGeometry(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().

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 ensightPart::reconstruct(), ensightPart::writeData(), ensightPart::writeGeometry(), ensightPart::writeScalarField(), ensightPart::writeSummary(), and ensightPart::writeVectorField().

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::writeData(), and ensightPart::writeSummary().

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::writeData(), and ensightPart::writeSummary().

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.

◆ materialId() [2/2]

void materialId ( const label  value)
inline

non-const access to material id

Definition at line 277 of file ensightPart.H.

◆ 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_, ensightPart::renumber(), ensightPart::writeData(), and ensightPart::writeSummary().

Referenced by ensightPart::writeData(), and ensightPart::writeSummary().

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

◆ renumber()

void renumber ( const labelUList origId)

Renumber elements.

Definition at line 161 of file ensightPart.C.

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

Referenced by ensightPart::offset().

Here is the call graph for this function:
Here is the caller 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, token::END_STATEMENT, Foam::endl(), Foam::incrIndent(), Foam::indent(), ensightPart::name(), Foam::nl, ensightPart::number(), ensightPart::offset(), ensightPart::size(), Foam::type(), and Ostream::writeKeyword().

Referenced by ensightPart::offset().

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

◆ writeData()

bool writeData ( Ostream os) const

◆ writeGeometry() [1/2]

virtual void writeGeometry ( ensightGeoFile ) const
inlinevirtual

Write geometry.

Reimplemented in ensightPartFaces, and ensightPartCells.

Definition at line 307 of file ensightPart.H.

References ensightPart::writeField(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().

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

Here is the call graph for this function:
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

◆ 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 250 of file ensightPartIO.C.

References ensightFile::allowUndef(), ensightPart::elementTypes(), ensightPart::elemLists_, forAll, ensightPart::isFieldDefined(), UList< T >::null(), List< T >::size(), ensightPart::size(), UList< T >::size(), ensightPart::writeFieldList(), ensightPart::writeHeader(), and ensightFile::writeKeyword().

Referenced by ensightPart::writeGeometry(), and ensightPart::writeScalarField().

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

◆ writeField()

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

Write generalized field components.

optionally write data per node

Definition at line 35 of file ensightPartTemplates.C.

References Field< Type >::component(), forAll, List< Type >::size(), UList< T >::size(), and ensightFile::writeKeyword().

Referenced by ensightPart::writeGeometry().

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

◆ operator=()

void operator= ( const ensightPart )
inline

Disallow default bitwise assignment.

Definition at line 348 of file ensightPart.H.

References NotImplemented, and ensightPart::operator<<.

Friends And Related Function Documentation

◆ operator<< [1/2]

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

Write data (reconstruction information)

Referenced by ensightPart::operator=().

◆ 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(), and ensightPart::reconstruct().

◆ name_

string name_
protected

Part name (or description)

Definition at line 81 of file ensightPart.H.

Referenced by ensightPart::name(), and ensightPart::reconstruct().

◆ elemLists_

labelListList elemLists_
protected

◆ offset_

label offset_
protected

◆ size_

label size_
protected

Number of elements in this part.

Definition at line 90 of file ensightPart.H.

Referenced by ensightPart::reconstruct(), 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

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