Пример #1
0
Foam::autoPtr<Foam::heatTransferModel> Foam::heatTransferModel::New
(
    const dictionary& interfaceDict,
    const volScalarField& alpha,
    const phaseModel& phase1,
    const phaseModel& phase2
)
{
    word heatTransferModelType
    (
        interfaceDict.lookup("heatTransferModel" + phase1.name())
    );

    Info<< "Selecting heatTransferModel for phase "
        << phase1.name()
        << ": "
        << heatTransferModelType << endl;

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(heatTransferModelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorIn("heatTransferModel::New")
            << "Unknown heatTransferModelType type "
            << heatTransferModelType << endl << endl
            << "Valid heatTransferModel types are : " << endl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return cstrIter()(interfaceDict, alpha, phase1, phase2);
}
autoPtr<heatTransferModel> heatTransferModel::New
(
    const dictionary& dict
)
{
    word heatTransferModelType
    (
        dict.lookup("heatTransferModel")
    );

    Info<< "Selecting heatTransferModel "
         << heatTransferModelType << endl;

    dictionaryConstructorTable::iterator cstrIter =
        dictionaryConstructorTablePtr_->find(heatTransferModelType);

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalError
            << "heatTransferModel::New(const dictionary&) : " << endl
            << "    unknown heatTransferModelType type "
            << heatTransferModelType
            << ", constructor not in hash table" << endl << endl
            << "    Valid heatTransferModel types are :" << endl;
        Info<< dictionaryConstructorTablePtr_->toc() << abort(FatalError);
    }

    return autoPtr<heatTransferModel>(cstrIter()(dict));
}