mirror of
https://github.com/OpenFOAM/OpenFOAM-6.git
synced 2025-12-08 06:57:46 +00:00
SubList, SubField: Added assignment to UList
This commit is contained in:
@ -87,6 +87,9 @@ public:
|
||||
//- Allow cast to a const List<T>&
|
||||
inline operator const Foam::List<T>&() const;
|
||||
|
||||
//- Assignment of all entries to the given list
|
||||
inline void operator=(const UList<T>&);
|
||||
|
||||
//- Assignment of all entries to the given value
|
||||
inline void operator=(const T&);
|
||||
};
|
||||
|
||||
@ -87,6 +87,13 @@ inline Foam::SubList<T>::operator const Foam::List<T>&() const
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::SubList<T>::operator=(const UList<T>& l)
|
||||
{
|
||||
UList<T>::assign(l);
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::SubList<T>::operator=(const T& t)
|
||||
{
|
||||
|
||||
@ -41,6 +41,7 @@ SourceFiles
|
||||
|
||||
#include "SubList.H"
|
||||
#include "Field.H"
|
||||
#include "VectorSpace.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -112,6 +113,13 @@ public:
|
||||
//- Assignment via UList operator. Takes linear time.
|
||||
inline void operator=(const SubField<Type>&);
|
||||
|
||||
//- Assignment via UList operator. Takes linear time.
|
||||
inline void operator=(const Field<Type>&);
|
||||
|
||||
//- Assignment via UList operator. Takes linear time.
|
||||
template<class Form, direction Ncmpts>
|
||||
inline void operator=(const VectorSpace<Form, Type, Ncmpts>&);
|
||||
|
||||
//- Allow cast to a const Field\<Type\>&
|
||||
inline operator const Field<Type>&() const;
|
||||
};
|
||||
|
||||
@ -111,7 +111,29 @@ inline Foam::tmp<Foam::Field<Type>> Foam::SubField<Type>::T() const
|
||||
template<class Type>
|
||||
inline void Foam::SubField<Type>::operator=(const SubField<Type>& rhs)
|
||||
{
|
||||
UList<Type>::operator=(rhs);
|
||||
SubList<Type>::operator=(rhs);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
inline void Foam::SubField<Type>::operator=(const Field<Type>& rhs)
|
||||
{
|
||||
SubList<Type>::operator=(rhs);
|
||||
InfoInFunction << *this << endl;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
template<class Form, Foam::direction Ncmpts>
|
||||
inline void Foam::SubField<Type>::operator=
|
||||
(
|
||||
const VectorSpace<Form, Type, Ncmpts>& rhs
|
||||
)
|
||||
{
|
||||
forAll(rhs, i)
|
||||
{
|
||||
this->operator[](i) = rhs[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user