• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ readLabel函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中readLabel函数的典型用法代码示例。如果您正苦于以下问题:C++ readLabel函数的具体用法?C++ readLabel怎么用?C++ readLabel使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: time_

//- Construct from Time and timeDict 
timeFluxData::timeFluxData
(
    Time& t,
    const dictionary& timeDict
)
:
    time_(t),
    writeInterval_(readScalar(t.controlDict().lookup("writeInterval"))),
    writeIntSteps_(label(writeInterval_/t.deltaT().value() + 0.5)),
    mdTime_(1, readScalar(time_.controlDict().lookup("deltaT"))),
    averagingTime_(readLabel(timeDict.lookup("nAverages"))),
    controlTime_(readLabel(timeDict.lookup("nControls"))),
    writeTime_(writeIntSteps_, writeInterval_),
    nAvTimeSteps_("nAvTimeSteps_", dimless, 0.0),
    nControlSteps_(0.0),
    totalNAvSteps_(0),
    totalNContSteps_(0),
    totalNWrSteps_(0),
    controlTimeIndex_(0),
    averagingTimeIndex_(0)
//     controlTimes_(),
//     averagingTimes_()
{
    setInitialData();
}
开发者ID:BijanZarif,项目名称:OpenFOAM-2.4.0-MNF,代码行数:26,代码来源:timeFluxData.C


示例2: nHeaderLine_

Foam::Function1Types::CSV<Type>::CSV
(
    const word& entryName,
    const dictionary& dict
)
:
    TableBase<Type>(entryName, dict),
    nHeaderLine_(readLabel(dict.lookup("nHeaderLine"))),
    refColumn_(readLabel(dict.lookup("refColumn"))),
    componentColumns_(dict.lookup("componentColumns")),
    separator_(dict.lookupOrDefault<string>("separator", string(","))[0]),
    mergeSeparators_(readBool(dict.lookup("mergeSeparators"))),
    fName_(dict.lookup("file"))
{
    if (componentColumns_.size() != pTraits<Type>::nComponents)
    {
        FatalErrorInFunction
            << componentColumns_ << " does not have the expected length of "
            << pTraits<Type>::nComponents << endl
            << exit(FatalError);
    }

    read();

    TableBase<Type>::check();
}
开发者ID:jheylmun,项目名称:OpenFOAM-dev,代码行数:26,代码来源:CSV.C


示例3: patchIdentifier

Foam::polyPatch::polyPatch
(
    const word& name,
    const dictionary& dict,
    const label index,
    const polyBoundaryMesh& bm,
    const word& patchType
)
:
    patchIdentifier(name, dict, index),
    primitivePatch
    (
        faceSubList
        (
            bm.mesh().faces(),
            readLabel(dict.lookup("nFaces")),
            readLabel(dict.lookup("startFace"))
        ),
        bm.mesh().points()
    ),
    start_(readLabel(dict.lookup("startFace"))),
    boundaryMesh_(bm),
    faceCellsPtr_(NULL),
    mePtr_(NULL)
{
    if
    (
        patchType != word::null
     && constraintType(patchType)
     && findIndex(inGroups(), patchType) == -1
    )
    {
        inGroups().append(patchType);
    }
}
开发者ID:Al-th,项目名称:OpenFOAM-2.2.x,代码行数:35,代码来源:polyPatch.C


示例4: maxGlobalCells_

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

    if (featAngle < 0 || featAngle > 180)
    {
        curvature_ = -GREAT;
    }
    else
    {
        curvature_ = Foam::cos(featAngle*mathematicalConstant::pi/180.0);
    }
}
开发者ID:Brzous,项目名称:WindFOAM,代码行数:28,代码来源:refinementParameters.C


示例5: error

Foam::IOerror::IOerror(const dictionary& errDict)
:
    error(errDict),
    ioFileName_(errDict.lookup("ioFileName")),
    ioStartLineNumber_(readLabel(errDict.lookup("ioStartLineNumber"))),
    ioEndLineNumber_(readLabel(errDict.lookup("ioEndLineNumber")))
{}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:7,代码来源:IOerror.C


示例6: coeffs_

