Commit 4eba393f authored by Henry Weller's avatar Henry Weller
Browse files

Update code to use the simpler C++11 template syntax

parent acb9ec8b
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -128,7 +128,7 @@ int main(int argc, char *argv[])
<< "Median " << dS.median()
<< endl;
reduce(dS, sumOp< Distribution<scalar> >());
reduce(dS, sumOp<Distribution<scalar>>());
if (Pstream::master())
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -103,7 +103,7 @@ int main(int argc, char *argv[])
}
else if (listType == "labelListList")
{
List< List<label> > lst(is);
List<List<label>> lst(is);
forAll(lst, i)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -1124,7 +1124,7 @@ int main(int argc, char *argv[])
meshedSurface rawSurface
(
xferCopy(polyPoints),
xferCopyTo< faceList >(boundaryFaces)
xferCopyTo<faceList>(boundaryFaces)
);
// Write locally numbered surface
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -517,7 +517,7 @@ int main(int argc, char *argv[])
cloudDirs.size()
);
// Particles per cell
PtrList< List<SLList<indexedParticle*>*> > cellParticles
PtrList<List<SLList<indexedParticle*>*> > cellParticles
(
cloudDirs.size()
);
......
......@@ -4,7 +4,7 @@
HashTable<word> volumeFields;
// 2. the fields for each cloud:
HashTable< HashTable<word> > cloudFields;
HashTable<HashTable<word>> cloudFields;
if (timeDirs.size())
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -95,8 +95,8 @@ int main(int argc, char *argv[])
Info<< endl;
::List< ::Vector> vert; // global list of vertices
::List< ::tridata> tri; // global list of triangles
::List<::Vector> vert; // global list of vertices
::List<::tridata> tri; // global list of triangles
// Convert triSurface to progmesh format. Note: can use global point
......@@ -127,7 +127,7 @@ int main(int argc, char *argv[])
::ProgressiveMesh(vert,tri,collapse_map,permutation);
// rearrange the vertex list
::List< ::Vector> temp_list;
::List<::Vector> temp_list;
for (int i=0;i<vert.num;i++)
{
temp_list.Add(vert[i]);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -92,9 +92,9 @@ public:
);
//- Construct and return a clone
virtual tmp< fvPatch${FieldType} > clone() const
virtual tmp<fvPatch${FieldType} > clone() const
{
return tmp< fvPatch${FieldType} >
return tmp<fvPatch${FieldType} >
(
new ${typeName}FixedValueFvPatch${FieldType}(*this)
);
......@@ -108,12 +108,12 @@ public:
);
//- Construct and return a clone setting internal field reference
virtual tmp< fvPatch${FieldType} > clone
virtual tmp<fvPatch${FieldType} > clone
(
const DimensionedField<${TemplateType}, volMesh>& iF
) const
{
return tmp< fvPatch${FieldType} >
return tmp<fvPatch${FieldType} >
(
new ${typeName}FixedValueFvPatch${FieldType}(*this, iF)
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -93,9 +93,9 @@ public:
);
//- Construct and return a clone
virtual autoPtr< pointPatchField<${TemplateType}> > clone() const
virtual autoPtr<pointPatchField<${TemplateType}> > clone() const
{
return autoPtr< pointPatchField<${TemplateType}> >
return autoPtr<pointPatchField<${TemplateType}> >
(
new ${typeName}FixedValuePointPatch${FieldType}(*this)
);
......@@ -109,12 +109,12 @@ public:
);
//- Construct and return a clone setting internal field reference
virtual autoPtr< pointPatchField<${TemplateType}> > clone
virtual autoPtr<pointPatchField<${TemplateType}> > clone
(
const DimensionedField<${TemplateType}, pointMesh>& iF
) const
{
return autoPtr< pointPatchField<${TemplateType}> >
return autoPtr<pointPatchField<${TemplateType}> >
(
new ${typeName}FixedValuePointPatch${FieldType}(*this, iF)
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -92,9 +92,9 @@ public:
);
//- Construct and return a clone
virtual tmp< fvPatch${FieldType} > clone() const
virtual tmp<fvPatch${FieldType} > clone() const
{
return tmp< fvPatch${FieldType} >
return tmp<fvPatch${FieldType} >
(
new ${typeName}MixedValueFvPatch${FieldType}(*this)
);
......@@ -108,12 +108,12 @@ public:
);
//- Construct and return a clone setting internal field reference
virtual tmp< fvPatch${FieldType} > clone
virtual tmp<fvPatch${FieldType} > clone
(
const DimensionedField<${TemplateType}, volMesh>& iF
) const
{
return tmp< fvPatch${FieldType} >
return tmp<fvPatch${FieldType} >
(
new ${typeName}MixedValueFvPatch${FieldType}(*this, iF)
);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -32,7 +32,7 @@ License
template<class Type>
Foam::Distribution<Type>::Distribution()
:
List< List<scalar> >(pTraits<Type>::nComponents),
List<List<scalar>>(pTraits<Type>::nComponents),
binWidth_(pTraits<Type>::one),
listStarts_(pTraits<Type>::nComponents, 0)
{}
......@@ -41,7 +41,7 @@ Foam::Distribution<Type>::Distribution()
template<class Type>
Foam::Distribution<Type>::Distribution(const Type& binWidth)
:
List< List<scalar> >(pTraits<Type>::nComponents),
List<List<scalar>>(pTraits<Type>::nComponents),
binWidth_(binWidth),
listStarts_(pTraits<Type>::nComponents, 0)
{}
......@@ -50,7 +50,7 @@ Foam::Distribution<Type>::Distribution(const Type& binWidth)
template<class Type>
Foam::Distribution<Type>::Distribution(const Distribution<Type>& d)
:
List< List<scalar> >(static_cast< const List< List<scalar> >& >(d)),
List<List<scalar>>(static_cast<const List<List<scalar>>& >(d)),
binWidth_(d.binWidth()),
listStarts_(d.listStarts())
{}
......@@ -227,11 +227,11 @@ Type Foam::Distribution<Type>::median() const
{
Type medianValue(pTraits<Type>::zero);
List< List < Pair<scalar> > > normDistribution = normalised();
List<List<Pair<scalar>>> normDistribution = normalised();
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
List< Pair<scalar> >& normDist = normDistribution[cmpt];
List<Pair<scalar>>& normDist = normDistribution[cmpt];
if (normDist.size())
{
......@@ -331,10 +331,10 @@ void Foam::Distribution<Type>::add
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Foam::List<Foam::List<Foam::Pair<Foam::scalar>>>Foam::
Distribution<Type>::normalised() const
{
List< List < Pair<scalar> > > normDistribution(pTraits<Type>::nComponents);
List<List<Pair<scalar>>> normDistribution(pTraits<Type>::nComponents);
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
......@@ -349,7 +349,7 @@ Distribution<Type>::normalised() const
List<label> cmptKeys = keys(cmpt);
List< Pair<scalar> >& normDist = normDistribution[cmpt];
List<Pair<scalar>>& normDist = normDistribution[cmpt];
Pair<label> limits = validLimits(cmpt);
......@@ -379,10 +379,10 @@ Distribution<Type>::normalised() const
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Foam::List<Foam::List<Foam::Pair<Foam::scalar>>>Foam::
Distribution<Type>::raw() const
{
List< List < Pair<scalar> > > rawDistribution(pTraits<Type>::nComponents);
List<List<Pair<scalar>>> rawDistribution(pTraits<Type>::nComponents);
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
......@@ -395,7 +395,7 @@ Distribution<Type>::raw() const
List<label> cmptKeys = keys(cmpt);
List< Pair<scalar> >& rawDist = rawDistribution[cmpt];
List<Pair<scalar>>& rawDist = rawDistribution[cmpt];
Pair<label> limits = validLimits(cmpt);
......@@ -421,20 +421,20 @@ Distribution<Type>::raw() const
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Foam::List<Foam::List<Foam::Pair<Foam::scalar>>>Foam::
Distribution<Type>::cumulativeNormalised() const
{
List< List< Pair<scalar> > > normalisedDistribution = normalised();
List<List<Pair<scalar>>> normalisedDistribution = normalised();
List< List < Pair<scalar> > > cumulativeNormalisedDistribution =
List<List<Pair<scalar>>> cumulativeNormalisedDistribution =
normalisedDistribution;
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& normalisedCmpt =
const List<Pair<scalar>>& normalisedCmpt =
normalisedDistribution[cmpt];
List< Pair<scalar> >& cumNormalisedCmpt =
List<Pair<scalar>>& cumNormalisedCmpt =
cumulativeNormalisedDistribution[cmpt];
scalar sum = 0.0;
......@@ -457,18 +457,18 @@ Distribution<Type>::cumulativeNormalised() const
template<class Type>
Foam::List< Foam::List< Foam::Pair<Foam::scalar> > >Foam::
Foam::List<Foam::List<Foam::Pair<Foam::scalar>>>Foam::
Distribution<Type>::cumulativeRaw() const
{
List< List< Pair<scalar> > > rawDistribution = raw();
List<List<Pair<scalar>>> rawDistribution = raw();
List< List < Pair<scalar> > > cumulativeRawDistribution = rawDistribution;
List<List<Pair<scalar>>> cumulativeRawDistribution = rawDistribution;
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& rawCmpt = rawDistribution[cmpt];
const List<Pair<scalar>>& rawCmpt = rawDistribution[cmpt];
List< Pair<scalar> >& cumRawCmpt = cumulativeRawDistribution[cmpt];
List<Pair<scalar>>& cumRawCmpt = cumulativeRawDistribution[cmpt];
scalar sum = 0.0;
......@@ -503,15 +503,15 @@ void Foam::Distribution<Type>::clear()
template<class Type>
void Foam::Distribution<Type>::write(const fileName& filePrefix) const
{
List< List< Pair<scalar> > > rawDistribution = raw();
List<List<Pair<scalar>>> rawDistribution = raw();
List< List < Pair<scalar> > > normDistribution = normalised();
List<List<Pair<scalar>>> normDistribution = normalised();
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& rawPairs = rawDistribution[cmpt];
const List<Pair<scalar>>& rawPairs = rawDistribution[cmpt];
const List< Pair<scalar> >& normPairs = normDistribution[cmpt];
const List<Pair<scalar>>& normPairs = normDistribution[cmpt];
OFstream os(filePrefix + '_' + pTraits<Type>::componentNames[cmpt]);
......@@ -526,15 +526,15 @@ void Foam::Distribution<Type>::write(const fileName& filePrefix) const
}
}
List< List< Pair<scalar> > > rawCumDist = cumulativeRaw();
List<List<Pair<scalar>>> rawCumDist = cumulativeRaw();
List< List < Pair<scalar> > > normCumDist = cumulativeNormalised();
List<List<Pair<scalar>>> normCumDist = cumulativeNormalised();
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{
const List< Pair<scalar> >& rawPairs = rawCumDist[cmpt];
const List<Pair<scalar>>& rawPairs = rawCumDist[cmpt];
const List< Pair<scalar> >& normPairs = normCumDist[cmpt];
const List<Pair<scalar>>& normPairs = normCumDist[cmpt];
OFstream os
(
......@@ -570,7 +570,7 @@ void Foam::Distribution<Type>::operator=
<< abort(FatalError);
}
List< List<scalar> >::operator=(rhs);
List<List<scalar>>::operator=(rhs);
binWidth_ = rhs.binWidth();
......@@ -587,7 +587,7 @@ Foam::Istream& Foam::operator>>
Distribution<Type>& d
)
{
is >> static_cast<List< List<scalar> >&>(d)
is >> static_cast<List<List<scalar>>&>(d)
>> d.binWidth_
>> d.listStarts_;
......@@ -605,7 +605,7 @@ Foam::Ostream& Foam::operator<<
const Distribution<Type>& d
)
{
os << static_cast<const List< List<scalar> >& >(d)
os << static_cast<const List<List<scalar>>& >(d)
<< d.binWidth_ << token::SPACE
<< d.listStarts_;
......@@ -628,7 +628,7 @@ Foam::Distribution<Type> Foam::operator+
// The coarsest binWidth is the sensible choice
Distribution<Type> d(max(d1.binWidth(), d2.binWidth()));
List< List< List < Pair<scalar> > > > rawDists(2);
List<List<List<Pair<scalar>>>> rawDists(2);
rawDists[0] = d1.raw();
rawDists[1] = d2.raw();
......@@ -639,7 +639,7 @@ Foam::Distribution<Type> Foam::operator+
{
List<scalar>& cmptDistribution = d[cmpt];
const List < Pair<scalar> >& cmptRaw = rawDists[rDI][cmpt];
const List<Pair<scalar>>& cmptRaw = rawDists[rDI][cmpt];
forAll(cmptRaw, rI)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -62,7 +62,7 @@ Ostream& operator<<(Ostream&, const Distribution<Type>&);
template<class Type>
class Distribution
:
public List< List<scalar> >
public List<List<scalar>>
{
// Private data
......@@ -125,18 +125,18 @@ public:
//- Return the normalised distribution (probability density)
// and bins
List< List<Pair<scalar> > > normalised() const;
List<List<Pair<scalar>> > normalised() const;
//- Return the distribution of the total bin weights
List< List < Pair<scalar> > > raw() const;
List<List < Pair<scalar> > > raw() const;
//- Return the cumulative normalised distribution and
// integration locations (at end of bins)
List< List<Pair<scalar> > > cumulativeNormalised() const;
List<List<Pair<scalar>> > cumulativeNormalised() const;
//- Return the cumulative total bin weights and integration
// locations (at end of bins)
List< List<Pair<scalar> > > cumulativeRaw() const;
List<List<Pair<scalar>> > cumulativeRaw() const;
//- Resets the Distribution by clearing the stored lists.
// Leaves the same number of them and the same binWidth.
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -300,7 +300,7 @@ template<class T, unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
inline Foam::Xfer<Foam::List<T> >
Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::xfer()
{
return xferMoveTo< List<T> >(*this);
return xferMoveTo<List<T>>(*this);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -83,7 +83,7 @@ public:
//- Hashing function class.
// Use Hasher directly for contiguous data. Otherwise hash incrementally.
template< class HashT=Hash<T> >
template<class HashT=Hash<T> >
class Hash
{
public:
......@@ -127,7 +127,7 @@ public:
FixedList(Istream&);
//- Clone
inline autoPtr< FixedList<T, Size> > clone() const;
inline autoPtr<FixedList<T, Size> > clone() const;
// Member Functions
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -95,10 +95,10 @@ inline Foam::FixedList<T, Size>::FixedList(const FixedList<T, Size>& lst)
template<class T, unsigned Size>
inline Foam::autoPtr< Foam::FixedList<T, Size> >
inline Foam::autoPtr<Foam::FixedList<T, Size> >
Foam::FixedList<T, Size>::clone() const
{
return autoPtr< FixedList<T, Size> >(new FixedList<T, Size>(*this));
return autoPtr<FixedList<T, Size> >(new FixedList<T, Size>(*this));
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -235,7 +235,7 @@ public:
explicit inline PackedList(const UIndirectList<label>&);
//- Clone
inline autoPtr< PackedList<nBits> > clone() const;
inline autoPtr<PackedList<nBits>> clone() const;
// Member Functions
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -83,7 +83,7 @@ inline const Foam::SubList<T>& Foam::SubList<T>::null()
template<class T>
inline Foam::SubList<T>::operator const Foam::List<T>&() const
{
return *reinterpret_cast< const List<T>* >(this);
return *reinterpret_cast<const List<T>* >(this);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -77,7 +77,7 @@ class StaticAssertionTest {};