mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: TableBase: preserve address of tableSamples since referenced in interpolationWeights
This commit is contained in:
@ -35,15 +35,16 @@ const Foam::interpolationWeights& Foam::TableBase<Type>::interpolator() const
|
|||||||
if (interpolatorPtr_.empty())
|
if (interpolatorPtr_.empty())
|
||||||
{
|
{
|
||||||
// Re-work table into linear list
|
// Re-work table into linear list
|
||||||
tableSamples_.setSize(table_.size());
|
tableSamplesPtr_.reset(new scalarField(table_.size()));
|
||||||
|
scalarField& tableSamples = tableSamplesPtr_();
|
||||||
forAll(table_, i)
|
forAll(table_, i)
|
||||||
{
|
{
|
||||||
tableSamples_[i] = table_[i].first();
|
tableSamples[i] = table_[i].first();
|
||||||
}
|
}
|
||||||
interpolatorPtr_ = interpolationWeights::New
|
interpolatorPtr_ = interpolationWeights::New
|
||||||
(
|
(
|
||||||
interpolationScheme_,
|
interpolationScheme_,
|
||||||
tableSamples_
|
tableSamples
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +82,7 @@ Foam::TableBase<Type>::TableBase(const TableBase<Type>& tbl)
|
|||||||
interpolationScheme_(tbl.interpolationScheme_),
|
interpolationScheme_(tbl.interpolationScheme_),
|
||||||
table_(tbl.table_),
|
table_(tbl.table_),
|
||||||
dimensions_(tbl.dimensions_),
|
dimensions_(tbl.dimensions_),
|
||||||
tableSamples_(tbl.tableSamples_),
|
tableSamplesPtr_(tbl.tableSamplesPtr_),
|
||||||
interpolatorPtr_(tbl.interpolatorPtr_)
|
interpolatorPtr_(tbl.interpolatorPtr_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -341,7 +342,7 @@ void Foam::TableBase<Type>::convertTimeBase(const Time& t)
|
|||||||
table_[i].first() = t.userTimeToTime(value);
|
table_[i].first() = t.userTimeToTime(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
tableSamples_.clear();
|
tableSamplesPtr_.clear();
|
||||||
interpolatorPtr_.clear();
|
interpolatorPtr_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -97,7 +97,7 @@ protected:
|
|||||||
dimensionSet dimensions_;
|
dimensionSet dimensions_;
|
||||||
|
|
||||||
//- Extracted values
|
//- Extracted values
|
||||||
mutable scalarField tableSamples_;
|
mutable autoPtr<scalarField> tableSamplesPtr_;
|
||||||
|
|
||||||
//- Interpolator method
|
//- Interpolator method
|
||||||
mutable autoPtr<interpolationWeights> interpolatorPtr_;
|
mutable autoPtr<interpolationWeights> interpolatorPtr_;
|
||||||
|
|||||||
Reference in New Issue
Block a user