diff --git a/src/finiteVolume/finiteVolume/fvc/fvcGrad.C b/src/finiteVolume/finiteVolume/fvc/fvcGrad.C index 7408b14ad..9a4a7b342 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcGrad.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcGrad.C @@ -53,7 +53,7 @@ grad const GeometricField& ssf ) { - return fv::gaussGrad::grad(ssf); + return fv::gaussGrad::gradf(ssf, "grad(" + ssf.name() + ')'); } @@ -98,7 +98,7 @@ grad ( vf.mesh(), vf.mesh().schemesDict().gradScheme(name) - )().grad(vf); + )().grad(vf, name); } diff --git a/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.C index 3bbd2fd9d..ac516c556 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.C @@ -46,9 +46,10 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -beGaussGrad::grad +beGaussGrad::calcGrad ( - const GeometricField& vsf + const GeometricField& vsf, + const word& name ) const { typedef typename outerProduct::type GradType; @@ -68,7 +69,7 @@ beGaussGrad::grad ( IOobject ( - "grad("+ssf.name()+')', + name, ssf.instance(), mesh, IOobject::NO_READ, diff --git a/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.H index 4c0dfad55..8166f3f0e 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/beGaussGrad/beGaussGrad.H @@ -122,9 +122,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; }; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C index 0f1d9cae6..2ff09d4f3 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.C @@ -52,9 +52,10 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -extendedLeastSquaresGrad::grad +extendedLeastSquaresGrad::calcGrad ( - const GeometricField& vsf + const GeometricField& vsf, + const word& name ) const { typedef typename outerProduct::type GradType; @@ -67,7 +68,7 @@ extendedLeastSquaresGrad::grad ( IOobject ( - "grad("+vsf.name()+')', + name, vsf.instance(), mesh, IOobject::NO_READ, diff --git a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.H index 83cba954c..7cb743295 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/extendedLeastSquaresGrad/extendedLeastSquaresGrad.H @@ -105,9 +105,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; }; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C index 3852c44df..29d4b9b0a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.C @@ -52,9 +52,10 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -fourthGrad::grad +fourthGrad::calcGrad ( - const GeometricField& vsf + const GeometricField& vsf, + const word& name ) const { // The fourth-order gradient is calculated in two passes. First, @@ -79,7 +80,7 @@ fourthGrad::grad ( IOobject ( - "grad("+vsf.name()+')', + name, vsf.instance(), mesh, IOobject::NO_READ, diff --git a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.H index 3174724ba..9ccbaa31e 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/fourthGrad/fourthGrad.H @@ -86,9 +86,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; }; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C index ea5027c79..5a074135f 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C @@ -46,9 +46,10 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -gaussGrad::grad +gaussGrad::gradf ( - const GeometricField& ssf + const GeometricField& ssf, + const word& name ) { typedef typename outerProduct::type GradType; @@ -61,7 +62,7 @@ gaussGrad::grad ( IOobject ( - "grad("+ssf.name()+')', + name, ssf.instance(), mesh, IOobject::NO_READ, @@ -125,16 +126,17 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -gaussGrad::grad +gaussGrad::calcGrad ( - const GeometricField& vsf + const GeometricField& vsf, + const word& name ) const { typedef typename outerProduct::type GradType; tmp > tgGrad ( - grad(tinterpScheme_().interpolate(vsf)) + gradf(tinterpScheme_().interpolate(vsf), name) ); GeometricField& gGrad = tgGrad(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H index e187b95d6..54184a311 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.H @@ -88,7 +88,7 @@ public: tinterpScheme_(new linear(mesh)) {} - //- Construct from Istream + //- Construct from mesh and Istream gaussGrad(const fvMesh& mesh, Istream& is) : gradScheme(mesh), @@ -122,20 +122,22 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > gradf ( - const GeometricField& + const GeometricField&, + const word& name ); //- Return the gradient of the given field calculated // using Gauss' theorem on the interpolated field - tmp + virtual tmp < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; //- Return the BlockLduSystem corresponding to the implicit grad diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C index 56d0d76a5..644a25fe5 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.C @@ -29,6 +29,7 @@ Description #include "fv.H" #include "HashTable.H" #include "primitiveFields.H" +#include "objectRegistry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -98,6 +99,176 @@ gradScheme::~gradScheme() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +Foam::tmp +< + Foam::GeometricField + < + typename Foam::outerProduct::type, + Foam::fvPatchField, + Foam::volMesh + > +> +Foam::fv::gradScheme::grad +( + const GeometricField& vsf, + const word& name +) const +{ + typedef typename outerProduct::type GradType; + typedef GeometricField GradFieldType; + + if (!this->mesh().changing() && this->mesh().schemesDict().cache(name)) + { + if (!mesh().objectRegistry::template foundObject(name)) + { + if (fvSchemes::debug) + { + Info << "Cache: Calculating and caching " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + tmp tgGrad = calcGrad(vsf, name); + regIOobject::store(tgGrad.ptr()); + } + + if (fvSchemes::debug) + { + Info << "Cache: Retrieving " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + GradFieldType& gGrad = const_cast + ( + mesh().objectRegistry::template lookupObject(name) + ); + + if (gGrad.upToDate(vsf.name())) + { + return gGrad; + } + else + { + if (fvSchemes::debug) + { + Info << "Cache: Deleting " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + gGrad.release(); + delete &gGrad; + + if (fvSchemes::debug) + { + Info << "Cache: Recalculating " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + tmp tgGrad = calcGrad(vsf, name); + + if (fvSchemes::debug) + { + Info << "Cache: Storing " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + regIOobject::store(tgGrad.ptr()); + GradFieldType& gGrad = const_cast + ( + mesh().objectRegistry::template lookupObject + ( + name + ) + ); + + return gGrad; + } + } + else + { + if (mesh().objectRegistry::template foundObject(name)) + { + GradFieldType& gGrad = const_cast + ( + mesh().objectRegistry::template lookupObject + ( + name + ) + ); + + if (gGrad.ownedByRegistry()) + { + if (fvSchemes::debug) + { + Info << "Cache: Deleting " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + gGrad.release(); + delete &gGrad; + } + } + + if (fvSchemes::debug) + { + Info << "Cache: Calculating " << name + << " originating from " << vsf.name() + << " event No. " << vsf.eventNo() + << endl; + } + return calcGrad(vsf, name); + } +} + +template +Foam::tmp +< + Foam::GeometricField + < + typename Foam::outerProduct::type, + Foam::fvPatchField, + Foam::volMesh + > +> +Foam::fv::gradScheme::grad +( + const GeometricField& vsf +) const +{ + return grad(vsf, "grad(" + vsf.name() + ')'); +} + + +template +Foam::tmp +< + Foam::GeometricField + < + typename Foam::outerProduct::type, + Foam::fvPatchField, + Foam::volMesh + > +> +Foam::fv::gradScheme::grad +( + const tmp >& tvsf +) const +{ + typedef typename outerProduct::type GradType; + typedef GeometricField GradFieldType; + + tmp tgrad = grad(tvsf()); + tvsf.clear(); + return tgrad; +} + + template tmp < diff --git a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.H b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.H index b99d47a7a..f7d45f14e 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/gradScheme/gradScheme.H @@ -127,16 +127,54 @@ public: return mesh_; } - //- Calculate and return the grad of the given field + //- Calculate and return the grad of the given field. + // Used by grad either to recalculate the cached gradient when it is + // out of date with respect to the field or when it is not cached. virtual tmp + < + GeometricField + ::type, fvPatchField, volMesh> + > calcGrad + ( + const GeometricField&, + const word& name + ) const = 0; + + //- Calculate and return the grad of the given field + // which may have been cached + tmp + < + GeometricField + ::type, fvPatchField, volMesh> + > grad + ( + const GeometricField&, + const word& name + ) const; + + //- Calculate and return the grad of the given field + // with the default name + // which may have been cached + tmp < GeometricField ::type, fvPatchField, volMesh> > grad ( const GeometricField& - ) const = 0; + ) const; + //- Calculate and return the grad of the given field + // with the default name + // which may have been cached + tmp + < + GeometricField + ::type, fvPatchField, volMesh> + > grad + ( + const tmp >& + ) const; //- Return the BlockLduSystem corresponding to the implicit grad // discretization. For block coupled systems. diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C index 7250d5ea6..103cd8898 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.C @@ -52,9 +52,10 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -leastSquaresGrad::grad +leastSquaresGrad::calcGrad ( - const GeometricField& vsf + const GeometricField& vsf, + const word& name ) const { typedef typename outerProduct::type GradType; @@ -67,7 +68,7 @@ leastSquaresGrad::grad ( IOobject ( - "grad("+vsf.name()+')', + name, vsf.instance(), mesh, IOobject::NO_READ, diff --git a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.H index 5b3a156ea..679d60a40 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/leastSquaresGrad/leastSquaresGrad.H @@ -88,13 +88,16 @@ public: // Member Functions - tmp + //- Return the gradient of the given field to the gradScheme::grad + // for optional caching + virtual tmp < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; //- Return the BlockLduSystem corresponding to the implicit least diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H index 9ce726a67..53d6b0ca2 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrad.H @@ -121,9 +121,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C index 4973016db..3018950f3 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellLimitedGrad/cellLimitedGrads.C @@ -91,9 +91,10 @@ inline void cellLimitedGrad::limitFace // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<> -tmp cellLimitedGrad::grad +tmp cellLimitedGrad::calcGrad ( - const volScalarField& vsf + const volScalarField& vsf, + const word& name ) const { const fvMesh& mesh = vsf.mesh(); @@ -243,9 +244,10 @@ tmp cellLimitedGrad::grad template<> -tmp cellLimitedGrad::grad +tmp cellLimitedGrad::calcGrad ( - const volVectorField& vsf + const volVectorField& vsf, + const word& name ) const { const fvMesh& mesh = vsf.mesh(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H index 4ff0dca94..5ae805d3a 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrad.H @@ -120,9 +120,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; }; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C index 6deda70d4..7328e4ce3 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/cellMDLimitedGrad/cellMDLimitedGrads.C @@ -48,9 +48,10 @@ makeFvGradScheme(cellMDLimitedGrad) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<> -tmp cellMDLimitedGrad::grad +tmp cellMDLimitedGrad::calcGrad ( - const volScalarField& vsf + const volScalarField& vsf, + const word& name ) const { const fvMesh& mesh = vsf.mesh(); @@ -189,9 +190,10 @@ tmp cellMDLimitedGrad::grad template<> -tmp cellMDLimitedGrad::grad +tmp cellMDLimitedGrad::calcGrad ( - const volVectorField& vsf + const volVectorField& vsf, + const word& name ) const { const fvMesh& mesh = vsf.mesh(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H index d62ca6623..51c1d8927 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrad.H @@ -121,9 +121,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; //- Return the BlockLduSystem corresponding to the implicit face diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C index f1fa50f39..d8b7ea3df 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceLimitedGrad/faceLimitedGrads.C @@ -70,9 +70,10 @@ inline void faceLimitedGrad::limitFace // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<> -tmp faceLimitedGrad::grad +tmp faceLimitedGrad::calcGrad ( - const volScalarField& vsf + const volScalarField& vsf, + const word& name ) const { const fvMesh& mesh = vsf.mesh(); @@ -206,9 +207,10 @@ tmp faceLimitedGrad::grad template<> -tmp faceLimitedGrad::grad +tmp faceLimitedGrad::calcGrad ( - const volVectorField& vvf + const volVectorField& vvf, + const word& name ) const { const fvMesh& mesh = vvf.mesh(); diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrad.H b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrad.H index d50d2f881..90a8169cf 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrad.H +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrad.H @@ -121,9 +121,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; }; diff --git a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C index dc1867fde..5ec13aae4 100644 --- a/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C +++ b/src/finiteVolume/finiteVolume/gradSchemes/limitedGradSchemes/faceMDLimitedGrad/faceMDLimitedGrads.C @@ -50,9 +50,10 @@ makeFvGradScheme(faceMDLimitedGrad) // FaceLimited scalar gradient template<> -tmp faceMDLimitedGrad::grad +tmp faceMDLimitedGrad::calcGrad ( - const volScalarField& vsf + const volScalarField& vsf, + const word& name ) const { const fvMesh& mesh = vsf.mesh(); @@ -188,9 +189,10 @@ tmp faceMDLimitedGrad::grad template<> -tmp faceMDLimitedGrad::grad +tmp faceMDLimitedGrad::calcGrad ( - const volVectorField& vvf + const volVectorField& vvf, + const word& name ) const { const fvMesh& mesh = vvf.mesh(); diff --git a/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.C b/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.C index 7304b6c67..fc51a7ecc 100644 --- a/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.C +++ b/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.C @@ -54,9 +54,10 @@ tmp typename outerProduct::type, fvPatchField, volMesh > > -leastSquaresSolidInterfaceGrad::grad +leastSquaresSolidInterfaceGrad::calcGrad ( - const GeometricField& vsf + const GeometricField& vsf, + const word& name ) const { typedef typename outerProduct::type GradType; @@ -69,7 +70,7 @@ leastSquaresSolidInterfaceGrad::grad ( IOobject ( - "grad("+vsf.name()+')', + name, vsf.instance(), mesh, IOobject::NO_READ, diff --git a/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.H b/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.H index f83463c58..5c2a9a30a 100644 --- a/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.H +++ b/src/solidModels/finiteVolume/gradSchemes/leastSquaresSolidInterfaceGrad/leastSquaresSolidInterfaceGrad.H @@ -94,9 +94,10 @@ public: < GeometricField ::type, fvPatchField, volMesh> - > grad + > calcGrad ( - const GeometricField& + const GeometricField& vsf, + const word& name ) const; };