本文整理汇总了C++中IOdictionary::headerClassName方法的典型用法代码示例。如果您正苦于以下问题:C++ IOdictionary::headerClassName方法的具体用法?C++ IOdictionary::headerClassName怎么用?C++ IOdictionary::headerClassName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOdictionary
的用法示例。
在下文中一共展示了IOdictionary::headerClassName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: forAllConstIter
void rewriteField
(
const bool isTestRun,
const Time& runTime,
const word& fieldName,
const HashTable<word>& thisNames,
const HashTable<word>& nbrNames
)
{
// Read dictionary. (disable class type checking so we can load
// field)
Info<< "Loading field " << fieldName << endl;
const word oldTypeName = IOdictionary::typeName;
const_cast<word&>(IOdictionary::typeName) = word::null;
IOdictionary fieldDict
(
IOobject
(
fieldName,
runTime.timeName(),
runTime,
IOobject::MUST_READ_IF_MODIFIED,
IOobject::NO_WRITE,
false
)
);
const_cast<word&>(IOdictionary::typeName) = oldTypeName;
// Fake type back to what was in field
const_cast<word&>(fieldDict.type()) = fieldDict.headerClassName();
dictionary& boundaryField = fieldDict.subDict("boundaryField");
label nChanged = 0;
forAllConstIter(HashTable<word>, thisNames, iter)
{
const word& patchName = iter.key();
const word& newName = iter();
Info<< "Looking for entry for patch " << patchName << endl;
// Find old patch name either direct or through wildcards
// Find new patch name direct only
if
(
boundaryField.found(patchName)
&& !boundaryField.found(newName, false, false)
)
{
Info<< " Changing entry " << patchName << " to " << newName
<< endl;
dictionary& patchDict = boundaryField.subDict(patchName);
if (patchDict.found("value"))
{
// Remove any value field since wrong size.
patchDict.remove("value");
}
boundaryField.changeKeyword(patchName, newName);
boundaryField.add
(
nbrNames[patchName],
patchDict
);
Info<< " Adding entry " << nbrNames[patchName] << endl;
nChanged++;
}
}
// Info<< "New boundaryField:" << boundaryField << endl;
if (returnReduce(nChanged, sumOp<label>()) > 0)
{
if (isTestRun)
{
// Info<< "-test option: no changes made" << endl;
}
else
{
if (mvBak(fieldDict.objectPath(), "old"))
{
Info<< "Backup to "
<< (fieldDict.objectPath() + ".old") << nl;
}
Info<< "Write to "
<< fieldDict.objectPath() << endl;
fieldDict.regIOobject::write();
}
}
else
{
//.........这里部分代码省略.........