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

C++ objectRegistry类代码示例

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

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



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

示例1: readDir

Foam::IOobjectList::IOobjectList
(
    const objectRegistry& db,
    const fileName& instance,
    const fileName& local,
    IOobject::readOption r,
    IOobject::writeOption w,
    bool registerObject
)
:
    HashPtrTable<IOobject>()
{
    word newInstance = instance;

    if (!isDir(db.path(instance)))
    {
        newInstance = db.time().findInstancePath(instant(instance));

        if (newInstance.empty())
        {
            return;
        }
    }

    // Create a list of file names in this directory
    fileNameList ObjectNames =
        readDir(db.path(newInstance, db.dbDir()/local), fileName::FILE);

    forAll(ObjectNames, i)
    {
        IOobject* objectPtr = new IOobject
        (
            ObjectNames[i],
            newInstance,
            local,
            db,
            r,
            w,
            registerObject
        );

        if (objectPtr->headerOk())
        {
            insert(ObjectNames[i], objectPtr);
        }
        else
        {
            delete objectPtr;
        }
    }
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:50,代码来源:IOobjectList.C


示例2: ITstream

Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
:
    IOdictionary
    (
        IOobject
        (
            dictName,
            obr.time().system(),
            obr,
            IOobject::READ_IF_PRESENT,  // Allow default dictionary creation
            IOobject::NO_WRITE
        )
    ),
    relaxationFactors_
    (
        ITstream("relaxationFactors", tokenList())()
    ),
    defaultRelaxationFactor_(0),
    solvers_(ITstream("solvers", tokenList())())
{
    if (!headerOk())
    {
        if (debug)
        {
            InfoIn
            (
                "Foam::solution::solution(const objectRegistry& obr, "
                "const fileName& dictName)"
            )   << "Solution dictionary not found.  Adding default entries"
                << endl;
        }
    }

    read();
}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:35,代码来源:solution.C


示例3: readDir

Foam::IOobjectList::IOobjectList
(
    const objectRegistry& db,
    const fileName& instance,
    const fileName& local
)
:
    HashPtrTable<IOobject>()
{
    word newInstance = instance;

    if (!isDir(db.path(instance)))
    {
        newInstance = db.time().findInstancePath(instant(instance));

        if (newInstance.empty())
        {
            return;
        }
    }

    // Create list file names in directory
    fileNameList ObjectNames =
        readDir(db.path(newInstance, db.dbDir()/local), fileName::FILE);

    forAll(ObjectNames, i)
    {
        IOobject* objectPtr = new IOobject
        (
            ObjectNames[i],
            newInstance,
            local,
            db,
            IOobject::MUST_READ,
            IOobject::NO_WRITE
        );

        if (objectPtr->headerOk())
        {
            insert(ObjectNames[i], objectPtr);
        }
        else
        {
            delete objectPtr;
        }
    }
开发者ID:Brzous,项目名称:WindFOAM,代码行数:46,代码来源:IOobjectList.C


示例4: functionObject

Foam::functionObjects::regionFunctionObject::regionFunctionObject
(
    const word& name,
    const objectRegistry& obr,
    const dictionary& dict
)
:
    functionObject(name),
    time_(obr.time()),
    obr_(obr)
{}
开发者ID:OpenFOAM,项目名称:OpenFOAM-4.x,代码行数:11,代码来源:regionFunctionObject.C


示例5:

Foam::cloud::cloud(const objectRegistry& obr, const word& cloudName)
:
    objectRegistry
    (
        IOobject
        (
            ( cloudName.size() ? cloudName : defaultName ),
            obr.time().timeName(),
            prefix,
            obr,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        )
    )
{}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:15,代码来源:cloud.C


示例6: set

Foam::data::data(const objectRegistry& obr)
:
    IOdictionary
    (
        IOobject
        (
            "data",
            obr.time().system(),
            obr,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        )
    ),
    prevTimeIndex_(0)
{
    set("solverPerformance", dictionary());
}
开发者ID:AmaneShino,项目名称:OpenFOAM-2.0.x,代码行数:17,代码来源:data.C


示例7: ddtSchemes_

faSchemes::faSchemes(const objectRegistry& obr)
    :
    IOdictionary
    (
       IOobject
       (
           "faSchemes",
           obr.time().system(),
           obr,
//             IOobject::MUST_READ,
           IOobject::READ_IF_PRESENT,  // Allow default dictionary creation
           IOobject::NO_WRITE
       )
    ),
    ddtSchemes_(ITstream("ddtSchemes", tokenList())()),
    defaultDdtScheme_("default", tokenList()),
    d2dt2Schemes_(ITstream("d2dt2Schemes", tokenList())()),
    defaultD2dt2Scheme_("default", tokenList()),
    interpolationSchemes_(ITstream("interpolationSchemes", tokenList())()),
    defaultInterpolationScheme_("default", tokenList()),
    divSchemes_(ITstream("divSchemes", tokenList())()),
    defaultDivScheme_("default", tokenList()),
    gradSchemes_(ITstream("gradSchemes", tokenList())()),
    defaultGradScheme_("default", tokenList()),
    lnGradSchemes_(ITstream("lnGradSchemes", tokenList())()),
    defaultLnGradScheme_("default", tokenList()),
    laplacianSchemes_(ITstream("laplacianSchemes", tokenList())()),
    defaultLaplacianScheme_("default", tokenList()),
    fluxRequired_(ITstream("fluxRequired", tokenList())())
{
    if (!headerOk())
    {
        if (debug)
        {
            InfoIn
            (
                "faSchemes::faSchemes(const objectRegistry& obr)"
            )   << "faSchemes dictionary not found.  Creating default."
                << endl;
        }
    }

    read();
}
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:44,代码来源:faSchemes.C


示例8:

Foam::surfaceRegistry::surfaceRegistry
(
    const objectRegistry& obr,
    const word& surfName
)
:
    objectRegistry
    (
        IOobject
        (
            ( surfName.size() ? surfName : defaultName ),
            obr.time().timeName(),
            prefix,
            obr,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        )
    )
{}
开发者ID:Cescfangs,项目名称:OpenFOAM-1.7.x,代码行数:19,代码来源:surfaceRegistry.C


示例9: OutputFilter

Foam::IOOutputFilter<OutputFilter>::IOOutputFilter
(
    const word& outputFilterName,
    const objectRegistry& obr,
    const fileName& dictName,
    const IOobject::readOption rOpt,
    const bool readFromFiles
)
:
    IOdictionary
    (
        IOobject
        (
            dictName,
            obr.time().system(),
            obr,
            rOpt,
            IOobject::NO_WRITE
        )
    ),
    OutputFilter(outputFilterName, obr, *this, readFromFiles)
{}
开发者ID:TsukasaHori,项目名称:openfoam-extend-foam-extend-3.1,代码行数:22,代码来源:IOOutputFilter.C


示例10: forAllConstIter

label TimeClone::copyObjects(const objectRegistry &src,objectRegistry &dst)
{
    Dbug << "Copying stuff from " << src.name() << " to " << dst.name() << endl;
    Dbug << "t=" << src.time().timeName() << endl;
    Dbug << "Dst AUTO_WRITE: " << (dst.writeOpt()==IOobject::AUTO_WRITE) << endl;

    label cnt=0;

    forAllConstIter(objectRegistry,src,it) {
	const word &name=it.key();
        const regIOobject &obj=*(*it);

        Dbug << name << " is class " << obj.headerClassName() << endl;

        if(isA<objectRegistry>(obj)) {
            Dbug << name << " is objectRegistry. Creating new and cloning" << endl;
            const objectRegistry &orig=dynamicCast<const objectRegistry>(obj);
            if(&src==&orig) {
                Dbug << name << "==" << src.name() << " -> Skipping" << endl;
            } else {
                word dbName=orig.name();
                if(dbName==polyMesh::defaultRegion) {
                    dbName="";
                }
                autoPtr<objectRegistry> newSubp(
                    new objectRegistry(
                        IOobject(
                            dbName,
                            src.time().timeName(),
                            src.local(),
                            dst
                        )
                    )
                );
                objectRegistry &newSub=newSubp();
                Dbug << "AUTO_WRITE: " << (newSub.writeOpt()==IOobject::AUTO_WRITE) << endl;
                Dbug << "old path: " << obj.objectPath() << endl;
                Dbug << "new Path: " << newSub.objectPath() << endl;
                Dbug << "Created registry owned by parent: " << newSub.ownedByRegistry() << endl;
                cnt+=copyObjects(orig,newSub);
                dst.store(newSubp.ptr());
                Dbug << "New registry owned by parent: " << newSub.ownedByRegistry() << endl;
            }
        } else if(obj.writeOpt()==IOobject::AUTO_WRITE) {
            Dbug << name << " set to AUTO_WRITE. Creating copy" << endl;
            autoPtr<regIOobject> newObjP;

            // work around because there is no virtual clone method in IObobject

#define tryClone(Type)                                                  \
            if(!newObjP.valid() && isA<Type>(obj)) {                    \
                newObjP.set(                                            \
                    new Type(                                           \
                        IOobject(                                       \
                            obj.name(),                                 \
                            src.time().timeName(),                      \
                            obj.local(),               \
                            dst                                         \
                        ),                                              \
                        dynamicCast<const Type>(obj)));                 \
            }

            tryClone(volScalarField);
            tryClone(volVectorField);
            tryClone(volTensorField);
            tryClone(volSymmTensorField);
            tryClone(volSphericalTensorField);

            tryClone(surfaceScalarField);
            tryClone(surfaceVectorField);
            tryClone(surfaceTensorField);
            tryClone(surfaceSymmTensorField);
            tryClone(surfaceSphericalTensorField);

            tryClone(pointScalarField);
            tryClone(pointVectorField);
            tryClone(pointTensorField);
            tryClone(pointSymmTensorField);
            tryClone(pointSphericalTensorField);

            tryClone(diagTensorIOField);
            tryClone(labelIOField);
            tryClone(pointIOField);
            tryClone(scalarIOField);
            tryClone(sphericalTensorIOField);
            tryClone(symmTensorIOField);
            tryClone(tensorIOField);
            tryClone(vector2DIOField);
            tryClone(vectorIOField);
            //            tryClone(polyBoundaryMesh);

#undef tryClone

            if(newObjP.valid()) {
                regIOobject &newObj=dynamicCast<regIOobject&>(newObjP());
                Dbug << "Adding " << name << " to registry " << dst.name()
                    << " Class: " << newObj.headerClassName() << endl;
                Dbug << "Owned by old Registry: " << newObj.ownedByRegistry() << endl;
                Dbug << "AUTO_WRITE: " << (newObj.writeOpt()==IOobject::AUTO_WRITE) << endl;
                Dbug << "Old Path: " << obj.objectPath() << endl;
//.........这里部分代码省略.........
开发者ID:petebachant,项目名称:openfoam-extend-swak4Foam-dev,代码行数:101,代码来源:TimeClone.C


示例11:

Foam::fileNameList
Foam::fileOperations::autoParallelFileOperation::readObjects
(
    const objectRegistry& db,
    const fileName& instance,
    const fileName& local,
    word& newInstance
) const
{
    fileNameList objects;

    if (!Pstream::parRun())
    {
        objects = uncollatedFileOperation::readObjects
        (
            db,
            instance,
            local,
            newInstance
        );
    }
    else
    {
        // tbd: lagrangian. dbDir="", local = "lagrangian/KinematicCloud"
        fileName path
        (
            filePath
            (
                db.rootPath()
               /db.time().globalCaseName()
               /instance
               /db.dbDir()
               /local
            )
        );

        if (Foam::isDir(path))
        {
            newInstance = instance;
            objects = Foam::readDir(path, fileType::file);

            if (debug)
            {
                Pout<< indent
                    << "autoParallelFileOperation::readObjects :"
                    << " Returning parent directory searching:"
                    << endl << indent
                    << "    path     :" << path << endl << indent
                    << "    objects  :" << objects << endl << endl;
            }

            return objects;
        }
        else
        {
            objects = uncollatedFileOperation::readObjects
            (
                db,
                instance,
                local,
                newInstance
            );
        }
    }

    if (debug)
    {
        Pout<< indent
            << "autoParallelFileOperation::readObjects :"
            << " Returning from directory searching:" << endl << indent
            << "    path     :" << db.path(instance, db.dbDir()/local)
            << endl << indent
            << "    objects  :" << objects << endl << indent
            << "    newInst  :" << newInstance << endl << endl;
    }
    return objects;
}
开发者ID:mattijsjanssens,项目名称:mattijs-extensions,代码行数:77,代码来源:autoParallelFileOperation.C


示例12: objectPath

Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
:
    IOdictionary
    (
        IOobject
        (
            "fvSchemes",
            obr.time().system(),
            obr,
            (
                obr.readOpt() == IOobject::MUST_READ
             || obr.readOpt() == IOobject::READ_IF_PRESENT
              ? IOobject::MUST_READ_IF_MODIFIED
              : obr.readOpt()
            ),
            IOobject::NO_WRITE
        )
    ),
    ddtSchemes_
    (
        ITstream
        (
            objectPath() + ".ddtSchemes",
            tokenList()
        )()
    ),
    defaultDdtScheme_
    (
        ddtSchemes_.name() + ".default",
        tokenList()
    ),
    d2dt2Schemes_
    (
        ITstream
        (
            objectPath() + ".d2dt2Schemes",
            tokenList()
        )()
    ),
    defaultD2dt2Scheme_
    (
        d2dt2Schemes_.name() + ".default",
        tokenList()
    ),
    interpolationSchemes_
    (
        ITstream
        (
            objectPath() + ".interpolationSchemes",
            tokenList()
        )()
    ),
    defaultInterpolationScheme_
    (
        interpolationSchemes_.name() + ".default",
        tokenList()
    ),
    divSchemes_
    (
        ITstream
        (
            objectPath() + ".divSchemes",
            tokenList()
        )()
    ),
    defaultDivScheme_
    (
        divSchemes_.name() + ".default",
        tokenList()
    ),
    gradSchemes_
    (
        ITstream
        (
            objectPath() + ".gradSchemes",
            tokenList()
        )()
    ),
    defaultGradScheme_
    (
        gradSchemes_.name() + ".default",
        tokenList()
    ),
    snGradSchemes_
    (
        ITstream
        (
            objectPath() + ".snGradSchemes",
            tokenList()
        )()
    ),
    defaultSnGradScheme_
    (
        snGradSchemes_.name() + ".default",
        tokenList()
    ),
    laplacianSchemes_
    (
        ITstream
        (
//.........这里部分代码省略.........
开发者ID:BarisCumhur,项目名称:OpenFOAM-dev,代码行数:101,代码来源:fvSchemes.C


示例13: objectPath

Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
    :
    IOdictionary
    (
       IOobject
       (
           "fvSchemes",
           obr.time().system(),
           obr,
           (
               obr.readOpt() == IOobject::MUST_READ
               ? IOobject::MUST_READ_IF_MODIFIED
               : obr.readOpt()
           ),
           IOobject::NO_WRITE
       )
    ),
    ddtSchemes_
    (
       ITstream
       (
           objectPath() + "::ddtSchemes",
           tokenList()
       )()
    ),
    defaultDdtScheme_
    (
       ddtSchemes_.name() + "::default",
       tokenList()
    ),
    d2dt2Schemes_
    (
       ITstream
       (
           objectPath() + "::d2dt2Schemes",
           tokenList()
       )()
    ),
    defaultD2dt2Scheme_
    (
       d2dt2Schemes_.name() + "::default",
       tokenList()
    ),
    interpolationSchemes_
    (
       ITstream
       (
           objectPath() + "::interpolationSchemes",
           tokenList()
       )()
    ),
    defaultInterpolationScheme_
    (
       interpolationSchemes_.name() + "::default",
       tokenList()
    ),
    divSchemes_
    (
       ITstream
       (
           objectPath() + "::divSchemes",
           tokenList()
       )()
    ),
    defaultDivScheme_
    (
       divSchemes_.name() + "::default",
       tokenList()
    ),
    gradSchemes_
    (
       ITstream
       (
           objectPath() + "::gradSchemes",
           tokenList()
       )()
    ),
    defaultGradScheme_
    (
       gradSchemes_.name() + "::default",
       tokenList()
    ),
    snGradSchemes_
    (
       ITstream
       (
           objectPath() + "::snGradSchemes",
           tokenList()
       )()
    ),
    defaultSnGradScheme_
    (
       snGradSchemes_.name() + "::default",
       tokenList()
    ),
    laplacianSchemes_
    (
       ITstream
       (
           objectPath() + "::laplacianSchemes",
//.........这里部分代码省略.........
开发者ID:markuskolano,项目名称:OpenFOAM-2.0.x,代码行数:101,代码来源:fvSchemes.C


示例14: objectPath

Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
:
    IOdictionary
    (
        IOobject
        (
            "fvSchemes",
            obr.time().system(),
            obr,
//             IOobject::MUST_READ,
            IOobject::READ_IF_PRESENT,  // Allow default dictionary creation
            IOobject::NO_WRITE
        )
    ),
    ddtSchemes_
    (
        ITstream
        (
            objectPath() + "::ddtSchemes",
            tokenList()
        )()
    ),
    defaultDdtScheme_
    (
        ddtSchemes_.name() + "::default",
        tokenList()
    ),
    d2dt2Schemes_
    (
        ITstream
        (
            objectPath() + "::d2dt2Schemes",
            tokenList()
        )()
    ),
    defaultD2dt2Scheme_
    (
        d2dt2Schemes_.name() + "::default",
        tokenList()
    ),
    interpolationSchemes_
    (
        ITstream
        (
            objectPath() + "::interpolationSchemes",
            tokenList()
        )()
    ),
    defaultInterpolationScheme_
    (
        interpolationSchemes_.name() + "::default",
        tokenList()
    ),
    divSchemes_
    (
        ITstream
        (
            objectPath() + "::divSchemes",
            tokenList()
        )()
    ),
    defaultDivScheme_
    (
        divSchemes_.name() + "::default",
        tokenList()
    ),
    gradSchemes_
    (
        ITstream
        (
            objectPath() + "::gradSchemes",
            tokenList()
        )()
    ),
    defaultGradScheme_
    (
        gradSchemes_.name() + "::default",
        tokenList()
    ),
    snGradSchemes_
    (
        ITstream
        (
            objectPath() + "::snGradSchemes",
            tokenList()
        )()
    ),
    defaultSnGradScheme_
    (
        snGradSchemes_.name() + "::default",
        tokenList()
    ),
    laplacianSchemes_
    (
        ITstream
        (
            objectPath() + "::laplacianSchemes",
            tokenList()
        )()
    ),
//.........这里部分代码省略.........
开发者ID:CFMS,项目名称:foam-extend-foam-extend-3.2,代码行数:101,代码来源:fvSchemes.C



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ object_allocator类代码示例发布时间:2022-05-31
下一篇:
C++ object类代码示例发布时间: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