directionInterpolate.H 747 Bytes
Newer Older
shunbo's avatar
shunbo committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace Foam
{

//- Interpolate field vf according to direction dir
template<class Type>
tmp<GeometricgpuField<Type, fvsPatchgpuField, gpusurfaceMesh>> interpolate
(
    const GeometricgpuField<Type, fvPatchgpuField, gpuvolMesh>& vf,
    const surfaceScalargpuField& dir,
    const word& reconFieldName = word::null
)
{
    tmp<GeometricgpuField<Type, fvsPatchgpuField, gpusurfaceMesh>> tsf
    (
        fvc::interpolate
        (
            vf,
            dir,
            "reconstruct("
          + (reconFieldName != word::null ? reconFieldName : vf.name())
          + ')'
        )
    );

    GeometricgpuField<Type, fvsPatchgpuField, gpusurfaceMesh>& sf = tsf.ref();

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

    return tsf;
}

}