예제 #1
0
void subsetSurfaceFields
(
    const fvMeshSubset& subsetter,
    const wordList& fieldNames,
    PtrList<GeometricField<Type, fvsPatchField, surfaceMesh> >& subFields
)
{
    const fvMesh& baseMesh = subsetter.baseMesh();

    forAll(fieldNames, i)
    {
        const word& fieldName = fieldNames[i];

        Info<< "Subsetting field " << fieldName << endl;

        GeometricField<Type, fvsPatchField, surfaceMesh> fld
        (
            IOobject
            (
                fieldName,
                baseMesh.time().timeName(),
                baseMesh,
                IOobject::MUST_READ,
                IOobject::NO_WRITE
            ),
            baseMesh
        );

        subFields.set(i, subsetter.interpolate(fld));
    }
}
예제 #2
0
tmp<GeometricField<Type, fvPatchField, volMesh>>
volField
(
    const fvMeshSubset& meshSubsetter,
    const GeometricField<Type, fvPatchField, volMesh>& vf
)
{
    if (meshSubsetter.hasSubMesh())
    {
        tmp<GeometricField<Type, fvPatchField, volMesh>> tfld
        (
            meshSubsetter.interpolate(vf)
        );
        tfld.ref().checkOut();
        tfld.ref().rename(vf.name());
        return tfld;
    }
    else
    {
        return vf;
    }
}