directionInterpolate.H 704 Bytes
Newer Older
1
2
3
4
5
namespace Foam
{

//- Interpolate field vf according to direction dir
template<class Type>
6
tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> interpolate
7
8
9
10
11
12
(
    const GeometricField<Type, fvPatchField, volMesh>& vf,
    const surfaceScalarField& dir,
    const word& reconFieldName = word::null
)
{
13
    tmp<GeometricField<Type, fvsPatchField, surfaceMesh>> tsf
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
    (
        fvc::interpolate
        (
            vf,
            dir,
            "reconstruct("
          + (reconFieldName != word::null ? reconFieldName : vf.name())
          + ')'
        )
    );

    GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf();

    sf.rename(vf.name() + '_' + dir.name());

    return tsf;
}

}