diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index 2649cc1e4e..c340aedb17 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -166,10 +166,10 @@ int main(int argc, char *argv[]) Info<< "Time = " << runTime.timeName() << endl; // Convert all the standard mesh files - writeMeshObject("cells", meshDir, runTime); + writeMeshObject("cells", meshDir, runTime); writeMeshObject("owner", meshDir, runTime); writeMeshObject("neighbour", meshDir, runTime); - writeMeshObject("faces", meshDir, runTime); + writeMeshObject("faces", meshDir, runTime); writeMeshObject("points", meshDir, runTime); writeMeshObject("pointProcAddressing", meshDir, runTime); writeMeshObject("faceProcAddressing", meshDir, runTime); diff --git a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.C b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C similarity index 87% rename from src/OpenFOAM/db/IOobjects/IOListList/IOListList.C rename to src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C index 0f1b320195..ac21a5e4c5 100644 --- a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.C +++ b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.C @@ -23,13 +23,13 @@ License \*---------------------------------------------------------------------------*/ -#include "IOListList.H" +#include "CompactIOList.H" #include "labelList.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template -void Foam::IOListList::readFromStream() +void Foam::CompactIOList::readFromStream() { Istream& is = readStream(word::null); @@ -47,7 +47,7 @@ void Foam::IOListList::readFromStream() { FatalIOErrorIn ( - "IOListList::readFromStream()", + "CompactIOList::readFromStream()", is ) << "unexpected class name " << headerClassName() << " expected " << typeName << " or " << IOList::typeName @@ -61,7 +61,7 @@ void Foam::IOListList::readFromStream() // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // template -Foam::IOListList::IOListList(const IOobject& io) +Foam::CompactIOList::CompactIOList(const IOobject& io) : regIOobject(io) { @@ -77,7 +77,11 @@ Foam::IOListList::IOListList(const IOobject& io) template -Foam::IOListList::IOListList(const IOobject& io, const label size) +Foam::CompactIOList::CompactIOList +( + const IOobject& io, + const label size +) : regIOobject(io) { @@ -97,7 +101,7 @@ Foam::IOListList::IOListList(const IOobject& io, const label size) template -Foam::IOListList::IOListList +Foam::CompactIOList::CompactIOList ( const IOobject& io, const List& list @@ -121,7 +125,7 @@ Foam::IOListList::IOListList template -Foam::IOListList::IOListList +Foam::CompactIOList::CompactIOList ( const IOobject& io, const Xfer >& list @@ -145,7 +149,7 @@ Foam::IOListList::IOListList // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // template -Foam::IOListList::~IOListList() +Foam::CompactIOList::~CompactIOList() {} @@ -153,7 +157,7 @@ Foam::IOListList::~IOListList() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -bool Foam::IOListList::writeObject +bool Foam::CompactIOList::writeObject ( IOstream::streamFormat fmt, IOstream::versionNumber ver, @@ -182,7 +186,7 @@ bool Foam::IOListList::writeObject template -bool Foam::IOListList::writeData(Ostream& os) const +bool Foam::CompactIOList::writeData(Ostream& os) const { return (os << *this).good(); } @@ -191,9 +195,9 @@ bool Foam::IOListList::writeData(Ostream& os) const // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // template -void Foam::IOListList::operator= +void Foam::CompactIOList::operator= ( - const IOListList& rhs + const CompactIOList& rhs ) { List::operator=(rhs); @@ -201,7 +205,7 @@ void Foam::IOListList::operator= template -void Foam::IOListList::operator=(const List& rhs) +void Foam::CompactIOList::operator=(const List& rhs) { List::operator=(rhs); } @@ -213,7 +217,7 @@ template Foam::Istream& Foam::operator>> ( Foam::Istream& is, - Foam::IOListList& L + Foam::CompactIOList& L ) { // Read compact @@ -244,7 +248,7 @@ template Foam::Ostream& Foam::operator<< ( Foam::Ostream& os, - const Foam::IOListList& L + const Foam::CompactIOList& L ) { // Keep ascii writing same. diff --git a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.H b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.H similarity index 76% rename from src/OpenFOAM/db/IOobjects/IOListList/IOListList.H rename to src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.H index b5bd103183..e4a85ef118 100644 --- a/src/OpenFOAM/db/IOobjects/IOListList/IOListList.H +++ b/src/OpenFOAM/db/IOobjects/CompactIOList/CompactIOList.H @@ -22,18 +22,22 @@ License along with OpenFOAM. If not, see . Class - Foam::IOListList + Foam::CompactIOList Description - A List of objects of type \ with automated input and output. + A List of objects of type \ with automated input and output using + a compact storage. Behaves like IOList except when binary output in + case it writes a CompactListList. + + Useful for lists of small sublists e.g. faceList, cellList. SourceFiles - IOListList.C + CompactIOList.C \*---------------------------------------------------------------------------*/ -#ifndef IOListList_H -#define IOListList_H +#ifndef CompactIOList_H +#define CompactIOList_H #include "IOList.H" #include "regIOobject.H" @@ -47,25 +51,25 @@ class Istream; class Ostream; // Forward declaration of friend functions and operators -template class IOListList; +template class CompactIOList; template Istream& operator>> ( Istream&, - IOListList& + CompactIOList& ); template Ostream& operator<< ( Ostream&, - const IOListList& + const CompactIOList& ); /*---------------------------------------------------------------------------*\ - Class IOListList Declaration + Class CompactIOList Declaration \*---------------------------------------------------------------------------*/ template -class IOListList +class CompactIOList : public regIOobject, public List @@ -78,27 +82,27 @@ class IOListList public: //- Runtime type information - TypeName("ListList"); + TypeName("CompactList"); // Constructors //- Construct from IOobject - IOListList(const IOobject&); + CompactIOList(const IOobject&); - //- Construct from IOobject and size of IOListList - IOListList(const IOobject&, const label); + //- Construct from IOobject and size of CompactIOList + CompactIOList(const IOobject&, const label); //- Construct from IOobject and a List - IOListList(const IOobject&, const List&); + CompactIOList(const IOobject&, const List&); //- Construct by transferring the List contents - IOListList(const IOobject&, const Xfer >&); + CompactIOList(const IOobject&, const Xfer >&); // Destructor - virtual ~IOListList(); + virtual ~CompactIOList(); // Member functions @@ -115,7 +119,7 @@ public: // Member operators - void operator=(const IOListList&); + void operator=(const CompactIOList&); void operator=(const List&); @@ -126,14 +130,14 @@ public: friend Istream& operator>> ( Istream&, - IOListList& + CompactIOList& ); // Write List to Ostream. friend Ostream& operator<< ( Ostream&, - const IOListList& + const CompactIOList& ); }; @@ -145,7 +149,7 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "IOListList.C" +# include "CompactIOList.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C index 6a6aa29de2..46203004a6 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C +++ b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.C @@ -35,7 +35,8 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - defineTemplateTypeNameAndDebugWithName(cellIOList, "cellList", 0); +defineTemplateTypeNameAndDebugWithName(cellIOList, "cellList", 0); +defineTemplateTypeNameAndDebugWithName(cellCompactIOList, "cellCompactList", 0); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H index 194c682482..9db59238d2 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H +++ b/src/OpenFOAM/meshes/meshShapes/cell/cellIOList.H @@ -33,13 +33,14 @@ Description #define cellIOList_H #include "cell.H" -#include "IOList.H" +#include "CompactIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef IOList cellIOList; + typedef CompactIOList cellCompactIOList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C index 4dd508f0ee..a4fc4e91fc 100644 --- a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C +++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.C @@ -33,10 +33,14 @@ Description namespace Foam { - defineCompoundTypeName(List, edgeList); - addCompoundToRunTimeSelectionTable(List, edgeList); - defineTemplateTypeNameAndDebugWithName(edgeIOList, "edgeList", 0); +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +defineCompoundTypeName(List, edgeList); +addCompoundToRunTimeSelectionTable(List, edgeList); + +defineTemplateTypeNameAndDebugWithName(edgeIOList, "edgeList", 0); +defineTemplateTypeNameAndDebugWithName(edgeCompactIOList, "edgeCompactList", 0); } // ************************************************************************* // diff --git a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H index 6c4d1f9287..fa3659913f 100644 --- a/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H +++ b/src/OpenFOAM/meshes/meshShapes/edge/edgeIOList.H @@ -33,13 +33,14 @@ Description #define edgeIOList_H #include "edge.H" -#include "IOList.H" +#include "CompactIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef IOList edgeIOList; + typedef CompactIOList edgeCompactIOList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C index 5ce764bd14..212ac9ca17 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C +++ b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.C @@ -36,6 +36,12 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTemplateTypeNameAndDebugWithName(faceIOList, "faceList", 0); +defineTemplateTypeNameAndDebugWithName +( + faceCompactIOList, + "faceCompactList", + 0 +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H index 58874198a0..0422f52470 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H +++ b/src/OpenFOAM/meshes/meshShapes/face/faceIOList.H @@ -33,13 +33,14 @@ Description #define faceIOList_H #include "face.H" -#include "IOList.H" +#include "CompactIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef IOList faceIOList; + typedef CompactIOList faceCompactIOList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 668320e1d6..ab72d6d446 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -272,7 +272,7 @@ Foam::polyMesh::polyMesh(const IOobject& io) } else { - cellIOList cLst + cellCompactIOList cLst ( IOobject ( diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H index a100a358e1..62df97511c 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H @@ -101,7 +101,7 @@ private: pointIOField points_; //- Faces - faceIOList faces_; + faceCompactIOList faces_; //- Face owner labelIOList owner_; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C index 757f174588..8e50f8033e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C @@ -112,7 +112,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate() ) ); - faces_ = faceIOList + faces_ = faceCompactIOList ( IOobject ( @@ -238,7 +238,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate() } else { - cellIOList cells + cellCompactIOList cells ( IOobject ( diff --git a/src/OpenFOAM/primitives/Lists/labelListIOList.C b/src/OpenFOAM/primitives/Lists/labelListIOList.C index 72ebc51588..0e131a3b0a 100644 --- a/src/OpenFOAM/primitives/Lists/labelListIOList.C +++ b/src/OpenFOAM/primitives/Lists/labelListIOList.C @@ -21,10 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Declaration of IOList and IOListList ClassNames for IOListLists that - do not have .C files. - \*---------------------------------------------------------------------------*/ #include "labelListIOList.H" @@ -38,8 +34,8 @@ namespace Foam defineTemplateTypeNameAndDebugWithName ( - labelIOListList, - "labelCompactListList", + labelListCompactIOList, + "labelListCompactList", 0 ); } diff --git a/src/OpenFOAM/primitives/Lists/labelListIOList.H b/src/OpenFOAM/primitives/Lists/labelListIOList.H index aebd4fc4aa..90cd61e238 100644 --- a/src/OpenFOAM/primitives/Lists/labelListIOList.H +++ b/src/OpenFOAM/primitives/Lists/labelListIOList.H @@ -33,15 +33,14 @@ Description #define labelListIOList_H #include "labelList.H" -#include "IOList.H" -#include "IOListList.H" +#include "CompactIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef IOList labelListIOList; - typedef IOListList labelIOListList; + typedef CompactIOList labelListCompactIOList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Lists/scalarListIOList.C b/src/OpenFOAM/primitives/Lists/scalarListIOList.C index effb61127e..84df4520cc 100644 --- a/src/OpenFOAM/primitives/Lists/scalarListIOList.C +++ b/src/OpenFOAM/primitives/Lists/scalarListIOList.C @@ -21,10 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Declaration of IOList and IOListList ClassNames for IOListLists that - do not have .C files. - \*---------------------------------------------------------------------------*/ #include "scalarListIOList.H" @@ -43,8 +39,8 @@ namespace Foam defineTemplateTypeNameAndDebugWithName ( - scalarIOListList, - "scalarCompactListList", + scalarListCompactIOList, + "scalarListCompactList", 0 ); } diff --git a/src/OpenFOAM/primitives/Lists/scalarListIOList.H b/src/OpenFOAM/primitives/Lists/scalarListIOList.H index 24dc8e13fb..99e2fdf69a 100644 --- a/src/OpenFOAM/primitives/Lists/scalarListIOList.H +++ b/src/OpenFOAM/primitives/Lists/scalarListIOList.H @@ -33,15 +33,14 @@ Description #define scalarListIOList_H #include "scalarList.H" -#include "IOList.H" -#include "IOListList.H" +#include "CompactIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef IOList scalarListIOList; - typedef IOListList scalarIOListList; + typedef CompactIOList scalarListCompactIOList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/Lists/vectorListIOList.C b/src/OpenFOAM/primitives/Lists/vectorListIOList.C index 661f729410..fa73bde4d5 100644 --- a/src/OpenFOAM/primitives/Lists/vectorListIOList.C +++ b/src/OpenFOAM/primitives/Lists/vectorListIOList.C @@ -21,10 +21,6 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . -Description - Declaration of IOList and IOListList ClassNames for IOListLists that - do not have .C files. - \*---------------------------------------------------------------------------*/ #include "vectorListIOList.H" @@ -43,8 +39,8 @@ namespace Foam defineTemplateTypeNameAndDebugWithName ( - vectorIOListList, - "vectorCompactListList", + vectorListCompactIOList, + "vectorListCompactList", 0 ); } diff --git a/src/OpenFOAM/primitives/Lists/vectorListIOList.H b/src/OpenFOAM/primitives/Lists/vectorListIOList.H index 53acf8afb0..299882f5b5 100644 --- a/src/OpenFOAM/primitives/Lists/vectorListIOList.H +++ b/src/OpenFOAM/primitives/Lists/vectorListIOList.H @@ -25,7 +25,7 @@ Typedef Foam::vectorListIOList Description - Scalar container classes + Lists of vectors container class \*---------------------------------------------------------------------------*/ @@ -33,15 +33,14 @@ Description #define vectorListIOList_H #include "vectorList.H" -#include "IOList.H" -#include "IOListList.H" +#include "CompactIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { typedef IOList vectorListIOList; - typedef IOListList vectorIOListList; + typedef CompactIOList vectorListCompactIOList; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H index bf97ae0501..716d0c88e7 100644 --- a/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H +++ b/src/surfMesh/MeshedSurfaceAllocator/MeshedSurfaceIOAllocator.H @@ -56,7 +56,7 @@ class MeshedSurfaceIOAllocator pointIOField points_; //- Faces - faceIOList faces_; + faceCompactIOList faces_; //- Surface zones surfZoneIOList zones_; @@ -117,7 +117,7 @@ public: } //- Non-const access to the faces - faceIOList& storedIOFaces() + faceCompactIOList& storedIOFaces() { return faces_; } @@ -135,7 +135,7 @@ public: } //- Const access to the faces - const faceIOList& storedIOFaces() const + const faceCompactIOList& storedIOFaces() const { return faces_; } diff --git a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C index efe336e792..b2cf9e26cd 100644 --- a/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C +++ b/src/surfMesh/MeshedSurfaceProxy/MeshedSurfaceProxy.C @@ -150,7 +150,7 @@ void Foam::MeshedSurfaceProxy::write // write surfMesh/faces { - faceIOList io + faceCompactIOList io ( IOobject ( diff --git a/src/surfMesh/surfMesh/surfMesh.C b/src/surfMesh/surfMesh/surfMesh.C index bd2f355c2f..b07673305c 100644 --- a/src/surfMesh/surfMesh/surfMesh.C +++ b/src/surfMesh/surfMesh/surfMesh.C @@ -27,8 +27,6 @@ License #include "MeshedSurfaceProxy.H" #include "Time.H" -#include "cellIOList.H" -#include "SubList.H" #include "OSspecific.H" #include "MeshedSurface.H" #include "demandDrivenData.H" diff --git a/src/surfMesh/surfMesh/surfMeshIO.C b/src/surfMesh/surfMesh/surfMeshIO.C index e0581d52d3..b581951beb 100644 --- a/src/surfMesh/surfMesh/surfMeshIO.C +++ b/src/surfMesh/surfMesh/surfMeshIO.C @@ -98,7 +98,7 @@ Foam::surfMesh::readUpdateState Foam::surfMesh::readUpdate() ) ); - storedFaces() = faceIOList + storedFaces() = faceCompactIOList ( IOobject (