tmp<fvMatrix<Type> >
laplacian
(
    GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    surfaceScalarField Gamma
    (
        IOobject
        (
            "1",
            vf.time().constant(),
            vf.mesh(),
            IOobject::NO_READ
        ),
        vf.mesh(),
        dimensionedScalar("1", dimless, 1.0)
    );

    return fvm::laplacian
    (
        Gamma,
        vf,
        "laplacian(" + vf.name() + ')'
    );
}
const tmp<surfaceScalarField> interpolWeights(GeometricField<type, fvPatchField, volMesh>& vf, const word& name){

    //vf.boundaryField().updateCoeffs();
    const objectRegistry& db = vf.db();

    //const volVectorField& u = db.lookupObject<volVectorField>("vc");
    const volVectorField& u = db.lookupObject<volVectorField>("u");
    //const volVectorField& u = db.lookupObject<volVectorField>("s");

    surfaceScalarField phi
    (
        IOobject
        (
            "phi",
            vf.time().timeName(),
            vf.mesh(),
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        linearInterpolate(u) & vf.mesh().Sf()
    );

    tmp<surfaceInterpolationScheme<type> > tinterpScheme;
    tinterpScheme = fvc::scheme<type>(phi, vf.mesh().schemesDict().interpolationScheme(name));

    const surfaceInterpolationScheme<type>& interpolationScheme = tinterpScheme();

    tmp<surfaceScalarField> tweights = interpolationScheme.weights(vf);

    //Info << "weights[15]:" << tweights()[15] << endl;

    return tweights;

}
void Foam::probes::sampleAndWrite
(
    const GeometricField<Type, fvPatchField, volMesh>& vField
)
{
    Field<Type> values(sample(vField));

    if (Pstream::master())
    {
        unsigned int w = IOstream::defaultPrecision() + 7;
        OFstream& os = *probeFilePtrs_[vField.name()];

        os  << setw(w) << vField.time().timeToUserTime(vField.time().value());

        forAll(values, probeI)
        {
            os  << ' ' << setw(w) << values[probeI];
        }
        os  << endl;
    }
tmp<tetFemMatrix<Type> > tetFem::laplacian
(
    GeometricField<Type, tetPolyPatchField, tetPointMesh>& vf
)
{
    elementScalarField Gamma
    (
        IOobject
        (
            "gamma",
            vf.time().constant(),
            vf.db(),
            IOobject::NO_READ
        ),
        vf.mesh(),
        dimensionedScalar("1", dimless, 1.0)
    );

    return tetFem::laplacian(Gamma, vf);
}
void Foam::patchRtis::sampleAndWrite
(
    const GeometricField<Type, fvPatchField, volMesh>& vField
)
{
    Field<Type> values(sample(vField));

    if (Pstream::master())
    {
        unsigned int w = IOstream::defaultPrecision() + 7;
        OFstream& rtiStream = *rtiFilePtrs_[vField.name()];

        rtiStream << setw(w) << vField.time().value();

        forAll(values, rtiI)
        {
            rtiStream << ' ' << setw(w) << values[rtiI];
        }
        rtiStream << endl;
    }
tmp<faMatrix<Type> >
laplacian
(
    GeometricField<Type, faPatchField, areaMesh>& vf
)
{
    edgeScalarField Gamma
    (
        IOobject
        (
            "gamma",
            vf.time().constant(),
            vf.db(),
            IOobject::NO_READ
        ),
        vf.mesh(),
        dimensionedScalar("1", dimless, 1.0)
    );

    return fam::laplacian(Gamma, vf);
}