COMP: avoid ambiguous construct from tmp - gradSchemes

This commit is contained in:
Mark Olesen
2010-12-17 16:58:09 +01:00
parent 9d95a6f59d
commit d4560178e2
12 changed files with 80 additions and 56 deletions

View File

@ -112,8 +112,10 @@ Foam::fv::extendedLeastSquaresGrad<Type>::calcGrad
if (vsf.boundaryField()[patchi].coupled()) if (vsf.boundaryField()[patchi].coupled())
{ {
Field<Type> neiVsf = const Field<Type> neiVsf
vsf.boundaryField()[patchi].patchNeighbourField(); (
vsf.boundaryField()[patchi].patchNeighbourField()
);
forAll(neiVsf, patchFaceI) forAll(neiVsf, patchFaceI)
{ {

View File

@ -111,7 +111,10 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
const labelUList& neighbour = mesh_.neighbour(); const labelUList& neighbour = mesh_.neighbour();
// Build the d-vectors // Build the d-vectors
surfaceVectorField d = mesh_.Sf()/(mesh_.magSf()*mesh_.deltaCoeffs()); surfaceVectorField d
(
mesh_.Sf()/(mesh_.magSf()*mesh_.deltaCoeffs())
);
if (!mesh_.orthogonal()) if (!mesh_.orthogonal())
{ {
@ -124,7 +127,7 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
forAll(owner, faceI) forAll(owner, faceI)
{ {
symmTensor wdd = 1.0/magSqr(d[faceI])*sqr(d[faceI]); const symmTensor wdd(1.0/magSqr(d[faceI])*sqr(d[faceI]));
dd[owner[faceI]] += wdd; dd[owner[faceI]] += wdd;
dd[neighbour[faceI]] += wdd; dd[neighbour[faceI]] += wdd;
@ -146,11 +149,11 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
} }
} }
scalarField detdd = det(dd); scalarField detdd(det(dd));
Info<< "max(detdd) = " << max(detdd) << endl; Info<< "max(detdd) = " << max(detdd) << nl
Info<< "min(detdd) = " << min(detdd) << endl; << "min(detdd) = " << min(detdd) << nl
Info<< "average(detdd) = " << average(detdd) << endl; << "average(detdd) = " << average(detdd) << endl;
label nAddCells = 0; label nAddCells = 0;
label maxNaddCells = 4*detdd.size(); label maxNaddCells = 4*detdd.size();
@ -219,13 +222,13 @@ void Foam::extendedLeastSquaresVectors::makeLeastSquaresVectors() const
additionalCells_.setSize(nAddCells); additionalCells_.setSize(nAddCells);
Info<< "max(detdd) = " << max(detdd) << endl; Info<< "max(detdd) = " << max(detdd) << nl
Info<< "min(detdd) = " << min(detdd) << endl; << "min(detdd) = " << min(detdd) << nl
Info<< "average(detdd) = " << average(detdd) << endl; << "average(detdd) = " << average(detdd) << nl
Info<< "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl; << "nAddCells/nCells = " << scalar(nAddCells)/mesh.nCells() << endl;
// Invert the dd tensor // Invert the dd tensor
symmTensorField invDd = inv(dd); const symmTensorField invDd(inv(dd));
// Revisit all faces and calculate the lsP and lsN vectors // Revisit all faces and calculate the lsP and lsN vectors

View File

@ -122,11 +122,13 @@ Foam::fv::fourthGrad<Type>::calcGrad
const scalarField& lambdap = lambda.boundaryField()[patchi]; const scalarField& lambdap = lambda.boundaryField()[patchi];
// Build the d-vectors // Build the d-vectors
vectorField pd = vectorField pd
(
mesh.Sf().boundaryField()[patchi] mesh.Sf().boundaryField()[patchi]
/ ( / (
mesh.magSf().boundaryField()[patchi] mesh.magSf().boundaryField()[patchi]
* mesh.deltaCoeffs().boundaryField()[patchi] * mesh.deltaCoeffs().boundaryField()[patchi]
)
); );
if (!mesh.orthogonal()) if (!mesh.orthogonal())
@ -138,8 +140,10 @@ Foam::fv::fourthGrad<Type>::calcGrad
const labelUList& faceCells = const labelUList& faceCells =
fGrad.boundaryField()[patchi].patch().faceCells(); fGrad.boundaryField()[patchi].patch().faceCells();
Field<GradType> neighbourSecondfGrad = const Field<GradType> neighbourSecondfGrad
secondfGrad.boundaryField()[patchi].patchNeighbourField(); (
secondfGrad.boundaryField()[patchi].patchNeighbourField()
);
forAll(faceCells, patchFaceI) forAll(faceCells, patchFaceI)
{ {

View File

@ -154,9 +154,11 @@ void Foam::fv::gaussGrad<Type>::correctBoundaryConditions
{ {
if (!vsf.boundaryField()[patchi].coupled()) if (!vsf.boundaryField()[patchi].coupled())
{ {
vectorField n = const vectorField n
(
vsf.mesh().Sf().boundaryField()[patchi] vsf.mesh().Sf().boundaryField()[patchi]
/vsf.mesh().magSf().boundaryField()[patchi]; / vsf.mesh().magSf().boundaryField()[patchi]
);
gGrad.boundaryField()[patchi] += n * gGrad.boundaryField()[patchi] += n *
( (

View File

@ -108,8 +108,10 @@ Foam::fv::leastSquaresGrad<Type>::calcGrad
if (vsf.boundaryField()[patchi].coupled()) if (vsf.boundaryField()[patchi].coupled())
{ {
Field<Type> neiVsf = const Field<Type> neiVsf
vsf.boundaryField()[patchi].patchNeighbourField(); (
vsf.boundaryField()[patchi].patchNeighbourField()
);
forAll(neiVsf, patchFaceI) forAll(neiVsf, patchFaceI)
{ {

View File

@ -130,11 +130,13 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
const labelUList& faceCells = p.patch().faceCells(); const labelUList& faceCells = p.patch().faceCells();
// Build the d-vectors // Build the d-vectors
vectorField pd = vectorField pd
(
mesh.Sf().boundaryField()[patchi] mesh.Sf().boundaryField()[patchi]
/ ( / (
mesh.magSf().boundaryField()[patchi] mesh.magSf().boundaryField()[patchi]
* mesh.deltaCoeffs().boundaryField()[patchi] * mesh.deltaCoeffs().boundaryField()[patchi]
)
); );
if (!mesh.orthogonal()) if (!mesh.orthogonal())
@ -167,7 +169,7 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
// Invert the dd tensor // Invert the dd tensor
symmTensorField invDd = inv(dd); const symmTensorField invDd(inv(dd));
// Revisit all faces and calculate the lsP and lsN vectors // Revisit all faces and calculate the lsP and lsN vectors
@ -194,11 +196,13 @@ void Foam::leastSquaresVectors::makeLeastSquaresVectors() const
const labelUList& faceCells = p.faceCells(); const labelUList& faceCells = p.faceCells();
// Build the d-vectors // Build the d-vectors
vectorField pd = vectorField pd
(
mesh.Sf().boundaryField()[patchi] mesh.Sf().boundaryField()[patchi]
/( /(
mesh.magSf().boundaryField()[patchi] mesh.magSf().boundaryField()[patchi]
*mesh.deltaCoeffs().boundaryField()[patchi] *mesh.deltaCoeffs().boundaryField()[patchi]
)
); );
if (!mesh.orthogonal()) if (!mesh.orthogonal())

View File

@ -97,7 +97,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
scalarField psfNei = psf.patchNeighbourField(); const scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {
@ -126,7 +126,7 @@ Foam::fv::cellLimitedGrad<Foam::scalar>::calcGrad
if (k_ < 1.0) if (k_ < 1.0)
{ {
scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf; maxVsf += maxMinVsf;
minVsf -= maxMinVsf; minVsf -= maxMinVsf;
@ -250,7 +250,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
vectorField psfNei = psf.patchNeighbourField(); const vectorField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {
@ -279,7 +279,7 @@ Foam::fv::cellLimitedGrad<Foam::vector>::calcGrad
if (k_ < 1.0) if (k_ < 1.0)
{ {
vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf; maxVsf += maxMinVsf;
minVsf -= maxMinVsf; minVsf -= maxMinVsf;

View File

@ -98,7 +98,7 @@ Foam::fv::cellMDLimitedGrad<Foam::scalar>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
scalarField psfNei = psf.patchNeighbourField(); const scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {
@ -127,7 +127,7 @@ Foam::fv::cellMDLimitedGrad<Foam::scalar>::calcGrad
if (k_ < 1.0) if (k_ < 1.0)
{ {
scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); const scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf; maxVsf += maxMinVsf;
minVsf -= maxMinVsf; minVsf -= maxMinVsf;
@ -240,7 +240,7 @@ Foam::fv::cellMDLimitedGrad<Foam::vector>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
vectorField psfNei = psf.patchNeighbourField(); const vectorField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {
@ -269,7 +269,7 @@ Foam::fv::cellMDLimitedGrad<Foam::vector>::calcGrad
if (k_ < 1.0) if (k_ < 1.0)
{ {
vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf); const vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf; maxVsf += maxMinVsf;
minVsf -= maxMinVsf; minVsf -= maxMinVsf;

View File

@ -116,7 +116,7 @@ Foam::fv::faceLimitedGrad<Foam::scalar>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
scalarField psfNei = psf.patchNeighbourField(); const scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {
@ -267,7 +267,7 @@ Foam::fv::faceLimitedGrad<Foam::vector>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
vectorField psfNei = psf.patchNeighbourField(); const vectorField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {

View File

@ -119,7 +119,7 @@ Foam::fv::faceMDLimitedGrad<Foam::scalar>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
scalarField psfNei = psf.patchNeighbourField(); const scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {
@ -261,7 +261,7 @@ Foam::fv::faceMDLimitedGrad<Foam::vector>::calcGrad
if (psf.coupled()) if (psf.coupled())
{ {
vectorField psfNei = psf.patchNeighbourField(); const vectorField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei) forAll(pOwner, pFacei)
{ {

View File

@ -153,11 +153,14 @@ gaussLaplacianScheme<Type, GType>::fvmLaplacian
{ {
const fvMesh& mesh = this->mesh(); const fvMesh& mesh = this->mesh();
surfaceVectorField Sn = mesh.Sf()/mesh.magSf(); const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
surfaceVectorField SfGamma = mesh.Sf() & gamma; const surfaceVectorField SfGamma(mesh.Sf() & gamma);
GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn = SfGamma & Sn; const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn; (
SfGamma & Sn
);
const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf); tmp<fvMatrix<Type> > tfvm = fvmLaplacianUncorrected(SfGammaSn, vf);
fvMatrix<Type>& fvm = tfvm(); fvMatrix<Type>& fvm = tfvm();
@ -192,11 +195,13 @@ gaussLaplacianScheme<Type, GType>::fvcLaplacian
{ {
const fvMesh& mesh = this->mesh(); const fvMesh& mesh = this->mesh();
surfaceVectorField Sn = mesh.Sf()/mesh.magSf(); const surfaceVectorField Sn(mesh.Sf()/mesh.magSf());
const surfaceVectorField SfGamma(mesh.Sf() & gamma);
surfaceVectorField SfGamma = mesh.Sf() & gamma; const GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn
GeometricField<scalar, fvsPatchField, surfaceMesh> SfGammaSn = SfGamma & Sn; (
surfaceVectorField SfGammaCorr = SfGamma - SfGammaSn*Sn; SfGamma & Sn
);
const surfaceVectorField SfGammaCorr(SfGamma - SfGammaSn*Sn);
tmp<GeometricField<Type, fvPatchField, volMesh> > tLaplacian tmp<GeometricField<Type, fvPatchField, volMesh> > tLaplacian
( (

View File

@ -66,10 +66,12 @@ limitedSnGrad<Type>::correction
const GeometricField<Type, fvPatchField, volMesh>& vf const GeometricField<Type, fvPatchField, volMesh>& vf
) const ) const
{ {
GeometricField<Type, fvsPatchField, surfaceMesh> corr = const GeometricField<Type, fvsPatchField, surfaceMesh> corr
correctedSnGrad<Type>(this->mesh()).correction(vf); (
correctedSnGrad<Type>(this->mesh()).correction(vf)
);
surfaceScalarField limiter const surfaceScalarField limiter
( (
min min
( (