Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
(
    const fvPatchField<Type>& ptf,
    const fvPatch& p,
    const DimensionedField<Type, volMesh>& iF,
    const fvPatchFieldMapper& pfMapper
)
{
    if (debug)
    {
        Info<< "fvPatchField<Type>::New(const fvPatchField<Type>&, "
               "const fvPatch&, const DimensionedField<Type, volMesh>&, "
               "const fvPatchFieldMapper&) : "
               "constructing fvPatchField<Type>"
            << endl;
    }

    typename patchMapperConstructorTable::iterator cstrIter =
        patchMapperConstructorTablePtr_->find(ptf.type());

    if (cstrIter == patchMapperConstructorTablePtr_->end())
    {
        FatalErrorIn
        (
            "fvPatchField<Type>::New(const fvPatchField<Type>&, "
            "const fvPatch&, const DimensionedField<Type, volMesh>&, "
            "const fvPatchFieldMapper&)"
        )   << "Unknown patchField type " << ptf.type() << nl << nl
            << "Valid patchField types are :" << endl
            << patchMapperConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return cstrIter()(ptf, p, iF, pfMapper);
}
tmp<fvPatchField<Type> > fvPatchField<Type>::NewCalculatedType
(
    const fvPatchField<Type2>& pf
)
{
    typename patchConstructorTable::iterator patchTypeCstrIter =
        patchConstructorTablePtr_->find(pf.patch().type());

    if (patchTypeCstrIter != patchConstructorTablePtr_->end())
    {
        return patchTypeCstrIter()
        (
            pf.patch(),
            DimensionedField<Type, volMesh>::null()
        );
    }
    else
    {
        return tmp<fvPatchField<Type> >
        (
            new calculatedFvPatchField<Type>
            (
                pf.patch(),
                DimensionedField<Type, volMesh>::null()
            )
        );
    }
}
Foam::tmp<Foam::fvPatchField<Type>> Foam::fvPatchField<Type>::NewCalculatedType
(
    const fvPatchField<Type2>& pf
)
{
    return NewCalculatedType(pf.patch());
}
Esempio n. 4
0
void Foam::fvPatchField<Type>::operator/=
(
    const fvPatchField<scalar>& ptf
)
{
    if (&patch_ != &ptf.patch())
    {
        FatalErrorIn
        (
            "PatchField<Type>::operator/=(const fvPatchField<scalar>& ptf)"
        )   << "    incompatible patches for patch fields"
            << abort(FatalError);
    }

    Field<Type>::operator/=(ptf);
}