77 Info<<
"Reading boundary from " << typeFilePath<IOPtrList<entry>>(io)
90 label nOldCyclics = 0;
95 if (
word(patchDict[
"type"]) == cyclicPolyPatch::typeName)
97 if (!patchDict.
found(
"neighbourPatch"))
100 <<
" does not have 'neighbourPatch' entry; assuming it" 101 <<
" is of the old type." <<
endl;
107 Info<<
"Detected " << nOldCyclics <<
" old cyclics." <<
nl <<
endl;
115 patches.setSize(nOldPatches+nOldCyclics);
122 label addedPatchi = nOldPatches;
130 word(patchDict[
"type"]) == cyclicPolyPatch::typeName
133 const word& name = oldPatches[
patchi].keyword();
135 if (patchDict.
found(
"neighbourPatch"))
138 oldToNew[
patchi] = newPatchi++;
144 if (i != string::npos)
146 oldName = name.substr(0, i);
147 thisNames.
insert(oldName, name);
148 Info<<
"Detected converted cyclic patch " << name
149 <<
" ; assuming it originates from " << oldName
154 i = name.rfind(
"_half1");
155 if (i != string::npos)
157 oldName = name.substr(0, i);
158 nbrNames.
insert(oldName, name);
159 Info<<
"Detected converted cyclic patch " << name
160 <<
" ; assuming it originates from " << oldName
170 Info<<
"Detected old style " <<
word(patchDict[
"type"])
171 <<
" patch " << name <<
" with" <<
nl 172 <<
" nFaces : " << nFaces <<
nl 173 <<
" startFace : " << startFace <<
endl;
175 word thisName = name +
"_half0";
176 word nbrName = name +
"_half1";
178 thisNames.
insert(name, thisName);
179 nbrNames.
insert(name, nbrName);
186 oldToNew[
patchi] = newPatchi++;
188 thisPatchDict.
add(
"neighbourPatch", nbrName);
189 thisPatchDict.
set(
"nFaces", nFaces/2);
203 oldToNew[addedPatchi] = newPatchi++;
205 nbrPatchDict.
set(
"neighbourPatch", thisName);
206 nbrPatchDict.
set(
"nFaces", nFaces/2);
207 nbrPatchDict.
set(
"startFace", startFace+nFaces/2);
208 patches[addedPatchi].keyword() = nbrName;
210 Info<<
"Replaced with patches" <<
nl 217 <<
patches[addedPatchi].keyword() <<
" with" <<
nl 231 oldToNew[
patchi] = newPatchi++;
248 << (
patches.objectPath() +
".old") <<
nl;
258 Info<<
"No changes made to boundary file." <<
nl <<
endl;
265 const bool isTestRun,
267 const word& fieldName,
274 Info<<
"Loading field " << fieldName <<
endl;
275 const word oldTypeName = IOdictionary::typeName;
290 const_cast<word&
>(IOdictionary::typeName) = oldTypeName;
292 const_cast<word&
>(fieldDict.type()) = fieldDict.headerClassName();
302 const word& patchName = iter.key();
303 const word& newName = iter();
305 Info<<
"Looking for entry for patch " << patchName <<
endl;
312 boundaryField.
found(patchName)
313 && !boundaryField.
found(newName,
false,
false)
316 Info<<
" Changing entry " << patchName <<
" to " << newName
321 if (patchDict.
found(
"value"))
324 patchDict.
remove(
"value");
334 Info<<
" Adding entry " << nbrNames[patchName] <<
endl;
350 if (
mvBak(fieldDict.objectPath(),
"old"))
353 << (fieldDict.objectPath() +
".old") <<
nl;
357 << fieldDict.objectPath() <<
endl;
358 fieldDict.regIOobject::write();
363 Info<<
"No changes made to field " << fieldName <<
endl;
371 const bool isTestRun,
393 int main(
int argc,
char *argv[])
400 "enableFunctionEntries",
401 "enable expansion of dictionary directives - #include, #codeStream etc" 419 Info<<
"-test option: no changes made" <<
nl <<
endl;
468 runTime.setTime(timeDirs[timeI], timeI);
470 Info<<
"Time: " << runTime.timeName() <<
endl;
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
#define forAll(list, i)
Loop across all elements in list.
bool remove(const word &)
Remove an entry specified by keyword.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool typeHeaderOk(const bool checkType=true)
Read header (uses typeFilePath to find file) and check header.
A class for handling file names.
List of IOobjects with searching and retrieving facilities.
A list of keyword definitions, which are a keyword followed by any number of values (e...
static const char *const typeName
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
static const dictionary null
Null dictionary.
static word defaultRegion
Return the default region name.
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool optionFound(const word &opt) const
Return true if the named option is found.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
A keyword and a list of tokens is a 'dictionaryEntry'.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
static List< word > fieldNames
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool changeKeyword(const keyType &oldKeyword, const keyType &newKeyword, bool forceOverwrite=false)
Change the keyword for an entry,.
static int disableFunctionEntries
A class for handling words, derived from string.
const word & constant() const
Return constant name.
static const word null
An empty word.
An STL-conforming hash table.
graph_traits< Graph >::vertices_size_type size_type
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
label readLabel(Istream &is)
defineTemplateTypeNameAndDebug(IOPtrList< ensightPart >, 0)
static fileCheckTypes fileModificationChecking
Type of file modification checking.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
A PtrList of objects of type <T> with automated input and output.
void set(entry *)
Assign a new entry, overwrite any existing entry.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
Foam::argList args(argc, argv)
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.