Base class for ensightPartCells and ensightPartFaces. More...
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< ensightPart > | clone () 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 string & | name () 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 labelListList & | elemLists () 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< ensightPart > | New (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 pointField & | points_ |
pointField referenced More... | |
Friends | |
Ostream & | operator<< (Ostream &, const ensightPart &) |
Write data (reconstruction information) More... | |
ensightGeoFile & | operator<< (ensightGeoFile &, const ensightPart &) |
Write geometry. More... | |
Base class for ensightPartCells and ensightPartFaces.
Definition at line 65 of file ensightPart.H.
ensightPart | ( | ) |
Construct null.
Definition at line 67 of file ensightPart.C.
Referenced by ensightPart::clone(), ensightPart::ensightPart(), ensightPart::isFieldDefined(), and ensightPart::writeConnectivity().
ensightPart | ( | label | partNumber, |
const string & | partDescription | ||
) |
Construct empty part with number and description.
Definition at line 81 of file ensightPart.C.
References ensightPart::ensightPart().
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 | ) |
Copy constructor.
Definition at line 115 of file ensightPart.C.
|
virtual |
Destructor.
Definition at line 155 of file ensightPart.C.
Referenced by ensightPart::clone().
|
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().
|
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().
|
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().
|
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().
|
inlineprotectedvirtual |
Track points used.
Definition at line 153 of file ensightPart.H.
References ensightPart::localPoints::localPoints(), and ensightPart::writeConnectivity().
Referenced by ensightPart::writeGeometry().
|
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().
TypeName | ( | "ensightPart" | ) |
Runtime type information.
Referenced by ensightPart::writeConnectivity().
declareRunTimeSelectionTable | ( | autoPtr | , |
ensightPart | , | ||
istream | , | ||
(Istream &is) | , | ||
(is) | |||
) |
|
inline |
Construct and return clone.
Definition at line 210 of file ensightPart.H.
References ensightPart::ensightPart(), ensightPart::New(), and ensightPart::~ensightPart().
|
static |
Reconstruct part characteristics on freestore from Istream.
Definition at line 130 of file ensightPart.C.
References Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, and Foam::nl.
Referenced by ensightPart::clone().
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().
|
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().
|
inline |
Represents cell data.
Definition at line 241 of file ensightPart.H.
References ensightPart::isCellData_.
|
inline |
Represents face data.
Definition at line 247 of file ensightPart.H.
References ensightPart::isCellData_.
|
inline |
Part number.
Definition at line 253 of file ensightPart.H.
References ensightPart::number_.
Referenced by ensightPart::writeData(), and ensightPart::writeSummary().
|
inline |
Part name or description.
Definition at line 259 of file ensightPart.H.
References ensightPart::name_.
Referenced by ensightPart::writeData(), and ensightPart::writeSummary().
|
inline |
|
inline |
non-const access to part name or description
Definition at line 271 of file ensightPart.H.
|
inline |
non-const access to material id
Definition at line 277 of file ensightPart.H.
|
inline |
Simple labelList with a name.
Definition at line 283 of file ensightPart.H.
References ensightPart::elemLists_.
|
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().
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().
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(), ensightPart::name(), Foam::nl, ensightPart::number(), ensightPart::offset(), ensightPart::size(), Foam::type(), and Foam::writeEntry().
Referenced by ensightPart::offset().
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(), ensightPart::elementTypes(), ensightPart::elemLists_, token::END_BLOCK, Foam::endl(), forAll, Foam::incrIndent(), Foam::indent(), ensightPart::name(), Foam::nl, ensightPart::number(), ensightPart::offset(), ensightPart::size(), Foam::type(), Foam::writeEntry(), and ensightPart::writeGeometry().
Referenced by ensightPart::offset().
|
inlinevirtual |
Write geometry.
Reimplemented in ensightPartFaces, and ensightPartCells.
Definition at line 307 of file ensightPart.H.
References ensightPart::operator<<, ensightPart::operator=(), ensightPart::writeField(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().
Referenced by ensightPart::writeData(), ensightPartCells::writeGeometry(), and ensightPartFaces::writeGeometry().
void writeGeometry | ( | ensightGeoFile & | os, |
const pointField & | points | ||
) | const |
Helper: write geometry given the pointField.
Definition at line 169 of file ensightPartIO.C.
References ensightPart::calcLocalPoints(), Foam::component(), ensightPart::elementTypes(), ensightPart::elemLists_, forAll, ensightPart::localPoints::list, VectorSpace< Vector< scalar >, scalar, 3 >::nComponents, ensightFile::newline(), ensightPart::localPoints::nPoints, ensightPart::size(), ensightFile::write(), ensightPart::writeConnectivity(), ensightPart::writeHeader(), ensightGeoFile::writeKeyword(), and ensightPart::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 217 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(), ensightFile::writeKeyword(), and ensightPart::writeVectorField().
Referenced by ensightPart::writeGeometry().
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().
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 35 of file ensightPartTemplates.C.
References Field< Type >::component(), forAll, List< Type >::size(), UList< T >::size(), Foam::vtkWriteOps::writeHeader(), and ensightFile::writeKeyword().
Referenced by ensightPart::writeGeometry().
|
delete |
Disallow default bitwise assignment.
Referenced by ensightPart::writeGeometry().
|
friend |
Write data (reconstruction information)
Referenced by ensightPart::writeGeometry().
|
friend |
Write geometry.
|
protected |
Part number.
Definition at line 78 of file ensightPart.H.
Referenced by ensightPart::number(), and ensightPart::reconstruct().
|
protected |
Part name (or description)
Definition at line 81 of file ensightPart.H.
Referenced by ensightPart::name(), and ensightPart::reconstruct().
|
protected |
Simple labelList with a name.
Definition at line 84 of file ensightPart.H.
Referenced by ensightPart::elemLists(), ensightPart::reconstruct(), ensightPart::renumber(), ensightPart::writeData(), ensightPart::writeGeometry(), ensightPart::writeScalarField(), ensightPart::writeVectorField(), ensightPartCells::~ensightPartCells(), and ensightPartFaces::~ensightPartFaces().
|
protected |
Start offset for elemLists_.
Definition at line 87 of file ensightPart.H.
Referenced by ensightPart::offset(), ensightPart::reconstruct(), ensightPart::renumber(), ensightPartFaces::writeConnectivity(), ensightPartCells::~ensightPartCells(), and ensightPartFaces::~ensightPartFaces().
|
protected |
Number of elements in this part.
Definition at line 90 of file ensightPart.H.
Referenced by ensightPart::reconstruct(), and ensightPart::size().
|
protected |
Cell or face data.
Definition at line 93 of file ensightPart.H.
Referenced by ensightPartFaces::ensightPartFaces(), ensightPart::isCellData(), and ensightPart::isFaceData().
|
protected |
Material id (numeric)
Definition at line 96 of file ensightPart.H.
Referenced by ensightPart::materialId().
|
protected |
pointField referenced
Definition at line 99 of file ensightPart.H.
Referenced by ensightPartCells::writeGeometry(), ensightPartFaces::writeGeometry(), ensightPartCells::~ensightPartCells(), and ensightPartFaces::~ensightPartFaces().