Skip to content
Snippets Groups Projects
Commit af132099 authored by mark's avatar mark Committed by Mark OLESEN
Browse files

STYLE: add OpenFOAM version to ensight geom file description.

- More informative than a horizonal line, can help when debugging.

STYLE: remove unused write field methods from ensightParts
parent 53ed99b0
Branches
No related tags found
No related merge requests found
...@@ -24,14 +24,26 @@ License ...@@ -24,14 +24,26 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "ensightGeoFile.H" #include "ensightGeoFile.H"
#include "foamVersion.H"
// Macros to stringify macro contents.
#define STRINGIFY(content) #content
#define STRING_QUOTE(input) STRINGIFY(input)
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::ensightGeoFile::initialize() void Foam::ensightGeoFile::initialize()
{ {
#ifdef OPENFOAM_PLUS
string desc2("Written by OpenFOAM+ " STRING_QUOTE(OPENFOAM_PLUS));
#else
string desc2("Written by OpenFOAM-" + string(Foam::FOAMversion));
#endif
writeBinaryHeader(); writeBinaryHeader();
write("Ensight Geometry File"); newline(); // description line 1 write("Ensight Geometry File"); newline(); // description line 1
write("====================="); newline(); // description line 2 write(desc2); newline(); // description line 2
write("node id assign"); newline(); write("node id assign"); newline();
write("element id assign"); newline(); write("element id assign"); newline();
} }
......
...@@ -303,27 +303,6 @@ public: ...@@ -303,27 +303,6 @@ public:
//- Helper: write geometry given the pointField //- Helper: write geometry given the pointField
void writeGeometry(ensightGeoFile&, const pointField&) const; void writeGeometry(ensightGeoFile&, const pointField&) const;
//- Write scalar field
// optionally write data per node
void writeScalarField
(
ensightFile&,
const List<scalar>& field,
const bool perNode = false
) const;
//- Write vector field components
// optionally write data per node
void writeVectorField
(
ensightFile&,
const List<scalar>& field0,
const List<scalar>& field1,
const List<scalar>& field2,
const bool perNode = false
) const;
//- Write generalized field components //- Write generalized field components
// optionally write data per node // optionally write data per node
template<class Type> template<class Type>
......
...@@ -213,78 +213,6 @@ void Foam::ensightPart::writeGeometry ...@@ -213,78 +213,6 @@ void Foam::ensightPart::writeGeometry
} }
void Foam::ensightPart::writeScalarField
(
ensightFile& os,
const List<scalar>& field,
const bool perNode
) const
{
if (size() && field.size() && (os.allowUndef() || isFieldDefined(field)))
{
writeHeader(os);
if (perNode)
{
os.writeKeyword("coordinates");
writeFieldList(os, field, labelUList::null());
}
else
{
forAll(elementTypes(), elemI)
{
const labelUList& idList = elemLists_[elemI];
if (idList.size())
{
os.writeKeyword(elementTypes()[elemI]);
writeFieldList(os, field, idList);
}
}
}
}
}
void Foam::ensightPart::writeVectorField
(
ensightFile& os,
const List<scalar>& field0,
const List<scalar>& field1,
const List<scalar>& field2,
const bool perNode
) const
{
if (size() && field0.size() && (os.allowUndef() || isFieldDefined(field0)))
{
writeHeader(os);
if (perNode)
{
os.writeKeyword("coordinates");
writeFieldList(os, field0, labelUList::null());
writeFieldList(os, field1, labelUList::null());
writeFieldList(os, field2, labelUList::null());
}
else
{
forAll(elementTypes(), elemI)
{
const labelUList& idList = elemLists_[elemI];
if (idList.size())
{
os.writeKeyword(elementTypes()[elemI]);
writeFieldList(os, field0, idList);
writeFieldList(os, field1, idList);
writeFieldList(os, field2, idList);
}
}
}
}
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<<
......
...@@ -225,59 +225,6 @@ void Foam::ensightParts::writeData(Ostream& os) const ...@@ -225,59 +225,6 @@ void Foam::ensightParts::writeData(Ostream& os) const
} }
void Foam::ensightParts::writeScalarField
(
ensightFile& os,
const List<scalar>& field,
const bool useFaceData,
const bool perNode
) const
{
forAll(partsList_, partI)
{
if
(
useFaceData
? partsList_[partI].isFaceData()
: partsList_[partI].isCellData()
)
{
partsList_[partI].writeScalarField(os, field, perNode);
}
}
}
void Foam::ensightParts::writeVectorField
(
ensightFile& os,
const List<scalar>& field0,
const List<scalar>& field1,
const List<scalar>& field2,
const bool useFaceData,
const bool perNode
) const
{
forAll(partsList_, partI)
{
if
(
useFaceData
? partsList_[partI].isFaceData()
: partsList_[partI].isCellData()
)
{
partsList_[partI].writeVectorField
(
os,
field0, field1, field2,
perNode
);
}
}
}
// * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * // // * * * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * //
Foam::ensightGeoFile& Foam::operator<< Foam::ensightGeoFile& Foam::operator<<
......
...@@ -108,31 +108,6 @@ public: ...@@ -108,31 +108,6 @@ public:
//- Write the lists //- Write the lists
void writeData(Ostream&) const; void writeData(Ostream&) const;
//- Write (volume) scalar field
// optionally write data for face parts
// optionally write data per node
void writeScalarField
(
ensightFile&,
const List<scalar>& field,
const bool useFaceData = false,
const bool perNode = false
) const;
//- Write (volume) vector field components
// optionally write data for face parts
// optionally write data per node
void writeVectorField
(
ensightFile&,
const List<scalar>& field0,
const List<scalar>& field1,
const List<scalar>& field2,
const bool useFaceData = false,
const bool perNode = false
) const;
//- Write generalized volume field components //- Write generalized volume field components
template<class Type> template<class Type>
void writeField void writeField
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment