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


C++ dimensionSet::dimensionless方法代码示例

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


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

示例1: FatalErrorIn

void Foam::equationReader::evalDimsYnDimCheck
(
    const equationReader * eqnReader,
    const label index,
    const label i,
    const label storageOffset,
    label& storeIndex,
    dimensionSet& xDims,
    dimensionSet sourceDims
) const
{
    if
    (
        (!sourceDims.dimensionless() || !xDims.dimensionless())
     && dimensionSet::debug
    )
    {
        FatalErrorIn("equationReader::evalDimsYnDimCheck")
            << "Dimension error thrown for operation ["
            << equationOperation::opName
            (
                operator[](index)[i].operation()
            )
            << "] in equation " << operator[](index).name()
            << ", given by:" << token::NL << token::TAB
            << operator[](index).rawText() << token::NL
            << "yn(a, b) - a and b must be dimensionless."
            << abort(FatalError);
    }
    xDims.reset(dimless);
    operator[](index)[i].assignOpDimsFunction
    (
        &Foam::equationReader::evalDimsYn
    );
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-libraries-equationReaderExtension,代码行数:35,代码来源:equationReaderEvalDimsP.C

示例2: ds

void Foam::equationReader::evalDimsAcosDimCheck
(
    const equationReader * eqnReader,
    const label index,
    const label i,
    const label storageOffset,
    label& storeIndex,
    dimensionSet& xDims,
    dimensionSet sourceDims
) const
{
    if
    (
        !xDims.dimensionless() && dimensionSet::debug
    )
    {
        WarningIn("equationReader::evalDimsAcosDimCheck")
            << "Dimension error thrown for operation ["
            << equationOperation::opName
            (
                operator[](index)[i].operation()
            )
            << "] in equation " << operator[](index).name()
            << ", given by:" << token::NL << token::TAB
            << operator[](index).rawText();
    }
    dimensionedScalar ds("temp", xDims, 0.0);
    xDims.reset(acos(ds).dimensions());
    operator[](index)[i].assignOpDimsFunction
    (
        &Foam::equationReader::evalDimsAcos
    );
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-libraries-equationReaderExtension,代码行数:33,代码来源:equationReaderEvalDimsP.C

示例3: eqn

void Foam::equationReader::evalDimsPowDimCheck
(
    const equationReader * eqnReader,
    const label index,
    const label i,
    const label storageOffset,
    label& storeIndex,
    dimensionSet& xDims,
    dimensionSet sourceDims
) const
{
    const equation& eqn(operator[](index));
    const equationOperation& scalarEqOp(eqn[i]);

    if (scalarEqOp.sourceType() == equationOperation::ststorage)
    {
        FatalErrorIn("equationReader::evalDimsPowCheck")
            << "Bad source for pow() function.  This shouldn't happen and is "
            << "a bug.  Try reducing the exponent part of your pow function "
            << "a single term if possible.  Equation in question is:"
            << operator[](index).name() << ", given by:" << token::NL
            << token::TAB << operator[](index).rawText()
            << abort(FatalError);
    }

    if
    (
        !sourceDims.dimensionless() && dimensionSet::debug
    )
    {
        WarningIn("equationReader::evalDimsPowDimCheck")
            << "Dimension error thrown for operation ["
            << equationOperation::opName
            (
                operator[](index)[i].operation()
            )
            << "] in equation " << operator[](index).name()
            << ", given by:" << token::NL << token::TAB
            << operator[](index).rawText();
    }
    scalar source
    (
        eqn[i].getSourceScalarFunction
        (
            this,
            index,
            i,
            0,
            0
        )
    );
    xDims = pow(xDims, source);
    operator[](index)[i].assignOpDimsFunction
    (
        &Foam::equationReader::evalDimsPow
    );
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-libraries-equationReaderExtension,代码行数:57,代码来源:equationReaderEvalDimsP.C

示例4: trans

Foam::dimensionSet Foam::trans(const dimensionSet& ds)
{
    if (dimensionSet::debug && !ds.dimensionless())
    {
        FatalErrorInFunction
            << "Argument of trancendental function not dimensionless"
            << abort(FatalError);
    }

    return ds;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:11,代码来源:dimensionSet.C

示例5: FatalErrorIn

Foam::dimensionSet Foam::pow
(
    const dimensionedScalar& dS,
    const dimensionSet& ds
)
{
    if
    (
        dimensionSet::debug
     && !dS.dimensions().dimensionless()
     && !ds.dimensionless())
    {
        FatalErrorIn("pow(const dimensionedScalar& dS, const dimensionSet& ds)")
            << "Argument or exponent of pow not dimensionless" << endl
            << abort(FatalError);
    }

    return ds;
}
开发者ID:Ingenierias2003,项目名称:OpenFOAM-1.7.x,代码行数:19,代码来源:dimensionSet.C


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