diff --git a/src/conversion/ensight/file/ensightGeoFile.C b/src/conversion/ensight/file/ensightGeoFile.C index c52aa79356a3270bc85ba9d1c04b1a7614262954..0119087e70f9dd17f8c009991a02ed20eeb88d92 100644 --- a/src/conversion/ensight/file/ensightGeoFile.C +++ b/src/conversion/ensight/file/ensightGeoFile.C @@ -24,14 +24,26 @@ License \*---------------------------------------------------------------------------*/ #include "ensightGeoFile.H" +#include "foamVersion.H" + +// Macros to stringify macro contents. +#define STRINGIFY(content) #content +#define STRING_QUOTE(input) STRINGIFY(input) + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // 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(); 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("element id assign"); newline(); } diff --git a/src/conversion/ensight/part/ensightPart.H b/src/conversion/ensight/part/ensightPart.H index feb6d371baf023b37d50b5ee2f1c03e68586fd31..f48d626ae422c1abd2a41a142267c208c679fcae 100644 --- a/src/conversion/ensight/part/ensightPart.H +++ b/src/conversion/ensight/part/ensightPart.H @@ -303,27 +303,6 @@ public: //- Helper: write geometry given the pointField 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 // optionally write data per node template<class Type> diff --git a/src/conversion/ensight/part/ensightPartIO.C b/src/conversion/ensight/part/ensightPartIO.C index 1457ff46c3670b365f96909e2e6e9df0c509674e..4e21d6dd62b8bfbea7d8caeadab33267f3455632 100644 --- a/src/conversion/ensight/part/ensightPartIO.C +++ b/src/conversion/ensight/part/ensightPartIO.C @@ -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 * * * * * * * * * * * * // Foam::Ostream& Foam::operator<< diff --git a/src/conversion/ensight/part/ensightParts.C b/src/conversion/ensight/part/ensightParts.C index a7675bf4839c3fb428f3ec8b4532e06ac021a919..1ad472966422766be94551af78fb2360521398e7 100644 --- a/src/conversion/ensight/part/ensightParts.C +++ b/src/conversion/ensight/part/ensightParts.C @@ -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 * * * * * * * * * * * // Foam::ensightGeoFile& Foam::operator<< diff --git a/src/conversion/ensight/part/ensightParts.H b/src/conversion/ensight/part/ensightParts.H index 68c18774bab8d528a8d2e055a243951c01753e47..76712b9447bf31542b831c36471628a0cbb68c8a 100644 --- a/src/conversion/ensight/part/ensightParts.H +++ b/src/conversion/ensight/part/ensightParts.H @@ -108,31 +108,6 @@ public: //- Write the lists 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 template<class Type> void writeField