当前位置: 首页>>代码示例>>C++>>正文


C++ dictionary::lookup方法代码示例

本文整理汇总了C++中dictionary::lookup方法的典型用法代码示例。如果您正苦于以下问题:C++ dictionary::lookup方法的具体用法?C++ dictionary::lookup怎么用?C++ dictionary::lookup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在dictionary的用法示例。


在下文中一共展示了dictionary::lookup方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: entryType

Foam::Function1Types::Polynomial<Type>::Polynomial
(
    const word& entryName,
    const dictionary& dict
)
:
    Function1<Type>(entryName),
    coeffs_(),
    canIntegrate_(true)
{
    Istream& is(dict.lookup(entryName));
    word entryType(is);

    is  >> coeffs_;

    if (!coeffs_.size())
    {
        FatalErrorInFunction
            << "Polynomial coefficients for entry " << this->name_
            << " are invalid (empty)" << nl << exit(FatalError);
    }

    forAll(coeffs_, i)
    {
        if (mag(coeffs_[i].second() + pTraits<Type>::one) < rootVSmall)
        {
            canIntegrate_ = false;
            break;
        }
    }

    if (debug)
    {
        if (!canIntegrate_)
        {
            WarningInFunction
                << "Polynomial " << this->name_ << " cannot be integrated"
                << endl;
        }
    }
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:41,代码来源:PolynomialEntry.C

示例2: modelType

Foam::autoPtr<Foam::thermalPhaseChangeModel>
Foam::thermalPhaseChangeModel::New
(
    const word& name,
    const dictionary& thermalPhaseChangeProperties,
    const twoPhaseThermalMixture& twoPhaseProperties,
    const volScalarField& T,
    const volScalarField& alpha1
)
{
    const word modelType(thermalPhaseChangeProperties.lookup("model"));

    Info<< "Selecting phase change model: " << modelType << endl;

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

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

    return autoPtr<thermalPhaseChangeModel>
    (
        cstrIter()
        (
            name,
            thermalPhaseChangeProperties,
            twoPhaseProperties,
            T,
            alpha1
        )
    );
}
开发者ID:MahdiNabil,项目名称:CFD-PC,代码行数:41,代码来源:newThermalPhaseChangeModel.C

示例3: abort

autoPtr<polyIntegrator> polyIntegrator::New
(
    Time& t,
    polyMoleculeCloud& molCloud,
    const dictionary& dict
)
{
    word polyIntegratorName = "velocityVerlet";
    
    if(dict.found("integrator"))
    {
        const word polyIntegratorNameTemp
        (
            dict.lookup("integrator")
        );
        
        polyIntegratorName = polyIntegratorNameTemp;
    }

    Info<< "Selecting polyIntegrator "
         << polyIntegratorName << endl;

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

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

    return autoPtr<polyIntegrator>
    (
        cstrIter()(t, molCloud, dict)
    );
}
开发者ID:BijanZarif,项目名称:OpenFOAM-2.4.0-MNF,代码行数:41,代码来源:polyIntegrator.C

示例4: rheologyLaw

// Construct from dictionary
Foam::BurgersViscoelastic::BurgersViscoelastic
(
    const word& name,
    const volSymmTensorField& sigma,
    const dictionary& dict
)
:
    rheologyLaw(name, sigma, dict),
    rho_(dict.lookup("rho")),
    k1_(dict.lookup("k1")),
    eta1_(dict.lookup("eta1")),
    k2_(dict.lookup("k2")),
    eta2_(dict.lookup("eta2")),
    nu_(dict.lookup("nu"))
{}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:16,代码来源:BurgersViscoelastic.C

示例5: rigidBodyModel

Foam::RBD::rigidBodyMotion::rigidBodyMotion
(
    const dictionary& dict
)
:
    rigidBodyModel(dict),
    motionState_(*this, dict),
    motionState0_(motionState_),
    X00_(X0_.size()),
    aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)),
    aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)),
    report_(dict.lookupOrDefault<Switch>("report", false)),
    solver_(rigidBodySolver::New(*this, dict.subDict("solver")))
{
    if (dict.found("g"))
    {
        g() = vector(dict.lookup("g"));
    }

    initialize();
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-4.x,代码行数:21,代码来源:rigidBodyMotion.C

示例6: rheologyLaw

// Construct from dictionary
Foam::multiMaterial::multiMaterial
(
    const word& name,
    const volSymmTensorField& sigma,
    const dictionary& dict
)
:
    rheologyLaw(name, sigma, dict),
    PtrList<rheologyLaw>(),
    materials_
    (
        IOobject
        (
            "materials",
            mesh().time().timeName(),
            mesh(),
            IOobject::MUST_READ,
            IOobject::AUTO_WRITE
        ),
        mesh()
    )
{
    PtrList<rheologyLaw>& laws = *this;

    PtrList<entry> lawEntries(dict.lookup("laws"));
    laws.setSize(lawEntries.size());

    forAll (laws, lawI)
    {
        laws.set
        (
            lawI,
            rheologyLaw::New
            (
                lawEntries[lawI].keyword(),
                sigma,
                lawEntries[lawI].dict()
            )
        );
    }
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:41,代码来源:multiMaterial.C

示例7: readScalar

sixDoFRigidBodyDisplacementPointPatchVectorField::
sixDoFRigidBodyDisplacementPointPatchVectorField
(
    const pointPatch& p,
    const DimensionedField<vector, pointMesh>& iF,
    const dictionary& dict
)
:
    fixedValuePointPatchField<vector>(p, iF, dict),
    motion_(dict),
    rhoInf_(1.0),
    rhoName_(dict.lookupOrDefault<word>("rhoName", "rho")),
    lookupGravity_(-1),
    g_(vector::zero),
    relaxationFactor_(dict.lookupOrDefault<scalar>("relaxationFactor", 1))
{
    if (rhoName_ == "rhoInf")
    {
        rhoInf_ = readScalar(dict.lookup("rhoInf"));
    }

    if (dict.readIfPresent("g", g_))
    {
        lookupGravity_ = -2;
    }

    if (!dict.found("value"))
    {
        updateCoeffs();
    }

    if (dict.found("initialPoints"))
    {
        initialPoints_ = vectorField("initialPoints", dict , p.size());
    }
    else
    {
        initialPoints_ = p.localPoints();
    }
}
开发者ID:0184561,项目名称:OpenFOAM-2.1.x,代码行数:40,代码来源:sixDoFRigidBodyDisplacementPointPatchVectorField.C

示例8: modelType

Foam::autoPtr<Foam::fieldValue> Foam::fieldValue::New
(
    const word& name,
    const objectRegistry& obr,
    const dictionary& dict,
    const bool loadFromFiles,
    const bool output
)
{
    const word modelType(dict.lookup("type"));

    if (output)
    {
        Info<< "Selecting " << typeName << " " << modelType << endl;
    }

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

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown " << typeName << " type "
            << modelType << nl << nl
            << "Valid " << typeName << " types are:" << nl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

    return autoPtr<fieldValue>
    (
        cstrIter()
        (
            name,
            obr,
            dict,
            loadFromFiles
        )
    );
}
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:40,代码来源:fieldValueNew.C

示例9: featAngle

Foam::refinementParameters::refinementParameters(const dictionary& dict)
:
    maxGlobalCells_(readLabel(dict.lookup("maxGlobalCells"))),
    maxLocalCells_(readLabel(dict.lookup("maxLocalCells"))),
    minRefineCells_(readLabel(dict.lookup("minRefinementCells"))),
    planarAngle_
    (
        dict.lookupOrDefault
        (
            "planarAngle",
            readScalar(dict.lookup("resolveFeatureAngle"))
        )
    ),
    nBufferLayers_(readLabel(dict.lookup("nCellsBetweenLevels"))),
    keepPoints_(pointField(1, dict.lookup("locationInMesh"))),
    allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")),
    useTopologicalSnapDetection_
    (
        dict.lookupOrDefault<bool>("useTopologicalSnapDetection", true)
    ),
    maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance", 0)),
    handleSnapProblems_
    (
        dict.lookupOrDefault<Switch>("handleSnapProblems", true)
    )
{
    scalar featAngle(readScalar(dict.lookup("resolveFeatureAngle")));

    if (featAngle < 0 || featAngle > 180)
    {
        curvature_ = -GREAT;
    }
    else
    {
        curvature_ = Foam::cos(degToRad(featAngle));
    }
}
开发者ID:Kiiree,项目名称:OpenFOAM-dev,代码行数:37,代码来源:refinementParameters.C

示例10: fixedGradientFvPatchScalarField

Foam::alphaContactAngleFvPatchScalarField::alphaContactAngleFvPatchScalarField
(
    const fvPatch& p,
    const DimensionedField<scalar, volMesh>& iF,
    const dictionary& dict
)
    :
    fixedGradientFvPatchScalarField(p, iF),
    limit_(limitControlNames_.read(dict.lookup("limit")))
{
    if (dict.found("gradient"))
    {
        gradient() = scalarField("gradient", dict, p.size());
        fixedGradientFvPatchScalarField::updateCoeffs();
        fixedGradientFvPatchScalarField::evaluate();
    }
    else
    {
        fvPatchField<scalar>::operator=(patchInternalField());
        gradient() = 0.0;
    }
}
开发者ID:Cescfangs,项目名称:OpenFOAM-1.7.x,代码行数:22,代码来源:alphaContactAngleFvPatchScalarField.C

示例11: forceType

Foam::wordList Foam::functionObjects::forces::createFileNames
(
    const dictionary& dict
) const
{
    DynamicList<word> names(1);

    const word forceType(dict.lookup("type"));
    names.append(forceType);

    if (dict.found("binData"))
    {
        const dictionary& binDict(dict.subDict("binData"));
        label nb = readLabel(binDict.lookup("nBin"));
        if (nb > 0)
        {
            names.append(forceType + "_bins");
        }
    }

    return names;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-4.x,代码行数:22,代码来源:forces.C

示例12: readLabel

Foam::GAMGAgglomeration::GAMGAgglomeration
(
    const lduMesh& mesh,
    const dictionary& dict
)
:
    MeshObject<lduMesh, GAMGAgglomeration>(mesh),

    maxLevels_(50),

    nCellsInCoarsestLevel_
    (
        readLabel(dict.lookup("nCellsInCoarsestLevel"))
    ),

    nCells_(maxLevels_),
    restrictAddressing_(maxLevels_),
    faceRestrictAddressing_(maxLevels_),

    meshLevels_(maxLevels_),
    interfaceLevels_(maxLevels_ + 1)
{}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-foam-extend-3.0,代码行数:22,代码来源:GAMGAgglomeration.C

示例13: populationBalanceModelType

Foam::autoPtr<Foam::populationBalanceModel>
Foam::populationBalanceModel::New
(
    const word& name,
    const dictionary& dict,
    const volVectorField& U,
    const surfaceScalarField& phi
)
{
    word populationBalanceModelType(dict.lookup("populationBalanceModel"));

    Info<< "Selecting populationBalanceModel "
        << populationBalanceModelType << endl;

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

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown populationBalanceModelType type "
            << populationBalanceModelType << endl << endl
            << "Valid populationBalanceModelType types are :" << endl
            << dictionaryConstructorTablePtr_->sortedToc()
            << abort(FatalError);
    }

    return
        autoPtr<populationBalanceModel>
        (
            cstrIter()
            (
                name,
                dict.subDict(populationBalanceModelType + "Coeffs"),
                U,
                phi
            )
        );
}
开发者ID:OpenQBMM,项目名称:OpenQBMM,代码行数:39,代码来源:newPopulationBalanceModel.C

示例14: variables

void Foam::addGlobalVariable::read(const dictionary& dict)
{
    if(dict.found("globalVariables")) {
        const dictionary variables(dict.subDict("globalVariables"));
        const word scope(dict.lookup("globalScope"));

        wordList names(variables.toc());
        forAll(names,i) {
            const word &name=names[i];
            const dictionary &dict=variables.subDict(name);

            ExpressionResult &res=GlobalVariablesRepository::getGlobalVariables(
                obr_
            ).addValue(
                name,
                scope,
                ExpressionResult(dict,true,true),
                false
            );
            res.noReset();
        }
    } else {
开发者ID:aliozel,项目名称:swak4Foam,代码行数:22,代码来源:addGlobalVariable.C

示例15:

Foam::
SRFcylindricalInletVelocityFvPatchVectorField::
SRFcylindricalInletVelocityFvPatchVectorField
(
    const fvPatch& p,
    const DimensionedField<vector, volMesh>& iF,
    const dictionary& dict
)
:
    fixedValueFvPatchField<vector>(p, iF, dict),
    relative_(dict.lookup("relative")),
    axis_(dict.lookup("axis")),
    centre_(dict.lookup("centre")),
    radialVelocity_(readScalar(dict.lookup("radialVelocity"))),
    tangentVelocity_(readScalar(dict.lookup("tangentVelocity"))),
    axialVelocity_(readScalar(dict.lookup("axialVelocity")))
{}
开发者ID:SirIsaac90,项目名称:openfoam-extend-Breeder2.0-OSIG-TurboMachinery,代码行数:17,代码来源:SRFcylindricalInletVelocityFvPatchVectorField.C


注:本文中的dictionary::lookup方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。