Commit 71e6e104 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

ENH: use cellPoint interpolation directly for surfaceFieldValue (#1212)

- prior to sampledSurface supporting different interpolation schemes a
  workaround means was used to simulate cellPoint -> face
  interpolation, with averaging of vertex interpolation.

  We instead now use cellPoint interpolation directly for the face
  values when 'interpolate=true'.
parent 8a7d8e74
......@@ -211,7 +211,7 @@ class surfaceFieldValue
{
public:
// Public data types
// Public Data Types
//- Region type enumeration
enum regionTypes
......
......@@ -98,25 +98,8 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues
if (sampledPtr_().interpolate())
{
const interpolationCellPoint<Type> interp(fld);
tmp<Field<Type>> tintFld(sampledPtr_().interpolate(interp));
const Field<Type>& intFld = tintFld();
// Average
const faceList& faces = sampledPtr_().faces();
auto tavg = tmp<Field<Type>>::New(faces.size(), Zero);
auto& avg = tavg.ref();
forAll(faces, facei)
{
const face& f = faces[facei];
for (const label labi : f)
{
avg[facei] += intFld[labi];
}
avg[facei] /= f.size();
}
return tavg;
return sampledPtr_().sample(interp);
}
else
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment