DEFEATURE: pointer dereferencing for HashTable iterator

- this largely reverts 3f0f218d88 and 4ee65d12c4.

  Consistent addressing with support for wrapped pointer types (eg,
  autoPtr, std::unique_ptr) has proven to be less robust than desired.
  Thus rescind HashTable iterator '->' dereferencing (from APR-2019).
This commit is contained in:
Mark Olesen
2019-09-27 19:45:54 +02:00
committed by Andrew Heather
parent fc461a1cc6
commit b6bf9129f6
20 changed files with 112 additions and 159 deletions

View File

@ -174,8 +174,7 @@ int main(int argc, char *argv[])
Info<< "have " << k << nl
<< " addr: " << name(*iter) << nl
<< " info: " << (*iter)->info() << nl
<< " info: " << iter->info() << nl
<< " incr: " << iter->increment() << nl
<< " incr: " << (*iter)->increment() << nl
;
}
@ -185,7 +184,6 @@ int main(int argc, char *argv[])
{
Info<< "have " << k << nl
<< " incr: " << (*iter2)->increment() << nl
<< " incr: " << iter2->increment() << nl
;
}
}
@ -216,8 +214,7 @@ int main(int argc, char *argv[])
Info<< "have " << k << nl
<< " addr: " << name(*iter1) << nl
<< " info: " << (*iter1)->info() << nl
<< " info: " << iter1->info() << nl
<< " incr: " << iter1->increment() << nl
<< " incr: " << (*iter1)->increment() << nl
;
}
@ -227,7 +224,6 @@ int main(int argc, char *argv[])
Info<< "have " << k << nl
<< " addr: " << name(*iter2) << nl
<< " info: " << (*iter2)->info() << nl
<< " info: " << iter2->info() << nl
// Good: does not compile
// << " incr: " << iter2->increment() << nl
;
@ -239,7 +235,6 @@ int main(int argc, char *argv[])
Info<< "have " << k << nl
<< " addr: " << name(*iter3) << nl
<< " info: " << (*iter3)->info() << nl
<< " info: " << iter3->info() << nl
// Good: does not compile
// << " incr: " << iter3->increment() << nl
;
@ -276,7 +271,7 @@ int main(int argc, char *argv[])
if (iter)
{
Info<< "got with " << iter->size() << nl;
Info<< "got with " << (*iter).size() << nl;
}
}

View File

