diff --git a/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H b/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H index c970ca0c413770b1c4afb1f2f855cdf01b6cbd7c..58c9dbee75003bae62faa18ad18944ef590a0c54 100644 --- a/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H +++ b/src/OpenFOAM/fields/UniformDimensionedFields/UniformDimensionedField.H @@ -100,8 +100,8 @@ public: //- Construct as copy UniformDimensionedField(const UniformDimensionedField<Type>&); - //- Construct from Istream - UniformDimensionedField(const IOobject& io); + //- Construct from IOobject. Either reads or sets dimensionless zero + explicit UniformDimensionedField(const IOobject& io); //- Destructor @@ -129,7 +129,7 @@ public: } //- Return complete path + object name if the file exists - // either in the case/processor or case otherwise null + //- either in the case/processor or case otherwise null virtual fileName filePath() const { return globalFilePath(type()); diff --git a/src/finiteVolume/expressions/PatchFunction1/lookup/Lookup.C b/src/finiteVolume/expressions/PatchFunction1/lookup/Lookup.C index 9187277e3eee5606ab9b2d352cb7cb16d5a1b4f0..322a4faf5bf6bee152c252378d84393a88d41689 100644 --- a/src/finiteVolume/expressions/PatchFunction1/lookup/Lookup.C +++ b/src/finiteVolume/expressions/PatchFunction1/lookup/Lookup.C @@ -53,7 +53,7 @@ Foam::Function1Types::Lookup<Type>::Lookup(const Lookup<Type>& rhs) // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> -inline Type Foam::Function1Types::Lookup<Type>::value(const scalar t) const +Type Foam::Function1Types::Lookup<Type>::value(const scalar t) const { const objectRegistry& db = function1Base::obr(); const auto& obj = @@ -64,7 +64,7 @@ inline Type Foam::Function1Types::Lookup<Type>::value(const scalar t) const template<class Type> -inline Type Foam::Function1Types::Lookup<Type>::integrate +Type Foam::Function1Types::Lookup<Type>::integrate ( const scalar t1, const scalar t2 diff --git a/tutorials/mesh/blockMesh/pipe/system/controlDict b/tutorials/mesh/blockMesh/pipe/system/controlDict index 328116a5f1e5eaa8a8e44ab87f6db3237893f4a8..8f5f925fa62ffb7440afb1df407a716bfd7116bb 100644 --- a/tutorials/mesh/blockMesh/pipe/system/controlDict +++ b/tutorials/mesh/blockMesh/pipe/system/controlDict @@ -70,11 +70,12 @@ functions ( "banana", mesh().time().constant(), - mesh() + mesh().thisDb() ); - auto* ptr = const_cast<objectRegistry&>(io.db()). - findObject<uniformDimensionedScalarField>(io.name()); + auto* ptr = + io.db().getObjectPtr<uniformDimensionedScalarField>(io.name()); + if (!ptr) { Info<< "Registering relaxation factor " << io.name() << endl; @@ -95,7 +96,7 @@ functions ( "banana", mesh().time().constant(), - mesh() + mesh().thisDb() ); auto& val =