mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: UIndirectList: assignment from UIndirectList
This commit is contained in:
@ -112,6 +112,9 @@ public:
|
||||
//- Assignment from UList of addressed elements
|
||||
inline void operator=(const UList<T>&);
|
||||
|
||||
//- Assignment from UIndirectList of addressed elements
|
||||
inline void operator=(const UIndirectList<T>&);
|
||||
|
||||
//- Assignment of all entries to the given value
|
||||
inline void operator=(const T&);
|
||||
|
||||
|
||||
@ -144,6 +144,25 @@ inline void Foam::UIndirectList<T>::operator=(const UList<T>& ae)
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::UIndirectList<T>::operator=(const UIndirectList<T>& ae)
|
||||
{
|
||||
if (addressing_.size() != ae.size())
|
||||
{
|
||||
FatalErrorIn("UIndirectList<T>::operator=(const UIndirectList<T>&)")
|
||||
<< "Addressing and list of addressed elements "
|
||||
"have different sizes: "
|
||||
<< addressing_.size() << " " << ae.size()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
forAll(addressing_, i)
|
||||
{
|
||||
completeList_[addressing_[i]] = ae[i];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
inline void Foam::UIndirectList<T>::operator=(const T& t)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user