diff --git a/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C index 755ca03967..41d8d4e0af 100644 --- a/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/derived/codedFixedValue/codedFixedValuePointPatchField.C @@ -217,12 +217,7 @@ Foam::codedFixedValuePointPatchField::codedFixedValuePointPatchField fixedValuePointPatchField(p, iF, dict, valueRequired), codedBase(), dict_(dict), - name_ - ( - dict.found("redirectType") - ? dict.lookup("redirectType") - : dict.lookup("name") - ), + name_(dict.getCompat("name", {{"redirectType", 1706}})), redirectPatchFieldPtr_() { updateLibrary(name_); diff --git a/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.C b/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.C index 67cf8c2db3..e3c0f914dd 100644 --- a/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.C +++ b/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.C @@ -120,15 +120,7 @@ Foam::codedPoints0MotionSolver::codedPoints0MotionSolver motionSolver(mesh, dict, typeName), codedBase() { - // Backward compatibility - if (dict.found("redirectType")) - { - dict.lookup("redirectType") >> name_; - } - else - { - dict.lookup("name") >> name_; - } + dict.readCompat("name", {{"redirectType", 1706}}, name_); updateLibrary(name_); redirectMotionSolver(); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C index 95c50f56aa..15a391ade5 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codedFixedValueFvPatchField.C @@ -215,12 +215,7 @@ Foam::codedFixedValueFvPatchField::codedFixedValueFvPatchField fixedValueFvPatchField(p, iF, dict), codedBase(), dict_(dict), - name_ - ( - dict.found("redirectType") - ? dict.lookup("redirectType") - : dict.lookup("name") - ), + name_(dict.getCompat("name", {{"redirectType", 1706}})), redirectPatchFieldPtr_() { updateLibrary(name_); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C index f03e966e15..a71902673e 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/codedMixed/codedMixedFvPatchField.C @@ -215,12 +215,7 @@ Foam::codedMixedFvPatchField::codedMixedFvPatchField mixedFvPatchField(p, iF, dict), codedBase(), dict_(dict), - name_ - ( - dict.found("redirectType") - ? dict.lookup("redirectType") - : dict.lookup("name") - ), + name_(dict.getCompat("name", {{"redirectType", 1706}})), redirectPatchFieldPtr_() { updateLibrary(name_); diff --git a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C index 8e2c1c1ffb..62d65ffaf3 100644 --- a/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C +++ b/src/functionObjects/utilities/codedFunctionObject/codedFunctionObject.C @@ -191,15 +191,7 @@ bool Foam::functionObjects::codedFunctionObject::read(const dictionary& dict) { functionObject::read(dict); - // Backward compatibility - if (dict.found("redirectType")) - { - dict.lookup("redirectType") >> name_; - } - else - { - dict.lookup("name") >> name_; - } + dict.readCompat("name", {{"redirectType", 1706}}, name_); const entry* dataPtr = dict.lookupEntryPtr ( diff --git a/src/fvOptions/sources/general/codedSource/CodedSourceIO.C b/src/fvOptions/sources/general/codedSource/CodedSourceIO.C index 0899706841..1c2b661c0f 100644 --- a/src/fvOptions/sources/general/codedSource/CodedSourceIO.C +++ b/src/fvOptions/sources/general/codedSource/CodedSourceIO.C @@ -36,15 +36,7 @@ bool Foam::fv::CodedSource::read(const dictionary& dict) coeffs_.lookup("fields") >> fieldNames_; applied_.setSize(fieldNames_.size(), false); - // Backward compatibility - if (coeffs_.found("redirectType")) - { - coeffs_.lookup("redirectType") >> name_; - } - else - { - coeffs_.lookup("name") >> name_; - } + dict.readCompat("name", {{"redirectType", 1706}}, name_); // Code snippets { diff --git a/tutorials/basic/potentialFoam/cylinder/system/controlDict b/tutorials/basic/potentialFoam/cylinder/system/controlDict index 922b333d8a..07650fc4fb 100644 --- a/tutorials/basic/potentialFoam/cylinder/system/controlDict +++ b/tutorials/basic/potentialFoam/cylinder/system/controlDict @@ -49,13 +49,9 @@ functions { error { - // Load the library containing the 'coded' functionObject - libs ("libutilityFunctionObjects.so"); - - type coded; - - // Name of on-the-fly generated functionObject - name error; + name error; + type coded; + libs ("libutilityFunctionObjects.so"); codeEnd #{ diff --git a/tutorials/combustion/XiDyMFoam/oscillatingCylinder/0/pointDisplacementy b/tutorials/combustion/XiDyMFoam/oscillatingCylinder/0/pointDisplacementy index 27dcf20522..24d81a7e0d 100644 --- a/tutorials/combustion/XiDyMFoam/oscillatingCylinder/0/pointDisplacementy +++ b/tutorials/combustion/XiDyMFoam/oscillatingCylinder/0/pointDisplacementy @@ -23,13 +23,13 @@ boundaryField { walls { - type fixedValue; - value $internalField; + type fixedValue; + value $internalField; } cylinder { - type codedFixedValue; - name pointDisplacementy_cylinder; + name pointDisplacementy_cylinder; + type codedFixedValue; code #{ const scalar t = this->db().time().value(); @@ -37,21 +37,21 @@ boundaryField const scalar f = 200; operator==(a*sin(constant::mathematical::twoPi*f*t)); #}; - value $internalField; + value $internalField; } "inlet.*" { - type fixedValue; - value $internalField; + type fixedValue; + value $internalField; } outlet { - type fixedValue; - value $internalField; + type fixedValue; + value $internalField; } frontAndBack { - type empty; + type empty; } } diff --git a/tutorials/combustion/XiEngineFoam/kivaTest/system/controlDict b/tutorials/combustion/XiEngineFoam/kivaTest/system/controlDict index c123f7c5da..206d28ff02 100644 --- a/tutorials/combustion/XiEngineFoam/kivaTest/system/controlDict +++ b/tutorials/combustion/XiEngineFoam/kivaTest/system/controlDict @@ -55,9 +55,9 @@ functions { timeStep { - type coded; - libs ("libutilityFunctionObjects.so"); - name setDeltaT; + name setDeltaT; + type coded; + libs ("libutilityFunctionObjects.so"); code #{ diff --git a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/preProcess b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/preProcess index a1134c2a74..cc331bb584 100644 --- a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/preProcess +++ b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/preProcess @@ -19,10 +19,10 @@ functions { createVortex { - type coded; - libs ("libutilityFunctionObjects.so"); - name createVortices; - enabled yes; + name createVortices; + type coded; + libs ("libutilityFunctionObjects.so"); + enabled yes; codeInclude #{ diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/0.orig/U b/tutorials/incompressible/simpleFoam/pipeCyclic/0.orig/U index a70ebbdb62..c1ab604234 100644 --- a/tutorials/incompressible/simpleFoam/pipeCyclic/0.orig/U +++ b/tutorials/incompressible/simpleFoam/pipeCyclic/0.orig/U @@ -24,8 +24,8 @@ boundaryField inlet { - type codedFixedValue; name swirl; + type codedFixedValue; code #{ diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions index 349148c268..abaf0e973f 100644 --- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions +++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/continuityFunctions @@ -8,8 +8,8 @@ inletMassFlowRate { - type surfaceFieldValue; - libs ("libfieldFunctionObjects.so"); + type surfaceFieldValue; + libs ("libfieldFunctionObjects.so"); fields ( @@ -31,8 +31,8 @@ inletMassFlowRate outletMassFlowRate { - type surfaceFieldValue; - libs ("libfieldFunctionObjects.so"); + type surfaceFieldValue; + libs ("libfieldFunctionObjects.so"); fields ( @@ -54,9 +54,9 @@ outletMassFlowRate totalMass { - type coded; - libs ("libutilityFunctionObjects.so"); name error; + type coded; + libs ("libutilityFunctionObjects.so"); code #{