Foam::CSV<Type>::CSV
(
    const word& entryName,
    const dictionary& dict,
    const word& ext
)
:
    DataEntry<Type>(entryName),
    TableBase<Type>(entryName, dict.subDict(type() + ext)),
    coeffs_(dict.subDict(type() + ext)),
    nHeaderLine_(readLabel(coeffs_.lookup("nHeaderLine"))),
    refColumn_(readLabel(coeffs_.lookup("refColumn"))),
    componentColumns_(coeffs_.lookup("componentColumns")),
    separator_(coeffs_.lookupOrDefault<string>("separator", string(","))[0]),
    mergeSeparators_(readBool(coeffs_.lookup("mergeSeparators"))),
    fName_(coeffs_.lookup("fileName"))
{
    if (componentColumns_.size() != pTraits<Type>::nComponents)
    {
        FatalErrorIn("Foam::CSV<Type>::CSV(const word&, Istream&)")
            << componentColumns_ << " does not have the expected length of "
            << pTraits<Type>::nComponents << endl
            << exit(FatalError);
    }

    read();

    TableBase<Type>::check();
}
开发者ID:Al-th,项目名称:OpenFOAM-2.2.x,代码行数:29,代码来源:CSV.C


示例7: geometricSurfacePatch

// Construct from Istream
Foam::surfacePatch::surfacePatch(Istream& is, const label index)
:
    geometricSurfacePatch(is, index),
    size_(0),
    start_(0)
{
    size_ = readLabel(is);
    start_ = readLabel(is);
}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:10,代码来源:surfacePatch.C


示例8: faceCells_

Foam::procLduInterface::procLduInterface(Istream& is)
:
    faceCells_(is),
    coeffs_(is),
    myProcNo_(readLabel(is)),
    neighbProcNo_(readLabel(is)),
    tag_(readLabel(is)),
    comm_(readLabel(is))
{}
开发者ID:Kiiree,项目名称:CONSELFcae-dev,代码行数:9,代码来源:procLduInterface.C


示例9: injectorType

