ENH: add read guard for dimensionedType constructors (#762)
- deprecate dimensionedType constructors using an Istream in favour of versions accepting a keyword and a dictionary. Dictionary entries are almost the exclusive means of read constructing a dimensionedType. By construct from the dictionary entry instead of doing a lookup() first, we can detect possible input errors such as too many tokens as a result of a input syntax error. Constructing a dimensionedType from a dictionary entry now has two forms. 1. dimensionedType(key, dims, dict); This is the constructor that will normally be used. It accepts entries with optional leading names and/or dimensions. If the entry contains dimensions, they are verified against the expected dimensions and an IOError is raised if they do not correspond. On conclusion, checks the token stream for any trailing rubbish. 2. dimensionedType(key, dict); This constructor is used less frequently. Similar to the previous description, except that it is initially dimensionless. If entry contains dimensions, they are used without further verification. The constructor also includes a token stream check. This constructor is useful when the dimensions are entirely defined from the dictionary input, but also when handling transition code where the input dimensions are not obvious from the source. This constructor can also be handy when obtaining values from a dictionary without needing to worry about the input dimensions. For example, Info<< "rho: " << dimensionedScalar("rho", dict).value() << nl; This will accept a large range of inputs without hassle. ENH: consistent handling of dimensionedType for inputs (#1083) BUG: incorrect Omega dimensions (fixes #2084)
Showing
- applications/solvers/basic/laplacianFoam/createFields.H 1 addition, 6 deletionsapplications/solvers/basic/laplacianFoam/createFields.H
- applications/solvers/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H 1 addition, 4 deletions...s/basic/laplacianFoam/overLaplacianDyMFoam/createFields.H
- applications/solvers/basic/scalarTransportFoam/createFields.H 1 addition, 6 deletions...ications/solvers/basic/scalarTransportFoam/createFields.H
- applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C 2 additions, 2 deletions...on/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C
- applications/solvers/combustion/PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C 2 additions, 2 deletions.../PDRFoam/laminarFlameSpeed/SCOPE/SCOPELaminarFlameSpeed.C
- applications/solvers/combustion/XiFoam/readCombustionProperties.H 8 additions, 8 deletions...ions/solvers/combustion/XiFoam/readCombustionProperties.H
- applications/solvers/electromagnetics/electrostaticFoam/createFields.H 6 additions, 2 deletions...solvers/electromagnetics/electrostaticFoam/createFields.H
- applications/solvers/financial/financialFoam/createFields.H 3 additions, 3 deletionsapplications/solvers/financial/financialFoam/createFields.H
- applications/solvers/finiteArea/liquidFilmFoam/readTransportProperties.H 6 additions, 26 deletions...lvers/finiteArea/liquidFilmFoam/readTransportProperties.H
- applications/solvers/finiteArea/sphereSurfactantFoam/createFaFields.H 2 additions, 14 deletions.../solvers/finiteArea/sphereSurfactantFoam/createFaFields.H
- applications/solvers/finiteArea/surfactantFoam/createFaFields.H 1 addition, 4 deletions...ations/solvers/finiteArea/surfactantFoam/createFaFields.H
- applications/solvers/incompressible/icoFoam/createFields.H 1 addition, 1 deletionapplications/solvers/incompressible/icoFoam/createFields.H
- applications/solvers/incompressible/shallowWaterFoam/readGravitationalAcceleration.H 4 additions, 3 deletions...ressible/shallowWaterFoam/readGravitationalAcceleration.H
- applications/solvers/lagrangian/DPMFoam/createFields.H 1 addition, 4 deletionsapplications/solvers/lagrangian/DPMFoam/createFields.H
- applications/solvers/multiphase/icoReactingMultiphaseInterFoam/phasesSystem/interfaceModels/surfaceTensionModels/constantSurfaceTensionCoefficient/constantSurfaceTensionCoefficient.C 1 addition, 1 deletion...aceTensionCoefficient/constantSurfaceTensionCoefficient.C
- applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C 11 additions, 8 deletions...emperaturePhaseChangeTwoPhaseMixtures/constant/constant.C
- applications/solvers/multiphase/interFoam/interMixingFoam/threePhaseInterfaceProperties/threePhaseInterfaceProperties.C 2 additions, 2 deletions...ePhaseInterfaceProperties/threePhaseInterfaceProperties.C
- applications/test/parallelOverset/createFields.H 1 addition, 4 deletionsapplications/test/parallelOverset/createFields.H
- applications/utilities/preProcessing/applyBoundaryLayer/createFields.H 1 addition, 1 deletion...utilities/preProcessing/applyBoundaryLayer/createFields.H
- applications/utilities/preProcessing/engineSwirl/createFields.H 6 additions, 24 deletions...ations/utilities/preProcessing/engineSwirl/createFields.H
Please register or sign in to comment