41 if (nSweeps < 1 || !tinput.good())
47 label
nPoints = tinput().size();
49 const label nAddr = addressing_.size();
63 <<
"Addressing/weights shorter than input field"
70 toutput.ref().slice(nAddr) = tinput().slice(nAddr);
84 tbuffer.
reset(tinput.ptr());
92 for (label sweep = 0; sweep < nSweeps; ++sweep)
97 tbuffer.
swap(toutput);
100 const auto& input = tbuffer();
101 auto& output = toutput.ref();
103 #pragma omp parallel for if (nPoints > 1000)
104 for (label pointi = 0; pointi <
nPoints; ++pointi)
106 const auto& addr = addressing_[pointi];
107 const auto& weight = weights_[pointi];
109 auto& interp = output[pointi];
114 interp = input[pointi];
122 interp += (weight[i] * input[addr[i]]);
Generic templated field type that is much like a Foam::List except that it is expected to hold numeri...
tmp< Field< Type > > evaluate(const tmp< Field< Type > > &tinput, const label nSweeps) const
Return the median smoothed field.
A class for managing temporary objects.
void swap(tmp< T > &other) noexcept
Swaps the managed object with other.
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
void clear() const noexcept
If object pointer points to valid object: delete object and set pointer to nullptr.
void reset(tmp< T > &&other) noexcept
Clear existing and transfer ownership.
#define WarningInFunction
Report a warning using Foam::Warning.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static constexpr const zero Zero
Global zero (0).
#define forAll(list, i)
Loop across all elements in list.