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 57 of file ensightPart.H.

Constructor & Destructor Documentation

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 ( 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 ( 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 ( const ensightPart part)

Construct as copy.

Definition at line 115 of file ensightPart.C.

~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

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:

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:

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:

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:

virtual localPoints calcLocalPoints ( ) const
inlineprotectedvirtual

Track points used.

Definition at line 145 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:

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

Write connectivities.

Definition at line 152 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 ( "ensightPart"  )

Runtime type information.

Referenced by ensightPart::writeConnectivity().

Here is the caller graph for this function:

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

Referenced by ensightPart::writeConnectivity().

Here is the caller graph for this function:

autoPtr<ensightPart> clone ( ) const
inline

Construct and return clone.

Definition at line 202 of file ensightPart.H.

References ensightPart::ensightPart(), ensightPart::New(), and ensightPart::~ensightPart().

Here is the call graph for this function:

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:

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

Reimplemented in ensightPartFaces, and ensightPartCells.

Definition at line 218 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:

label size ( ) const
inline

Number of elements in this part.

Definition at line 227 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:

bool isCellData ( ) const
inline

Represents cell data.

Definition at line 233 of file ensightPart.H.

References ensightPart::isCellData_.

bool isFaceData ( ) const
inline

Represents face data.

Definition at line 239 of file ensightPart.H.

References ensightPart::isCellData_.

label number ( ) const
inline

Part number.

Definition at line 245 of file ensightPart.H.

References ensightPart::number_.

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

Here is the caller graph for this function:

const string& name ( ) const
inline

Part name or description.

Definition at line 251 of file ensightPart.H.

References ensightPart::name_.

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

Here is the caller graph for this function:

label materialId ( ) const
inline

Material id.

Definition at line 257 of file ensightPart.H.

References ensightPart::matId_.

void name ( const string value)
inline

non-const access to part name or description

Definition at line 263 of file ensightPart.H.

void materialId ( const label  value)
inline

non-const access to material id

Definition at line 269 of file ensightPart.H.

const labelListList& elemLists ( ) const
inline

Simple labelList with a name.

Definition at line 275 of file ensightPart.H.

References ensightPart::elemLists_.

label offset ( ) const
inline

Offset for element ids.

Definition at line 281 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:

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:

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:

bool writeData ( Ostream os) const
virtual void writeGeometry ( ensightGeoFile ) const
inlinevirtual

Write geometry.

Reimplemented in ensightPartFaces, and ensightPartCells.

Definition at line 299 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:

void writeGeometry ( ensightGeoFile os,
const pointField points 
) const
void writeScalarField ( ensightFile os,
const List< scalar > &  field,
const bool  perNode = false 
) const
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:

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:

void operator= ( const ensightPart )
inline

Disallow default bitwise assignment.

Definition at line 340 of file ensightPart.H.

References notImplemented, and ensightPart::operator<<.

Friends And Related Function Documentation

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

Write data (reconstruction information)

Referenced by ensightPart::operator=().

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

Write geometry.

Member Data Documentation

label number_
protected

Part number.

Definition at line 70 of file ensightPart.H.

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

string name_
protected

Part name (or description)

Definition at line 73 of file ensightPart.H.

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

labelListList elemLists_
protected
label offset_
protected
label size_
protected

Number of elements in this part.

Definition at line 82 of file ensightPart.H.

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

bool isCellData_
protected

Cell or face data.

Definition at line 85 of file ensightPart.H.

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

label matId_
protected

Material id (numeric)

Definition at line 88 of file ensightPart.H.

Referenced by ensightPart::materialId().

const pointField& points_
protected

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