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'.
This commit is contained in:
Mark Olesen 2019-02-25 18:40:35 +01:00
parent 4547796ae9
commit 6297f7b0fd
2 changed files with 2 additions and 19 deletions

View File

@ -211,7 +211,7 @@ class surfaceFieldValue
{
public:
// Public data types
// Public Data Types
//- Region type enumeration
enum regionTypes

View File

@ -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
{