mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: refactor Function1 to enable fields
This commit is contained in:
committed by
Andrew Heather
parent
7cd3b270d8
commit
7ff603d496
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2021 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -285,7 +285,7 @@ Type Foam::Function1Types::TableBase<Type>::value(const scalar x) const
|
||||
// Use interpolator
|
||||
interpolator().valueWeights(xDash, currentIndices_, currentWeights_);
|
||||
|
||||
Type t = currentWeights_[0]*table_[currentIndices_[0]].second();
|
||||
Type t(currentWeights_[0]*table_[currentIndices_[0]].second());
|
||||
for (label i = 1; i < currentIndices_.size(); i++)
|
||||
{
|
||||
t += currentWeights_[i]*table_[currentIndices_[i]].second();
|
||||
@ -305,7 +305,7 @@ Type Foam::Function1Types::TableBase<Type>::integrate
|
||||
// Use interpolator
|
||||
interpolator().integrationWeights(x1, x2, currentIndices_, currentWeights_);
|
||||
|
||||
Type sum = currentWeights_[0]*table_[currentIndices_[0]].second();
|
||||
Type sum(currentWeights_[0]*table_[currentIndices_[0]].second());
|
||||
for (label i = 1; i < currentIndices_.size(); i++)
|
||||
{
|
||||
sum += currentWeights_[i]*table_[currentIndices_[i]].second();
|
||||
|
||||
Reference in New Issue
Block a user