Merge branch 'master' of github.com-OpenFOAM:OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry Weller
2022-01-27 11:14:59 +00:00
2 changed files with 40 additions and 2 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -157,6 +157,33 @@ void Foam::UPtrList<T>::shuffle(const labelUList& newToOld)
}
template<class T>
template<class T2>
Foam::UPtrList<T2> Foam::UPtrList<T>::convert()
{
UPtrList<T2> result(size());
forAll(ptrs_, i)
{
result.set(i, ptrs_[i]);
}
return result;
}
template<class T>
template<class T2>
Foam::UPtrList<const T2> Foam::UPtrList<T>::convert() const
{
UPtrList<const T2> result(size());
forAll(ptrs_, i)
{
result.set(i, ptrs_[i]);
}
return result;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "UPtrListIO.C"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -150,6 +150,17 @@ public:
void shuffle(const labelUList& newToOld);
// Conversion
//- Convert to list of different pointer type
template<class T2>
UPtrList<T2> convert();
//- Convert to list of different pointer type
template<class T2>
UPtrList<const T2> convert() const;
// Member Operators
//- Return element const reference