Go to the documentation of this file.
89 label nOldCyclics = 0;
94 if (
word(patchDict[
"type"]) == cyclicPolyPatch::typeName)
96 if (!patchDict.
found(
"neighbourPatch"))
99 <<
" does not have 'neighbourPatch' entry; assuming it"
100 <<
" is of the old type." <<
endl;
106 Info<<
"Detected " << nOldCyclics <<
" old cyclics." <<
nl <<
endl;
114 patches.setSize(nOldPatches+nOldCyclics);
121 label addedPatchI = nOldPatches;
123 forAll(oldPatches, patchI)
125 const dictionary& patchDict = oldPatches[patchI].dict();
129 word(patchDict[
"type"]) == cyclicPolyPatch::typeName
132 const word&
name = oldPatches[patchI].keyword();
134 if (patchDict.
found(
"neighbourPatch"))
136 patches.set(patchI, oldPatches.set(patchI, NULL));
137 oldToNew[patchI] = newPatchI++;
143 if (i != string::npos)
145 oldName =
name.substr(0, i);
147 Info<<
"Detected converted cyclic patch " <<
name
148 <<
" ; assuming it originates from " << oldName
153 i =
name.rfind(
"_half1");
154 if (i != string::npos)
156 oldName =
name.substr(0, i);
158 Info<<
"Detected converted cyclic patch " <<
name
159 <<
" ; assuming it originates from " << oldName
169 Info<<
"Detected old style " <<
word(patchDict[
"type"])
170 <<
" patch " <<
name <<
" with" <<
nl
171 <<
" nFaces : " << nFaces <<
nl
172 <<
" startFace : " << startFace <<
endl;
184 patches.set(patchI, oldPatches.set(patchI, NULL));
185 oldToNew[patchI] = newPatchI++;
187 thisPatchDict.
add(
"neighbourPatch", nbrName);
188 thisPatchDict.
set(
"nFaces", nFaces/2);
189 patches[patchI].keyword() = thisName;
202 oldToNew[addedPatchI] = newPatchI++;
204 nbrPatchDict.
set(
"neighbourPatch", thisName);
205 nbrPatchDict.
set(
"nFaces", nFaces/2);
206 nbrPatchDict.
set(
"startFace", startFace+nFaces/2);
207 patches[addedPatchI].keyword() = nbrName;
209 Info<<
"Replaced with patches" <<
nl
210 <<
patches[patchI].keyword() <<
" with" <<
nl
216 <<
patches[addedPatchI].keyword() <<
" with" <<
nl
229 patches.set(patchI, oldPatches.set(patchI, NULL));
230 oldToNew[patchI] = newPatchI++;
247 << (
patches.objectPath() +
".old") <<
nl;
257 Info<<
"No changes made to boundary file." <<
nl <<
endl;
264 const bool isTestRun,
266 const word& fieldName,
273 Info<<
"Loading field " << fieldName <<
endl;
274 const word oldTypeName = IOdictionary::typeName;
289 const_cast<word&
>(IOdictionary::typeName) = oldTypeName;
291 const_cast<word&
>(fieldDict.type()) = fieldDict.headerClassName();
301 const word& patchName = iter.key();
302 const word& newName = iter();
304 Info<<
"Looking for entry for patch " << patchName <<
endl;
315 Info<<
" Changing entry " << patchName <<
" to " << newName
320 if (patchDict.
found(
"value"))
323 patchDict.
remove(
"value");
333 Info<<
" Adding entry " << nbrNames[patchName] <<
endl;
349 if (
mvBak(fieldDict.objectPath(),
"old"))
352 << (fieldDict.objectPath() +
".old") <<
nl;
356 << fieldDict.objectPath() <<
endl;
357 fieldDict.regIOobject::write();
362 Info<<
"No changes made to field " << fieldName <<
endl;
370 const bool isTestRun,
392 int main(
int argc,
char *argv[])
399 "enableFunctionEntries",
400 "enable expansion of dictionary directives - #include, #codeStream etc"
418 Info<<
"-test option: no changes made" <<
nl <<
endl;
513 objects.names(volScalarField::typeName),
521 objects.names(volVectorField::typeName),
529 objects.names(volSphericalTensorField::typeName),
537 objects.names(volSymmTensorField::typeName),
545 objects.names(volTensorField::typeName),
558 objects.names(pointScalarField::typeName),
566 objects.names(pointVectorField::typeName),
574 objects.names(pointSphericalTensorField::typeName),
582 objects.names(pointSymmTensorField::typeName),
590 objects.names(pointTensorField::typeName),
603 objects.names(surfaceScalarField::typeName),
611 objects.names(surfaceVectorField::typeName),
619 objects.names(surfaceSphericalTensorField::typeName),
627 objects.names(surfaceSymmTensorField::typeName),
635 objects.names(surfaceTensorField::typeName),
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
A keyword and a list of tokens is a 'dictionaryEntry'.
fileName filePath() const
Return complete path + object name if the file exists.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from string.
A class for handling file names.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
A PtrList of objects of type <T> with automated input and output.
static word defaultRegion
Return the default region name.
#define forAll(list, i)
Loop across all elements in list.
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
bool remove(const word &)
Remove an entry specified by keyword.
Ostream & endl(Ostream &os)
Add newline and flush stream.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
bool headerOk()
Read and check header info.
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 found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
bool mvBak(const fileName &, const std::string &ext="bak")
Rename to a corresponding backup file.
int main(int argc, char *argv[])
graph_traits< Graph >::vertices_size_type size_type
A list of keyword definitions, which are a keyword followed by any number of values (e....
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
cellIbMask *cellIbMaskExt *faceIbMask *cellIbMask boundaryField().evaluateCoupled()
static int disableFunctionEntries
List of IOobjects with searching and retrieving facilities.
An STL-conforming hash table.
static fileCheckTypes fileModificationChecking
static instantList timeDirs
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
static word timeName(const scalar, const int precision=precision_)
Return time name of given scalar time.
wordList fieldNames(const IOobjectList &objects, const bool syncPar)
Get sorted names of fields of type. If syncPar and running in parallel.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const word & constant() const
Return constant name.
static const word null
An empty word.
label readLabel(Istream &is)
bool optionFound(const word &opt) const
Return true if the named option is found.
static instantList select0(Time &runTime, const argList &args)
Return the set of times selected based on the argList options.
defineTemplateTypeNameAndDebug(IOPtrList< ensightPart >, 0)
Foam::argList args(argc, argv)
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
word name(const complex &)
Return a string representation of a complex.
static const dictionary null
Null dictionary.
bool add(entry *, bool mergeEntry=false)
Add a new entry.
void set(entry *)
Assign a new entry, overwrite any existing entry.