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

C++ dimensionSet类代码示例

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

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



在下文中一共展示了dimensionSet类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: WarningIn

void Foam::equationReader::evalDimsMinDimCheck
(
    const equationReader * eqnReader,
    const label index,
    const label i,
    const label storageOffset,
    label& storeIndex,
    dimensionSet& xDims,
    dimensionSet sourceDims
) const
{
    if
    (
        dimensionSet::debug
     && (xDims != sourceDims)
    )
    {
        WarningIn("equationReader::evalMinDimCheck")
            << "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();
    }
    xDims.reset(min(xDims, sourceDims));
    operator[](index)[i].assignOpDimsFunction
    (
        &Foam::equationReader::evalDimsMin
    );
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-libraries-equationReaderExtension,代码行数:33,代码来源:equationReaderEvalDimsP.C


示例4: 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


示例5: 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


示例6:

void Foam::equationReader::evalDimsRetrieve
(
    const equationReader * eqnReader,
    const label index,
    const label i,
    const label storageOffset,
    label& storeIndex,
    dimensionSet& xDims,
    dimensionSet sourceDims
) const
{
    xDims.reset(sourceDims);
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-libraries-equationReaderExtension,代码行数:13,代码来源:equationReaderEvalDimsP.C


示例7: 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


示例8: dimensionSet

void Foam::equationReader::evalDimsStore
(
    const equationReader * eqnReader,
    const label index,
    const label i,
    const label storageOffset,
    label& storeIndex,
    dimensionSet& xDims,
    dimensionSet sourceDims
) const
{
    storeIndex++;
    storageDims_.setSize(storeIndex + storageOffset + 1);
    storageDims_.set
    (
        storeIndex + storageOffset,
        new dimensionSet(xDims)
    );
    xDims.reset(dimless);
}
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-libraries-equationReaderExtension,代码行数:20,代码来源:equationReaderEvalDimsP.C



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ dimensioned类代码示例发布时间:2022-05-31
下一篇:
C++ dim4类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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