@ -30,6 +30,7 @@ Description
#include "argList.H"
#include "HashTable.H"
#include "HashPtrTable.H"
#include "Map.H"
#include "cpuTime.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -58,7 +58,7 @@ void RotateFields
forAllConstIters(fields, fieldIter)
{
Info<< " Rotating " << fieldIter->name() << endl;
Info<< " Rotating " << (*fieldIter)->name() << endl;
GeometricField fld(*fieldIter(), mesh);
transform(fld, dimensionedTensor(rotT), fld);

View File

@ -360,7 +360,7 @@ int main(int argc, char *argv[])
forAllConstIters(objects, iter)
{
const word& headerClassName = iter->headerClassName();
const word& headerClassName = (*iter)->headerClassName();
if
(
@ -390,11 +390,11 @@ int main(int argc, char *argv[])
)
{
Info<< " Reading " << headerClassName
<< " : " << iter->name() << endl;
<< " : " << (*iter)->name() << endl;
fieldDictionary fDict(*iter(), headerClassName);
Info<< " Writing " << iter->name() << endl;
Info<< " Writing " << (*iter)->name() << endl;
fDict.regIOobject::write();
}
}

View File

@ -73,8 +73,8 @@ void Foam::vtkPVFoam::convertVolFields()
Info<< "<beg> " << FUNCTION_NAME << nl;
forAllConstIters(objects, iter)
{
Info<< " " << iter->name()
<< " == " << iter->objectPath() << nl;
Info<< " " << (*iter)->name()
<< " == " << (*iter)->objectPath() << nl;
}
printMemory();
}
@ -149,8 +149,8 @@ void Foam::vtkPVFoam::convertPointFields()
Info<< "<beg> convert volume -> point fields" << nl;
forAllConstIters(objects, iter)
{
Info<< " " << iter->name()
<< " == " << iter->objectPath() << nl;
Info<< " " << (*iter)->name()
<< " == " << (*iter)->objectPath() << nl;
}
printMemory();
}
@ -205,8 +205,8 @@ void Foam::vtkPVFoam::convertAreaFields()
Info<< "<beg> " << FUNCTION_NAME << nl;
forAllConstIters(objects, iter)
{
Info<< " " << iter->name()
<< " == " << iter->objectPath() << nl;
Info<< " " << (*iter)->name()
<< " == " << (*iter)->objectPath() << nl;
}
printMemory();
}
@ -282,8 +282,8 @@ void Foam::vtkPVFoam::convertLagrangianFields()
Info<< "converting OpenFOAM lagrangian fields" << nl;
forAllConstIters(objects, iter)
{
Info<< " " << iter->name()
<< " == " << iter->objectPath() << nl;
Info<< " " << (*iter)->name()
<< " == " << (*iter)->objectPath() << nl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
@ -55,7 +55,7 @@ void MapConsistentVolFields
forAllConstIters(fields, fieldIter)
{
Info<< " interpolating " << fieldIter->name()
Info<< " interpolating " << (*fieldIter)->name()
<< endl;
// Read field. Do not auto-load old-time field
@ -63,7 +63,7 @@ void MapConsistentVolFields
IOobject fieldTargetIOobject
(
fieldIter->name(),
(*fieldIter)->name(),
meshTarget.time().timeName(),
meshTarget,
IOobject::MUST_READ,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -65,7 +65,7 @@ void MapLagrangianFields
forAllConstIters(fields, fieldIter)
{
Info<< " mapping lagrangian field "
<< fieldIter->name() << endl;
<< (*fieldIter)->name() << endl;
// Read field (does not need mesh)
IOField<Type> fieldSource(*fieldIter());
@ -75,7 +75,7 @@ void MapLagrangianFields
(
IOobject
(
fieldIter->name(),
(*fieldIter)->name(),
meshTarget.time().timeName(),
cloud::prefix/cloudName,
meshTarget,
@ -103,7 +103,7 @@ void MapLagrangianFields
forAllConstIters(fieldFields, fieldIter)
{
Info<< " mapping lagrangian fieldField "
<< fieldIter->name() << endl;
<< (*fieldIter)->name() << endl;
// Read field (does not need mesh)
IOField<Field<Type>> fieldSource(*fieldIter());
@ -114,7 +114,7 @@ void MapLagrangianFields
(
IOobject
(
fieldIter->name(),
(*fieldIter)->name(),
meshTarget.time().timeName(),
cloud::prefix/cloudName,
meshTarget,
@ -142,7 +142,7 @@ void MapLagrangianFields
forAllConstIters(fieldFields, fieldIter)
{
Info<< " mapping lagrangian fieldField "
<< fieldIter->name() << endl;
<< (*fieldIter)->name() << endl;
// Read field (does not need mesh)
CompactIOField<Field<Type>, Type> fieldSource(*fieldIter());
@ -152,7 +152,7 @@ void MapLagrangianFields
(
IOobject
(
fieldIter->name(),
(*fieldIter)->name(),
meshTarget.time().timeName(),
cloud::prefix/cloudName,
meshTarget,

View File

@ -57,7 +57,7 @@ void MapVolFields
{
IOobject fieldTargetIOobject
(
fieldIter->name(),
(*fieldIter)->name(),
meshTarget.time().timeName(),
meshTarget,
IOobject::MUST_READ,
@ -66,7 +66,7 @@ void MapVolFields
if (fieldTargetIOobject.typeHeaderOk<fieldType>(true))
{
Info<< " interpolating " << fieldIter->name() << endl;
Info<< " interpolating " << (*fieldIter)->name() << endl;
// Read field fieldSource. Do not auto-load old-time fields
fieldType fieldSource(*fieldIter(), meshSource, false);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2015 OpenFOAM Foundation
@ -43,7 +43,7 @@ void UnMapped(const IOobjectList& objects)
forAllConstIters(fields, fieldIter)
{
mvBak(fieldIter->objectPath(), "unmapped");
mvBak((*fieldIter)->objectPath(), "unmapped");
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -62,7 +62,7 @@ void MapLagrangianFields
forAllConstIters(fields, fieldIter)
{
const word& fieldName = fieldIter->name();
const word& fieldName = (*fieldIter)->name();
Info<< " mapping lagrangian field " << fieldName << endl;
@ -101,7 +101,7 @@ void MapLagrangianFields
forAllConstIters(fieldFields, fieldIter)
{
const word& fieldName = fieldIter->name();
const word& fieldName = (*fieldIter)->name();
Info<< " mapping lagrangian fieldField " << fieldName << endl;
@ -153,7 +153,7 @@ void MapLagrangianFields
forAllConstIters(fieldFields, fieldIter)
{
const word& fieldName = fieldIter->name();
const word& fieldName = (*fieldIter)->name();
Info<< " mapping lagrangian fieldField " << fieldName << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2015 OpenFOAM Foundation
@ -43,7 +43,7 @@ void UnMapped(const IOobjectList& objects)
forAllConstIters(fields, fieldIter)
{
mvBak(fieldIter->objectPath(), "unmapped");
mvBak((*fieldIter)->objectPath(), "unmapped");
}
}

View File

@ -170,17 +170,10 @@ public:
//- The third template parameter, the hash index method.
typedef Hash hasher;
//- The type used for storing into value_type objects.
// This type is usually 'value_type*'.
typedef T* pointer;
//- The type used for storing into value_type objects.
// This type is usually 'value_type&'.
typedef T& reference;
//- The type used for reading from constant value_type objects.
typedef const T* const_pointer;
//- The type used for reading from constant value_type objects.
typedef const T& const_reference;
@ -695,7 +688,6 @@ public:
using key_type = this_type::key_type;
using mapped_type = this_type::mapped_type;
using value_type = this_type::value_type;
using pointer = this_type::pointer;
using reference = this_type::reference;
// Constructors
@ -722,22 +714,6 @@ public:
inline reference operator*() const { return this->val(); }
inline reference operator()() const { return this->val(); }
//- Direct pointer dereferencing (pointer types)
template<class TypeT = T>
typename std::enable_if
<
Detail::isPointer<TypeT>::value,
T
>::type operator->() const { return this->val(); }
//- Address of iterated value (non-pointer types)
template<class TypeT = T>
typename std::enable_if
<
!Detail::isPointer<TypeT>::value,
T*
>::type operator->() const { return &(this->val()); }
inline iterator& operator++();
inline iterator operator++(int);
};
@ -758,7 +734,6 @@ public:
using key_type = this_type::key_type;
using mapped_type = const this_type::mapped_type;
using value_type = const this_type::value_type;
using pointer = this_type::const_pointer;
using reference = this_type::const_reference;
// Constructors
@ -800,26 +775,9 @@ public:
inline reference operator*() const { return this->val(); }
inline reference operator()() const { return this->val(); }
//- Direct pointer dereferencing (pointer types)
template<class TypeT = T>
typename std::enable_if
<
Detail::isPointer<TypeT>::value,
const T
>::type operator->() const { return this->val(); }
//- Address of iterated value (non-pointer types)
template<class TypeT = T>
typename std::enable_if
<
!Detail::isPointer<TypeT>::value,
const T*
>::type operator->() const { return &(this->val()); }
inline const_iterator& operator++();
inline const_iterator operator++(int);
// Assignment
const_iterator& operator=(const const_iterator&) = default;
@ -845,7 +803,6 @@ public:
{
public:
using value_type = this_type::key_type;
using pointer = const Key*;
using reference = const Key&;
//- Implicit conversion

View File

@ -640,7 +640,7 @@ Foam::label Foam::IOobjectList::filterClasses
// Matches? either prune (pruning) or keep (!pruning)
if
(
(pred(iter->headerClassName()) ? pruning : !pruning)
(pred(iter.val()->headerClassName()) ? pruning : !pruning)
&& erase(iter)
)
{

View File

@ -437,7 +437,7 @@ bool Foam::objectRegistry::modified() const
{
for (const_iterator iter = cbegin(); iter != cend(); ++iter)
{
if (iter->modified())
if ((*iter)->modified())
{
return true;
}
@ -458,7 +458,7 @@ void Foam::objectRegistry::readModifiedObjects()
<< iter.key() << endl;
}
iter->readIfModified();
(*iter)->readIfModified();
}
}
@ -487,15 +487,15 @@ bool Foam::objectRegistry::writeObject
Pout<< "objectRegistry::write() : "
<< name() << " : Considering writing object "
<< iter.key()
<< " of type " << iter->type()
<< " with writeOpt " << static_cast<int>(iter->writeOpt())
<< " to file " << iter->objectPath()
<< " of type " << (*iter)->type()
<< " with writeOpt " << static_cast<int>((*iter)->writeOpt())
<< " to file " << (*iter)->objectPath()
<< endl;
}
if (iter->writeOpt() != NO_WRITE)
if ((*iter)->writeOpt() != NO_WRITE)
{
ok = iter->writeObject(fmt, ver, cmp, valid) && ok;
ok = (*iter)->writeObject(fmt, ver, cmp, valid) && ok;
}
}

View File

@ -451,7 +451,7 @@ const Type& Foam::objectRegistry::lookupObject
<< " lookup of " << name << " from objectRegistry "
<< this->name()
<< " successful\n but it is not a " << Type::typeName
<< ", it is a " << iter->type()
<< ", it is a " << (*iter)->type()
<< abort(FatalError);
}
else if (recursive && this->parentNotTime())

View File

@ -125,7 +125,7 @@ void Foam::meshObject::movePoints(objectRegistry& obr)
{
if (meshObject::debug)
{
Pout<< " Moving " << iter->name() << endl;
Pout<< " Moving " << (*iter)->name() << endl;
}
objectPtr->movePoints();
}
@ -133,7 +133,7 @@ void Foam::meshObject::movePoints(objectRegistry& obr)
{
if (meshObject::debug)
{
Pout<< " Destroying " << iter->name() << endl;
Pout<< " Destroying " << (*iter)->name() << endl;
}
obr.checkOut(*iter);
}
@ -165,7 +165,7 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
{
if (meshObject::debug)
{
Pout<< " Updating " << iter->name() << endl;
Pout<< " Updating " << (*iter)->name() << endl;
}
objectPtr->updateMesh(mpm);
}
@ -173,7 +173,7 @@ void Foam::meshObject::updateMesh(objectRegistry& obr, const mapPolyMesh& mpm)
{
if (meshObject::debug)
{
Pout<< " Destroying " << iter->name() << endl;
Pout<< " Destroying " << (*iter)->name() << endl;
}
obr.checkOut(*iter);
}
@ -200,7 +200,7 @@ void Foam::meshObject::clear(objectRegistry& obr)
{
if (meshObject::debug)
{
Pout<< " Destroying " << iter->name() << endl;
Pout<< " Destroying " << (*iter)->name() << endl;
}
obr.checkOut(*iter);
}
@ -236,7 +236,7 @@ void Foam::meshObject::clearUpto(objectRegistry& obr)
{
if (meshObject::debug)
{
Pout<< " Destroying " << iter->name() << endl;
Pout<< " Destroying " << (*iter)->name() << endl;
}
obr.checkOut(*iter);
}

View File

@ -517,27 +517,27 @@ void Foam::genericFaPatchField<Type>::autoMap
forAllIters(scalarFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(vectorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(sphTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(symmTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(tensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
}
@ -560,7 +560,7 @@ void Foam::genericFaPatchField<Type>::rmap
if (iter.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -570,7 +570,7 @@ void Foam::genericFaPatchField<Type>::rmap
if (iter.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -580,7 +580,7 @@ void Foam::genericFaPatchField<Type>::rmap
if (iter.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -590,7 +590,7 @@ void Foam::genericFaPatchField<Type>::rmap
if (iter.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -600,7 +600,7 @@ void Foam::genericFaPatchField<Type>::rmap
if (iter.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
}
@ -713,23 +713,23 @@ void Foam::genericFaPatchField<Type>::write(Ostream& os) const
{
if (scalarFields_.found(key))
{
scalarFields_.cfind(key)->writeEntry(key, os);
scalarFields_.cfind(key)()->writeEntry(key, os);
}
else if (vectorFields_.found(key))
{
vectorFields_.cfind(key)->writeEntry(key, os);
vectorFields_.cfind(key)()->writeEntry(key, os);
}
else if (sphTensorFields_.found(key))
{
sphTensorFields_.cfind(key)->writeEntry(key, os);
sphTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (symmTensorFields_.found(key))
{
symmTensorFields_.cfind(key)->writeEntry(key, os);
symmTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (tensorFields_.found(key))
{
tensorFields_.cfind(key)->writeEntry(key, os);
tensorFields_.cfind(key)()->writeEntry(key, os);
}
}
else

View File

@ -517,27 +517,27 @@ void Foam::genericFvPatchField<Type>::autoMap
forAllIters(scalarFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(vectorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(sphTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(symmTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(tensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
}
@ -560,7 +560,7 @@ void Foam::genericFvPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -570,7 +570,7 @@ void Foam::genericFvPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -580,7 +580,7 @@ void Foam::genericFvPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -590,7 +590,7 @@ void Foam::genericFvPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -600,7 +600,7 @@ void Foam::genericFvPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
}
@ -713,23 +713,23 @@ void Foam::genericFvPatchField<Type>::write(Ostream& os) const
{
if (scalarFields_.found(key))
{
scalarFields_.cfind(key)->writeEntry(key, os);
scalarFields_.cfind(key)()->writeEntry(key, os);
}
else if (vectorFields_.found(key))
{
vectorFields_.cfind(key)->writeEntry(key, os);
vectorFields_.cfind(key)()->writeEntry(key, os);
}
else if (sphTensorFields_.found(key))
{
sphTensorFields_.cfind(key)->writeEntry(key, os);
sphTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (symmTensorFields_.found(key))
{
symmTensorFields_.cfind(key)->writeEntry(key, os);
symmTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (tensorFields_.found(key))
{
tensorFields_.cfind(key)->writeEntry(key, os);
tensorFields_.cfind(key)()->writeEntry(key, os);
}
}
else

View File

@ -515,27 +515,27 @@ void Foam::genericFvsPatchField<Type>::autoMap
forAllIters(scalarFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(vectorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(sphTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(symmTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(tensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
}
@ -558,7 +558,7 @@ void Foam::genericFvsPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -568,7 +568,7 @@ void Foam::genericFvsPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -578,7 +578,7 @@ void Foam::genericFvsPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -588,7 +588,7 @@ void Foam::genericFvsPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -598,7 +598,7 @@ void Foam::genericFvsPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
}
@ -711,23 +711,23 @@ void Foam::genericFvsPatchField<Type>::write(Ostream& os) const
{
if (scalarFields_.found(key))
{
scalarFields_.cfind(key)->writeEntry(key, os);
scalarFields_.cfind(key)()->writeEntry(key, os);
}
else if (vectorFields_.found(key))
{
vectorFields_.cfind(key)->writeEntry(key, os);
vectorFields_.cfind(key)()->writeEntry(key, os);
}
else if (sphTensorFields_.found(key))
{
sphTensorFields_.cfind(key)->writeEntry(key, os);
sphTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (symmTensorFields_.found(key))
{
symmTensorFields_.cfind(key)->writeEntry(key, os);
symmTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (tensorFields_.found(key))
{
tensorFields_.cfind(key)->writeEntry(key, os);
tensorFields_.cfind(key)()->writeEntry(key, os);
}
}
else

View File

@ -377,27 +377,27 @@ void Foam::genericPointPatchField<Type>::autoMap
{
forAllIters(scalarFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(vectorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(sphTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(symmTensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
forAllIters(tensorFields_, iter)
{
iter->autoMap(m);
(*iter)->autoMap(m);
}
}
@ -418,7 +418,7 @@ void Foam::genericPointPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -428,7 +428,7 @@ void Foam::genericPointPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -438,7 +438,7 @@ void Foam::genericPointPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -448,7 +448,7 @@ void Foam::genericPointPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
@ -458,7 +458,7 @@ void Foam::genericPointPatchField<Type>::rmap
if (iter2.found())
{
iter->rmap(*iter2(), addr);
(*iter)->rmap(*iter2(), addr);
}
}
}
@ -494,23 +494,23 @@ void Foam::genericPointPatchField<Type>::write(Ostream& os) const
{
if (scalarFields_.found(key))
{
scalarFields_.cfind(key)->writeEntry(key, os);
scalarFields_.cfind(key)()->writeEntry(key, os);
}
else if (vectorFields_.found(key))
{
vectorFields_.cfind(key)->writeEntry(key, os);
vectorFields_.cfind(key)()->writeEntry(key, os);
}
else if (sphTensorFields_.found(key))
{
sphTensorFields_.cfind(key)->writeEntry(key, os);
sphTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (symmTensorFields_.found(key))
{
symmTensorFields_.cfind(key)->writeEntry(key, os);
symmTensorFields_.cfind(key)()->writeEntry(key, os);
}
else if (tensorFields_.found(key))
{
tensorFields_.cfind(key)->writeEntry(key, os);
tensorFields_.cfind(key)()->writeEntry(key, os);
}
}
else