本文整理汇总了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;未经允许,请勿转载。 |
请发表评论