SubField: Added "reuse" constructor

This doesn't add any functionality, but it is necessary to unify the
interface with Field for classes that are templated on their container
This commit is contained in:
Will Bainbridge
2023-01-03 08:45:44 +00:00
parent 921c9719ee
commit 5e74e289a5
2 changed files with 17 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-2020 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -95,6 +95,9 @@ public:
//- Copy constructor
inline SubField(const SubField<Type>&);
//- Copy constructor or reuse as specified
inline SubField(SubField<Type>&, bool reuse);
// Member Functions

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-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -79,6 +79,18 @@ inline Foam::SubField<Type>::SubField
{}
template<class Type>
inline Foam::SubField<Type>::SubField
(
SubField<Type>& sfield,
bool reuse
)
:
tmp<SubField<Type>>::refCount(),
SubList<Type>(sfield)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>