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


C++ argList::executable方法代码示例

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


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

示例1: calc


//.........这里部分代码省略.........

                autoPtr<compressible::LESModel> sgsModel
                (
                    compressible::LESModel::New(rho, U, phi, thermo())
                );

                PePtr.set
                (
                    new surfaceScalarField
                    (
                        IOobject
                        (
                            "Pe",
                            runTime.timeName(),
                            mesh,
                            IOobject::NO_READ
                        ),
                        mag(phi)
                        /(
                            mesh.magSf()
                            * mesh.surfaceInterpolation::deltaCoeffs()
                            * fvc::interpolate(sgsModel->muEff())
                        )
                    )
                );
            }
            else
            {
                IOdictionary transportProperties
                (
                    IOobject
                    (
                        "transportProperties",
                        runTime.constant(),
                        mesh,
                        IOobject::MUST_READ,
                        IOobject::NO_WRITE
                    )
                );

                dimensionedScalar mu(transportProperties.lookup("mu"));

                PePtr.set
                (
                    new surfaceScalarField
                    (
                        IOobject
                        (
                            "Pe",
                            runTime.timeName(),
                            mesh,
                            IOobject::NO_READ
                        ),
                        mesh.surfaceInterpolation::deltaCoeffs()
                        * (mag(phi)/(mesh.magSf()))*(runTime.deltaT()/mu)
                    )
                );
            }
        }
        else
        {
            FatalErrorIn(args.executable())
                    << "Incorrect dimensions of phi: " << phi.dimensions()
                    << abort(FatalError);
        }


        // can also check how many cells exceed a particular Pe limit
        /*
        {
            label count = 0;
            label PeLimit = 200;
            forAll(PePtr(), i)
            {
                if (PePtr()[i] > PeLimit)
                {
                    count++;
                }

            }

            Info<< "Fraction > " << PeLimit << " = "
                << scalar(count)/Pe.size() << endl;
        }
        */

        Info << "Pe max : " << max(PePtr()).value() << endl;

        if (writeResults)
        {
            PePtr().write();
        }
    }
    else
    {
        Info<< "    No phi" << endl;
    }

    Info<< "\nEnd\n" << endl;
}
开发者ID:Cescfangs,项目名称:OpenFOAM-1.7.x,代码行数:101,代码来源:Pe.C

示例2: objects


//.........这里部分代码省略.........
                    (
                        "transportProperties",
                        runTime.constant(),
                        mesh,
                        IOobject::MUST_READ_IF_MODIFIED,
                        IOobject::NO_WRITE
                    )
                );

                fol.execute(true);
            }
        }
        else if (phi.dimensions() == dimMass/dimTime)
        {
            autoPtr<fluidThermo> thermo(fluidThermo::New(mesh));

            volScalarField rho
            (
                IOobject
                (
                    "rho",
                    runTime.timeName(),
                    mesh
                ),
                thermo->rho()
            );

            IOobject RASPropertiesHeader
            (
                "RASProperties",
                runTime.constant(),
                mesh,
                IOobject::MUST_READ_IF_MODIFIED,
                IOobject::NO_WRITE,
                false
            );

            IOobject LESPropertiesHeader
            (
                "LESProperties",
                runTime.constant(),
                mesh,
                IOobject::MUST_READ_IF_MODIFIED,
                IOobject::NO_WRITE,
                false
            );

            if (RASPropertiesHeader.headerOk())
            {
                IOdictionary RASProperties(RASPropertiesHeader);

                autoPtr<compressible::RASModel> RASModel
                (
                    compressible::RASModel::New
                    (
                        rho,
                        U,
                        phi,
                        thermo()
                    )
                );

                fol.execute(true);
            }
            else if (LESPropertiesHeader.headerOk())
            {
                IOdictionary LESProperties(LESPropertiesHeader);

                autoPtr<compressible::LESModel> sgsModel
                (
                    compressible::LESModel::New(rho, U, phi, thermo())
                );

                fol.execute(true);
            }
            else
            {
                IOdictionary transportProperties
                (
                    IOobject
                    (
                        "transportProperties",
                        runTime.constant(),
                        mesh,
                        IOobject::MUST_READ_IF_MODIFIED,
                        IOobject::NO_WRITE
                    )
                );

                fol.execute(true);
            }
        }
        else
        {
            FatalErrorIn(args.executable())
                << "Incorrect dimensions of phi: " << phi.dimensions()
                << nl << exit(FatalError);
        }
    }
}
开发者ID:Al-th,项目名称:OpenFOAM-2.2.x,代码行数:101,代码来源:execFlowFunctionObjects.C

示例3: calc

void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh)
{
    bool writeResults = !args.optionFound("noWrite");

    IOobject phiHeader
    (
        "phi",
        runTime.timeName(),
        mesh,
        IOobject::MUST_READ
    );

    if (phiHeader.headerOk())
    {
        volScalarField Co
        (
            IOobject
            (
                "Co",
                runTime.timeName(),
                mesh,
                IOobject::NO_READ
            ),
            mesh,
            dimensionedScalar("0", dimless, 0),
            zeroGradientFvPatchScalarField::typeName
        );

        Info<< "    Reading phi" << endl;
        surfaceScalarField phi(phiHeader, mesh);

        if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0))
        {
            Info<< "    Calculating compressible Co" << endl;

            Info<< "    Reading rho" << endl;
            volScalarField rho
            (
                IOobject
                (
                    "rho",
                    runTime.timeName(),
                    mesh,
                    IOobject::MUST_READ
                ),
                mesh
            );

            Co.dimensionedInternalField() =
                (0.5*runTime.deltaT())
               *fvc::surfaceSum(mag(phi))().dimensionedInternalField()
               /(rho*mesh.V());
            Co.correctBoundaryConditions();
        }
        else if (phi.dimensions() == dimensionSet(0, 3, -1, 0, 0))
        {
            Info<< "    Calculating incompressible Co" << endl;

            Co.dimensionedInternalField() =
                (0.5*runTime.deltaT())
               *fvc::surfaceSum(mag(phi))().dimensionedInternalField()
               /mesh.V();
            Co.correctBoundaryConditions();
        }
        else
        {
            FatalErrorIn(args.executable())
                << "Incorrect dimensions of phi: " << phi.dimensions()
                << abort(FatalError);
        }

        Info<< "Co max : " << max(Co).value() << endl;

        if (writeResults)
        {
            Co.write();
        }
    }
    else
    {
        Info<< "    No phi" << endl;
    }

    Info<< "\nEnd\n" << endl;
}
开发者ID:000861,项目名称:OpenFOAM-2.1.x,代码行数:85,代码来源:Co.C


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