// Construct from components
Foam::multiHoleInjector::multiHoleInjector
(
    const Foam::Time& t,
    const Foam::dictionary& dict
)
:
    injectorType(t, dict),
    propsDict_(dict.subDict(typeName + "Props")),
    centerPosition_(propsDict_.lookup("position")),
    xyAngle_(readScalar(propsDict_.lookup("xyAngle"))),
    zAngle_(readScalar(propsDict_.lookup("zAngle"))),
    nHoles_(readLabel(propsDict_.lookup("nHoles"))),
    umbrellaAngle_(readScalar(propsDict_.lookup("umbrellaAngle"))),
    nozzleTipDiameter_(readScalar(propsDict_.lookup("nozzleTipDiameter"))),
    angleSpacing_(propsDict_.lookup("angleSpacing")),
    d_(readScalar(propsDict_.lookup("diameter"))),
    Cd_(readScalar(propsDict_.lookup("Cd"))),
    mass_(readScalar(propsDict_.lookup("mass"))),
    nParcels_(readLabel(propsDict_.lookup("nParcels"))),
    X_(propsDict_.lookup("X")),
    massFlowRateProfile_(propsDict_.lookup("massFlowRateProfile")),
    velocityProfile_(massFlowRateProfile_),
    injectionPressureProfile_(massFlowRateProfile_),
    CdProfile_(massFlowRateProfile_),
    TProfile_(propsDict_.lookup("temperatureProfile")),
    averageParcelMass_(nHoles_*mass_/nParcels_),
    direction_(nHoles_),
    position_(nHoles_),
    pressureIndependentVelocity_(true),
    tangentialInjectionVector1_(nHoles_),
    tangentialInjectionVector2_(nHoles_)
{


    // check if time entries for soi and eoi match
    if (mag(massFlowRateProfile_[0][0]-TProfile_[0][0]) > SMALL)
    {
        FatalError << "multiHoleInjector::multiHoleInjector(const time& t, const dictionary dict) " << endl
            << " start-times do not match for TemperatureProfile and massFlowRateProfile."
            << abort(FatalError);
    }

    if (mag(massFlowRateProfile_[massFlowRateProfile_.size()-1][0]-TProfile_[TProfile_.size()-1][0]) > SMALL)
    {
        FatalError << "multiHoleInjector::multiHoleInjector(const time& t, const dictionary dict) " << endl
            << " end-times do not match for TemperatureProfile and massFlowRateProfile."
            << abort(FatalError);
    }

    // convert CA to real time
    forAll(massFlowRateProfile_, i)
    {
        massFlowRateProfile_[i][0] = t.userTimeToTime(massFlowRateProfile_[i][0]);
        velocityProfile_[i][0] = massFlowRateProfile_[i][0];
        injectionPressureProfile_[i][0] = massFlowRateProfile_[i][0];
    }
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:57,代码来源:multiHoleInjector.C


示例10: nAverages

void timeFluxData::setTimeData(const dictionary& timeDict)
{
    const label nAverages(readLabel(timeDict.lookup("nAverages")));
    const label nControls(readLabel(timeDict.lookup("nControls")));
 
    averagingTime_.nSteps() = nAverages;
    controlTime_.nSteps() = nControls;

    setInitialData();
}
开发者ID:BijanZarif,项目名称:OpenFOAM-2.4.0-MNF,代码行数:10,代码来源:timeFluxData.C


示例11: engineSearch

// Construct from components
engineSearchIB::engineSearchIB
(
    const dictionary& dict,
    cfdemCloud& sm
)
:
    engineSearch(dict.subDict(typeName + "Props"),sm),
    propsDict_(dict.subDict(typeName + "Props")),
    zSplit_(readLabel(propsDict_.lookup("zSplit"))),
    xySplit_(readLabel(propsDict_.lookup("xySplit")))
{}
开发者ID:hbweigao,项目名称:CFDEMcoupling-PUBLIC,代码行数:12,代码来源:engineSearchIB.C


示例12: origProcOfOther_

Foam::PairCollisionRecord<Type>::PairCollisionRecord(Istream& is)
:
    origProcOfOther_(readLabel(is)),
    origIdOfOther_(readLabel(is)),
    data_(is)
{
    // Check state of Istream
    is.check
    (
        "Foam::PairCollisionRecord<Type>::PairCollisionRecord(Foam::Istream&)"
    );
}
开发者ID:Washino,项目名称:WM_PROJECT_USER_DIR,代码行数:12,代码来源:PairCollisionRecordIO.C


示例13: tolerance_

Foam::BlockIterativeSolver<Type>::BlockIterativeSolver
(
    const word& fieldName,
    const BlockLduMatrix<Type>& matrix,
    const dictionary& dict
)
:
    BlockLduSolver<Type>(fieldName, matrix, dict),
    tolerance_(readScalar(this->dict().lookup("tolerance"))),
    relTolerance_(readScalar(this->dict().lookup("relTol"))),
    minIter_(readLabel(this->dict().lookup("minIter"))),
    maxIter_(readLabel(this->dict().lookup("maxIter")))
{}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:13,代码来源:BlockIterativeSolver.C


示例14: trackInterval_

Foam::ParticleTracks<CloudType>::ParticleTracks
(
    const dictionary& dict,
    CloudType& owner
)
:
    CloudFunctionObject<CloudType>(dict, owner, typeName),
    trackInterval_(readLabel(this->coeffDict().lookup("trackInterval"))),
    maxSamples_(readLabel(this->coeffDict().lookup("maxSamples"))),
    resetOnWrite_(this->coeffDict().lookup("resetOnWrite")),
    faceHitCounter_(),
    cloudPtr_(NULL)
{}
开发者ID:daphilips,项目名称:philipsFOAM,代码行数:13,代码来源:ParticleTracks.C


示例15: N0

pointField quadrilateralDistribution::evaluate()
{
    // Read needed material
    label N0( readLabel(pointDict_.lookup("N0")) );
    label N1( readLabel(pointDict_.lookup("N1")) );

    point xs0( pointDict_.lookup("linestart0") );
    point xe0( pointDict_.lookup("lineend0") );
    point xe1( pointDict_.lookup("lineend1") );

    scalar stretch0( pointDict_.lookupOrDefault<scalar>("stretch0", 1.0) );
    scalar stretch1( pointDict_.lookupOrDefault<scalar>("stretch1", 1.0) );

    // Define the return field
    pointField res(N0*N1, xs0);

    // Compute the scaling factor
    scalar factor0(0.0);
    scalar factor1(0.0);

    for (int i=1; i < N0; i++)
    {
        factor0 += Foam::pow( stretch0, static_cast<scalar>(i) );
    }

    for (int i=1; i < N1; i++)
    {
        factor1 += Foam::pow( stretch1, static_cast<scalar>(i) );
    }

    point dx0( (xe0 - xs0)/factor0 );
    point dx1( (xe1 - xs0)/factor1 );

    // Compute points
    for (int j=0; j < N1; j++)
    {
        if (j != 0)
        {
            res[j*N0] = res[(j - 1)*N0]
                + Foam::pow( stretch1, static_cast<scalar>(j))*dx1;
        }

        for (int i=1; i < N0; i++)
        {
            res[i + j*N0] = res[i - 1 + j*N0]
                + Foam::pow( stretch0, static_cast<scalar>(i) )*dx0;
        }
    }

    return res;
}
开发者ID:Aidan-Bharath,项目名称:waves2Foam,代码行数:51,代码来源:quadrilateralDistribution.C


示例16: nSamples

void timeData::setTimeData(const dictionary& timeDict)
{
    const label nSamples(readLabel(timeDict.lookup("nSamples")));
    const label nAverages(readLabel(timeDict.lookup("nAverages")));
//     const label nCalcProp(readLabel(timeDict.lookup("nCalcProp")));
    const label nControls(readLabel(timeDict.lookup("nControls")));

    samplingTime_.nSteps() = nSamples;
    averagingTime_.nSteps() = nAverages;
//     calcPropTime_.nSteps() = nCalcProp;
    controlTime_.nSteps() = nControls;

    setInitialData();
}
开发者ID:MicroNanoFlows,项目名称:OpenFOAM-2.4.0-MNF,代码行数:14,代码来源:timeData.C


示例17: maxGlobalCells_

// Construct from dictionary
Foam::refinementParameters::refinementParameters
(
    const dictionary& dict,
    const label dummy
)
:
    maxGlobalCells_(readLabel(dict.lookup("cellLimit"))),
    maxLocalCells_(readLabel(dict.lookup("procCellLimit"))),
    minRefineCells_(readLabel(dict.lookup("minimumRefine"))),
    curvature_(readScalar(dict.lookup("curvature"))),
    nBufferLayers_(readLabel(dict.lookup("nBufferLayers"))),
    keepPoints_(dict.lookup("keepPoints")),
    allowFreeStandingZoneFaces_(dict.lookup("allowFreeStandingZoneFaces")),
    maxLoadUnbalance_(dict.lookupOrDefault<scalar>("maxLoadUnbalance",0))
{}
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:16,代码来源:refinementParameters.C


示例18: fixedValueFvPatchVectorField

Foam::activeBaffleVelocityFvPatchVectorField::
activeBaffleVelocityFvPatchVectorField
(
    const fvPatch& p,
    const DimensionedField<vector, volMesh>& iF,
    const dictionary& dict
)
:
    fixedValueFvPatchVectorField(p, iF),
    pName_("p"),
    cyclicPatchName_(dict.lookup("cyclicPatch")),
    cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
    orientation_(readLabel(dict.lookup("orientation"))),
    initWallSf_(p.Sf()),
    initCyclicSf_(p.boundaryMesh()[cyclicPatchLabel_].Sf()),
    openFraction_(readScalar(dict.lookup("openFraction"))),
    openingTime_(readScalar(dict.lookup("openingTime"))),
    maxOpenFractionDelta_(readScalar(dict.lookup("maxOpenFractionDelta"))),
    curTimeIndex_(-1)
{
    fvPatchVectorField::operator=(vector::zero);

    if (dict.found("p"))
    {
        dict.lookup("p") >> pName_;
    }
开发者ID:Haider-BA,项目名称:foam-extend-3.0,代码行数:26,代码来源:activeBaffleVelocityFvPatchVectorField.C


示例19: pointsFile_

Foam::fileControl::fileControl
(
    const Time& runTime,
    const word& name,
    const dictionary& controlFunctionDict,
    const conformationSurfaces& geometryToConformTo,
    const scalar& defaultCellSize
)
:
    cellSizeAndAlignmentControl
    (
        runTime,
        name,
        controlFunctionDict,
        geometryToConformTo,
        defaultCellSize
    ),
    pointsFile_(controlFunctionDict.lookup("pointsFile")),
    sizesFile_(controlFunctionDict.lookup("sizesFile")),
    alignmentsFile_(controlFunctionDict.lookup("alignmentsFile")),
    maxPriority_(readLabel(controlFunctionDict.lookup("priority")))
{
    Info<< indent << "Loading " << name << " from file:" << nl
        << indent << "    priority   : " << maxPriority_ << nl
        << indent << "    points     : " << pointsFile_ << nl
        << indent << "    sizes      : " << sizesFile_ << nl
        << indent << "    alignments : " << alignmentsFile_
        << endl;
}
开发者ID:EricAlex,项目名称:OpenFOAM-dev,代码行数:29,代码来源:fileControl.C


示例20: while

/**
 * @brief Reads an object from `reader`. An object is a valid JSON structure.
 * @param reader The JSONReader.
 * @return The object.
 */
static Dictionary *readObject(JSONReader *reader) {

	MutableDictionary *object = $(alloc(MutableDictionary), init);

	while (true) {

		String *key = readLabel(reader);
		if (key == NULL) {
			const int b = readByteUntil(reader, "}");
			assert(b == '}');
			break;
		}

		const int b = readByteUntil(reader, ":");
		assert(b == ':');

		ident obj = readElement(reader);
		assert(obj);

		$(object, setObjectForKey, obj, key);

		release(key);
		release(obj);
	}

	return (Dictionary *) object;
}
开发者ID:jdolan,项目名称:Objectively,代码行数:32,代码来源:JSONSerialization.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ readLine函数代码示例发布时间:2022-05-30
下一篇:
C++ readInternal函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap