Commit ed67d5be authored by mattijs's avatar mattijs
Browse files

STYLE: renamed IOFieldField to CompactIOField to be consistent with CompactIOList.

parent 0ebecd2d
......@@ -402,17 +402,17 @@ int main(int argc, char *argv[])
PtrList< List<SLList<indexedParticle*>*> > cellParticles(cloudDirs.size());
PtrList<PtrList<labelIOField> > lagrangianLabelFields(cloudDirs.size());
PtrList<PtrList<labelIOFieldField> > lagrangianLabelFieldFields
PtrList<PtrList<labelFieldCompactIOField> > lagrangianLabelFieldFields
(
cloudDirs.size()
);
PtrList<PtrList<scalarIOField> > lagrangianScalarFields(cloudDirs.size());
PtrList<PtrList<scalarIOFieldField> > lagrangianScalarFieldFields
PtrList<PtrList<scalarFieldCompactIOField> > lagrangianScalarFieldFields
(
cloudDirs.size()
);
PtrList<PtrList<vectorIOField> > lagrangianVectorFields(cloudDirs.size());
PtrList<PtrList<vectorIOFieldField> > lagrangianVectorFieldFields
PtrList<PtrList<vectorFieldCompactIOField> > lagrangianVectorFieldFields
(
cloudDirs.size()
);
......@@ -420,13 +420,14 @@ int main(int argc, char *argv[])
(
cloudDirs.size()
);
PtrList<PtrList<sphericalTensorIOFieldField> >
PtrList<PtrList<sphericalTensorFieldCompactIOField> >
lagrangianSphericalTensorFieldFields(cloudDirs.size());
PtrList<PtrList<symmTensorIOField> > lagrangianSymmTensorFields
(
cloudDirs.size()
);
PtrList<PtrList<symmTensorIOFieldField> > lagrangianSymmTensorFieldFields
PtrList<PtrList<symmTensorFieldCompactIOField> >
lagrangianSymmTensorFieldFields
(
cloudDirs.size()
);
......@@ -434,7 +435,7 @@ int main(int argc, char *argv[])
(
cloudDirs.size()
);
PtrList<PtrList<tensorIOFieldField> > lagrangianTensorFieldFields
PtrList<PtrList<tensorFieldCompactIOField> > lagrangianTensorFieldFields
(
cloudDirs.size()
);
......
......@@ -37,7 +37,7 @@ SourceFiles
#define lagrangianFieldDecomposer_H
#include "Cloud.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
#include "indexedParticle.H"
#include "passiveParticle.H"
......@@ -111,9 +111,9 @@ public:
const IOobjectList& lagrangianObjects,
PtrList
<
PtrList<IOFieldField<Field<Type>, Type> >
PtrList<CompactIOField<Field<Type>, Type> >
>& lagrangianFields
// PtrList<IOFieldField<Field<Type>, Type > >& lagrangianFields
// PtrList<CompactIOField<Field<Type>, Type > >& lagrangianFields
);
......@@ -126,10 +126,10 @@ public:
) const;
template<class Type>
tmp<IOFieldField<Field<Type>, Type> > decomposeFieldField
tmp<CompactIOField<Field<Type>, Type> > decomposeFieldField
(
const word& cloudName,
const IOFieldField<Field<Type>, Type>& field
const CompactIOField<Field<Type>, Type>& field
) const;
......
......@@ -68,7 +68,7 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
(
const label cloudI,
const IOobjectList& lagrangianObjects,
PtrList<PtrList<IOFieldField<Field<Type>, Type> > >& lagrangianFields
PtrList<PtrList<CompactIOField<Field<Type>, Type> > >& lagrangianFields
)
{
// Search list of objects for lagrangian fields
......@@ -79,13 +79,17 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
IOobjectList lagrangianTypeObjectsB
(
lagrangianObjects.lookupClass(IOFieldField<Field<Type>, Type>::typeName)
lagrangianObjects.lookupClass
(
CompactIOField<Field<Type>,
Type>::typeName
)
);
lagrangianFields.set
(
cloudI,
new PtrList<IOFieldField<Field<Type>, Type> >
new PtrList<CompactIOField<Field<Type>, Type> >
(
lagrangianTypeObjectsA.size() + lagrangianTypeObjectsB.size()
)
......@@ -98,7 +102,7 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
lagrangianFields[cloudI].set
(
lagrangianFieldi++,
new IOFieldField<Field<Type>, Type>(*iter())
new CompactIOField<Field<Type>, Type>(*iter())
);
}
......@@ -107,7 +111,7 @@ void Foam::lagrangianFieldDecomposer::readFieldFields
lagrangianFields[cloudI].set
(
lagrangianFieldi++,
new IOFieldField<Field<Type>, Type>(*iter())
new CompactIOField<Field<Type>, Type>(*iter())
);
}
}
......@@ -145,20 +149,20 @@ Foam::lagrangianFieldDecomposer::decomposeField
template<class Type>
Foam::tmp<Foam::IOFieldField<Foam::Field<Type>, Type> >
Foam::tmp<Foam::CompactIOField<Foam::Field<Type>, Type> >
Foam::lagrangianFieldDecomposer::decomposeFieldField
(
const word& cloudName,
const IOFieldField<Field<Type>, Type>& field
const CompactIOField<Field<Type>, Type>& field
) const
{
// Create and map the internal field values
Field<Field<Type> > procField(field, particleIndices_);
// Create the field for the processor
return tmp<IOFieldField<Field<Type>, Type> >
return tmp<CompactIOField<Field<Type>, Type> >
(
new IOFieldField<Field<Type>, Type>
new CompactIOField<Field<Type>, Type>
(
IOobject
(
......
......@@ -37,7 +37,7 @@ Description
#include "GeometricField.H"
#include "meshToMesh.H"
#include "IOobjectList.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -106,9 +106,9 @@ void MapLagrangianFields
// Read field (does not need mesh)
IOField<Field<Type> > fieldSource(*fieldIter());
// Map - use IOFieldField to automatically write in
// Map - use CompactIOField to automatically write in
// compact form for binary format.
IOFieldField<Field<Type>, Type> fieldTarget
CompactIOField<Field<Type>, Type> fieldTarget
(
IOobject
(
......@@ -135,7 +135,7 @@ void MapLagrangianFields
{
IOobjectList fieldFields =
objects.lookupClass(IOFieldField<Field<Type>, Type>::typeName);
objects.lookupClass(CompactIOField<Field<Type>, Type>::typeName);
forAllIter(IOobjectList, fieldFields, fieldIter)
{
......@@ -143,10 +143,10 @@ void MapLagrangianFields
<< fieldIter()->name() << endl;
// Read field (does not need mesh)
IOFieldField<Field<Type>, Type> fieldSource(*fieldIter());
CompactIOField<Field<Type>, Type> fieldSource(*fieldIter());
// Map
IOFieldField<Field<Type>, Type> fieldTarget
CompactIOField<Field<Type>, Type> fieldTarget
(
IOobject
(
......
......@@ -23,13 +23,13 @@ License
\*---------------------------------------------------------------------------*/
#include "IOFieldField.H"
#include "CompactIOField.H"
#include "labelList.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::IOFieldField<T, BaseType>::readFromStream()
void Foam::CompactIOField<T, BaseType>::readFromStream()
{
Istream& is = readStream(word::null);
......@@ -47,7 +47,7 @@ void Foam::IOFieldField<T, BaseType>::readFromStream()
{
FatalIOErrorIn
(
"IOFieldField<T, BaseType>::readFromStream()",
"CompactIOField<T, BaseType>::readFromStream()",
is
) << "unexpected class name " << headerClassName()
<< " expected " << typeName << " or " << IOField<T>::typeName
......@@ -61,7 +61,7 @@ void Foam::IOFieldField<T, BaseType>::readFromStream()
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField(const IOobject& io)
Foam::CompactIOField<T, BaseType>::CompactIOField(const IOobject& io)
:
regIOobject(io)
{
......@@ -77,7 +77,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField(const IOobject& io)
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField
Foam::CompactIOField<T, BaseType>::CompactIOField
(
const IOobject& io,
const label size
......@@ -101,7 +101,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField
Foam::CompactIOField<T, BaseType>::CompactIOField
(
const IOobject& io,
const Field<T>& list
......@@ -125,7 +125,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::IOFieldField
Foam::CompactIOField<T, BaseType>::CompactIOField
(
const IOobject& io,
const Xfer<Field<T> >& list
......@@ -149,7 +149,7 @@ Foam::IOFieldField<T, BaseType>::IOFieldField
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
template<class T, class BaseType>
Foam::IOFieldField<T, BaseType>::~IOFieldField()
Foam::CompactIOField<T, BaseType>::~CompactIOField()
{}
......@@ -157,7 +157,7 @@ Foam::IOFieldField<T, BaseType>::~IOFieldField()
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class T, class BaseType>
bool Foam::IOFieldField<T, BaseType>::writeObject
bool Foam::CompactIOField<T, BaseType>::writeObject
(
IOstream::streamFormat fmt,
IOstream::versionNumber ver,
......@@ -186,7 +186,7 @@ bool Foam::IOFieldField<T, BaseType>::writeObject
template<class T, class BaseType>
bool Foam::IOFieldField<T, BaseType>::writeData(Ostream& os) const
bool Foam::CompactIOField<T, BaseType>::writeData(Ostream& os) const
{
return (os << *this).good();
}
......@@ -195,9 +195,9 @@ bool Foam::IOFieldField<T, BaseType>::writeData(Ostream& os) const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class T, class BaseType>
void Foam::IOFieldField<T, BaseType>::operator=
void Foam::CompactIOField<T, BaseType>::operator=
(
const IOFieldField<T, BaseType>& rhs
const CompactIOField<T, BaseType>& rhs
)
{
Field<T>::operator=(rhs);
......@@ -205,7 +205,7 @@ void Foam::IOFieldField<T, BaseType>::operator=
template<class T, class BaseType>
void Foam::IOFieldField<T, BaseType>::operator=(const Field<T>& rhs)
void Foam::CompactIOField<T, BaseType>::operator=(const Field<T>& rhs)
{
Field<T>::operator=(rhs);
}
......@@ -217,7 +217,7 @@ template<class T, class BaseType>
Foam::Istream& Foam::operator>>
(
Foam::Istream& is,
Foam::IOFieldField<T, BaseType>& L
Foam::CompactIOField<T, BaseType>& L
)
{
// Read compact
......@@ -248,7 +248,7 @@ template<class T, class BaseType>
Foam::Ostream& Foam::operator<<
(
Foam::Ostream& os,
const Foam::IOFieldField<T, BaseType>& L
const Foam::CompactIOField<T, BaseType>& L
)
{
// Keep ascii writing same.
......
......@@ -22,18 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::IOFieldField
Foam::CompactIOField
Description
A Field of objects of type \<T\> with automated input and output.
A Field of objects of type \<T\> with automated input and output using
a compact storage. Behaves like IOField except when binary output in
case it writes a CompactListList.
Useful for fields of small subfields e.g. in lagrangian
SourceFiles
IOFieldField.C
CompactIOField.C
\*---------------------------------------------------------------------------*/
#ifndef IOFieldField_H
#define IOFieldField_H
#ifndef CompactIOField_H
#define CompactIOField_H
#include "IOField.H"
#include "regIOobject.H"
......@@ -47,25 +51,25 @@ class Istream;
class Ostream;
// Forward declaration of friend functions and operators
template<class T, class BaseType> class IOFieldField;
template<class T, class BaseType> class CompactIOField;
template<class T, class BaseType> Istream& operator>>
(
Istream&,
IOFieldField<T, BaseType>&
CompactIOField<T, BaseType>&
);
template<class T, class BaseType> Ostream& operator<<
(
Ostream&,
const IOFieldField<T, BaseType>&
const CompactIOField<T, BaseType>&
);
/*---------------------------------------------------------------------------*\
Class IOFieldField Declaration
Class CompactIOField Declaration
\*---------------------------------------------------------------------------*/
template<class T, class BaseType>
class IOFieldField
class CompactIOField
:
public regIOobject,
public Field<T>
......@@ -84,21 +88,21 @@ public:
// Constructors
//- Construct from IOobject
IOFieldField(const IOobject&);
CompactIOField(const IOobject&);
//- Construct from IOobject and size of IOFieldField
IOFieldField(const IOobject&, const label);
//- Construct from IOobject and size
CompactIOField(const IOobject&, const label);
//- Construct from IOobject and a Field
IOFieldField(const IOobject&, const Field<T>&);
CompactIOField(const IOobject&, const Field<T>&);
//- Construct by transferring the Field contents
IOFieldField(const IOobject&, const Xfer<Field<T> >&);
CompactIOField(const IOobject&, const Xfer<Field<T> >&);
// Destructor
virtual ~IOFieldField();
virtual ~CompactIOField();
// Member functions
......@@ -115,7 +119,7 @@ public:
// Member operators
void operator=(const IOFieldField<T, BaseType>&);
void operator=(const CompactIOField<T, BaseType>&);
void operator=(const Field<T>&);
......@@ -126,14 +130,14 @@ public:
friend Istream& operator>> <T, BaseType>
(
Istream&,
IOFieldField<T, BaseType>&
CompactIOField<T, BaseType>&
);
// Write Field to Ostream.
friend Ostream& operator<< <T, BaseType>
(
Ostream&,
const IOFieldField<T, BaseType>&
const CompactIOField<T, BaseType>&
);
};
......@@ -145,7 +149,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "IOFieldField.C"
# include "CompactIOField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -41,8 +41,8 @@ namespace Foam
defineTemplateTypeNameAndDebugWithName
(
diagTensorIOFieldField,
"diagTensorCompactFieldField",
diagTensorFieldCompactIOField,
"diagTensorFieldCompactField",
0
);
}
......
......@@ -33,15 +33,15 @@ Description
#define diagTensorFieldIOField_H
#include "diagTensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<diagTensorField> diagTensorFieldIOField;
typedef IOFieldField<diagTensorField, diagTensor> diagTensorIOFieldField;
typedef CompactIOField<diagTensorField, diagTensor>
diagTensorFieldCompactIOField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -41,8 +41,8 @@ namespace Foam
defineTemplateTypeNameAndDebugWithName
(
labelIOFieldField,
"labelCompactFieldField",
labelFieldCompactIOField,
"labelFieldCompactField",
0
);
}
......
......@@ -34,14 +34,14 @@ Description
#include "labelField.H"
#include "IOField.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<labelField> labelFieldIOField;
typedef IOFieldField<labelField, label> labelIOFieldField;
typedef CompactIOField<labelField, label> labelFieldCompactIOField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -41,8 +41,8 @@ namespace Foam
defineTemplateTypeNameAndDebugWithName
(
scalarIOFieldField,
"scalarCompactFieldField",
scalarFieldCompactIOField,
"scalarFieldCompactField",
0
);
}
......
......@@ -33,15 +33,14 @@ Description
#define scalarFieldIOField_H
#include "scalarField.H"
#include "IOField.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<scalarField> scalarFieldIOField;
typedef IOFieldField<scalarField, scalar> scalarIOFieldField;
typedef CompactIOField<scalarField, scalar> scalarFieldCompactIOField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -41,8 +41,8 @@ namespace Foam
defineTemplateTypeNameAndDebugWithName
(
sphericalTensorIOFieldField,
"sphericalTensorCompactFieldField",
sphericalTensorFieldCompactIOField,
"sphericalTensorFieldCompactField",
0
);
}
......
......@@ -33,8 +33,7 @@ Description
#define sphericalTensorFieldIOField_H
#include "sphericalTensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -42,8 +41,8 @@ namespace Foam
{
typedef IOField<sphericalTensorField> sphericalTensorFieldIOField;
typedef IOFieldField<sphericalTensorField, sphericalTensor>
sphericalTensorIOFieldField;
typedef CompactIOField<sphericalTensorField, sphericalTensor>
sphericalTensorFieldCompactIOField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......
......@@ -41,8 +41,8 @@ namespace Foam
defineTemplateTypeNameAndDebugWithName
(
symmTensorIOFieldField,
"symmTensorCompactFieldField",
symmTensorFieldCompactIOField,
"symmTensorFieldCompactField",
0
);
}
......
......@@ -33,15 +33,15 @@ Description
#define symmTensorFieldIOField_H
#include "symmTensorField.H"
#include "IOField.H"
#include "IOFieldField.H"
#include "CompactIOField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
typedef IOField<symmTensorField> symmTensorFieldIOField;
typedef IOFieldField<symmTensorField, symmTensor> symmTensorIOFieldField;
typedef CompactIOField<symmTensorField, symmTensor>
symmTensorFieldCompactIOField;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......