mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
committed by
Andrew Heather
parent
8a7d8e74fe
commit
71e6e10458
@ -211,7 +211,7 @@ class surfaceFieldValue
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Public data types
|
// Public Data Types
|
||||||
|
|
||||||
//- Region type enumeration
|
//- Region type enumeration
|
||||||
enum regionTypes
|
enum regionTypes
|
||||||
|
|||||||
@ -98,25 +98,8 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues
|
|||||||
if (sampledPtr_().interpolate())
|
if (sampledPtr_().interpolate())
|
||||||
{
|
{
|
||||||
const interpolationCellPoint<Type> interp(fld);
|
const interpolationCellPoint<Type> interp(fld);
|
||||||
tmp<Field<Type>> tintFld(sampledPtr_().interpolate(interp));
|
|
||||||
const Field<Type>& intFld = tintFld();
|
|
||||||
|
|
||||||
// Average
|
return sampledPtr_().sample(interp);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user