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


C++ tensor::T方法代码示例

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


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

示例1: d

Foam::porosityZone::porosityZone
(
    const word& name,
    const fvMesh& mesh,
    const dictionary& dict
)
:
    name_(name),
    mesh_(mesh),
    dict_(dict),
    cellZoneID_(mesh_.cellZones().findZoneID(name)),

#if EXTBRANCH==1
    coordSys_(dict, mesh),
#elif OFPLUSBRANCH==1
    coordSys_(mesh, dict),
#else
    #if OFVERSION<230
        coordSys_(dict, mesh),
    #else
        coordSys_(mesh, dict),
    #endif
#endif

//#if OFVERSION<230 || EXTBRANCH == 1
//    coordSys_(dict, mesh),
//#else
//    coordSys_(mesh, dict),
//#endif

    porosity_( readScalar( dict_.lookup("porosity") ) ),
    addedMassCoeff_( readScalar( dict_.lookup("gammaAddedMass") ) ),
    D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
    F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
{
    Info<< "Creating porous zone: " << name_ << endl;

    autoPtr<Foam::porosityCoefficient> pcPtr( Foam::porosityCoefficient::New( dict ) );

    bool foundZone = (cellZoneID_ != -1);
    reduce(foundZone, orOp<bool>());

    if (!foundZone && Pstream::master())
    {
        FatalErrorIn
        (
            "Foam::porosityZone::porosityZone"
            "(const fvMesh&, const word&, const dictionary&)"
        )   << "cannot find porous cellZone " << name_
            << exit(FatalError);
    }

    // porosity
    if (porosity_ <= 0.0 || porosity_ > 1.0)
    {
        FatalIOErrorIn
        (
                "Foam::porosityZone::porosityZone"
                "(const fvMesh&, const word&, const dictionary&)",
                dict_
        )
        << "out-of-range porosity value " << porosity_
        << exit(FatalIOError);
    }

    // local-to-global transformation tensor
#if EXTBRANCH==1
    const tensor& E = coordSys_.R();
#elif OFPLUSBRANCH==1
    const tensor E = coordSys_.R().R();
#else
    #if OFVERSION<230
        const tensor& E = coordSys_.R();
    #else
        const tensor E = coordSys_.R().R();
    #endif
#endif

    dimensionedVector d( pcPtr->linearCoefficient() );

    if (D_.dimensions() != d.dimensions())
    {
        FatalIOErrorIn
        (
            "Foam::porosityZone::porosityZone"
            "(const fvMesh&, const word&, const dictionary&)",
            dict_
        )   << "incorrect dimensions for d: " << d.dimensions()
        << " should be " << D_.dimensions()
        << exit(FatalIOError);
    }

    checkNegativeResistance(d);

    D_.value().xx() = d.value().x();
    D_.value().yy() = d.value().y();
    D_.value().zz() = d.value().z();
    D_.value() = (E & D_ & E.T()).value();


//.........这里部分代码省略.........
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.6-other-waves2Foam,代码行数:101,代码来源:porosityZone.C


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