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:
parent
4547796ae9
commit
6297f7b0fd
@ -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
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user