COMP: Updated to compile with Clang 3.7.1

This commit is contained in:
Andrew Heather 2017-09-20 13:55:42 +01:00 committed by Andrew Heather
parent 0c64622341
commit 9aff74aaaf
28 changed files with 207 additions and 158 deletions

View File

@ -57,8 +57,8 @@
const areaVectorField& Ns = aMesh.faceAreaNormals();
areaVectorField Gs = g - Ns*(Ns & g);
areaScalarField Gn = mag(g - Gs);
areaVectorField Gs(g - Ns*(Ns & g));
areaScalarField Gn(mag(g - Gs));
// Mass source
areaScalarField Sm

View File

@ -86,7 +86,7 @@ int main(int argc, char *argv[])
UsEqn.relax();
solve(UsEqn == - fac::grad(ps*h)/rhol + ps*fac::grad(h)/rhol);
areaScalarField UsA = UsEqn.A();
areaScalarField UsA(UsEqn.A());
Us = UsEqn.H()/UsA;
Us.correctBoundaryConditions();

View File

@ -41,8 +41,10 @@ scalar velMag = 0.0;
if (aMesh.nInternalEdges())
{
edgeScalarField SfUfbyDelta =
aMesh.edgeInterpolation::deltaCoeffs()*mag(phis);
edgeScalarField SfUfbyDelta
(
aMesh.edgeInterpolation::deltaCoeffs()*mag(phis)
);
CoNum = max(SfUfbyDelta/aMesh.magLe())
.value()*runTime.deltaT().value();
@ -57,4 +59,5 @@ Info<< "Courant Number mean: " << meanCoNum
<< " max: " << CoNum
<< " velocity magnitude: " << velMag << endl;
// ************************************************************************* //

View File

@ -238,7 +238,7 @@ faMatrix<Type>::faMatrix
// Update the boundary coefficients of psi without changing its event No.
GeometricField<Type, faPatchField, areaMesh>& psiRef =
const_cast<GeometricField<Type, faPatchField, areaMesh>&>(psi_);
const_cast<GeometricField<Type, faPatchField, areaMesh>&>(psi_);
label currentStatePsi = psiRef.eventNo();
psiRef.boundaryFieldRef().updateCoeffs();
@ -627,7 +627,7 @@ tmp<GeometricField<Type, faPatchField, areaMesh> > faMatrix<Type>::H() const
// Loop over field components
for (direction cmpt=0; cmpt<Type::nComponents; cmpt++)
{
scalarField psiCmpt = psi_.primitiveField().component(cmpt);
scalarField psiCmpt(psi_.primitiveField().component(cmpt));
scalarField boundaryDiagCmpt(psi_.size(), 0.0);
addBoundaryDiag(boundaryDiagCmpt, cmpt);
@ -760,7 +760,7 @@ void faMatrix<Type>::operator=(const faMatrix<Type>& famv)
{
faceFluxCorrectionPtr_ =
new GeometricField<Type, faePatchField, edgeMesh>
(*famv.faceFluxCorrectionPtr_);
(*famv.faceFluxCorrectionPtr_);
}
}
@ -841,7 +841,7 @@ void faMatrix<Type>::operator-=(const faMatrix<Type>& famv)
{
faceFluxCorrectionPtr_ =
new GeometricField<Type, faePatchField, edgeMesh>
(-*famv.faceFluxCorrectionPtr_);
(-*famv.faceFluxCorrectionPtr_);
}
}
@ -930,7 +930,7 @@ void faMatrix<Type>::operator*=
forAll(boundaryCoeffs_, patchI)
{
scalarField psf = vsf.boundaryField()[patchI].patchInternalField();
const scalarField psf(vsf.boundaryField()[patchI].patchInternalField());
internalCoeffs_[patchI] *= psf;
boundaryCoeffs_[patchI] *= psf;
}

View File

@ -68,9 +68,9 @@ SolverPerformance<Type> faMatrix<Type>::solve(const dictionary& solverControls)
psi_.name()
);
scalarField saveDiag = diag();
scalarField saveDiag(diag());
Field<Type> source = source_;
Field<Type> source(source_);
addBoundarySource(source);
// Make a copy of interfaces: no longer a reference
@ -80,16 +80,16 @@ SolverPerformance<Type> faMatrix<Type>::solve(const dictionary& solverControls)
// Cast into a non-const to solve. HJ, 6/May/2016
GeometricField<Type, faPatchField, areaMesh>& psi =
const_cast<GeometricField<Type, faPatchField, areaMesh>&>(psi_);
const_cast<GeometricField<Type, faPatchField, areaMesh>&>(psi_);
for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++)
{
// copy field and source
scalarField psiCmpt = psi_.primitiveField().component(cmpt);
scalarField psiCmpt(psi_.primitiveField().component(cmpt));
addBoundaryDiag(diag(), cmpt);
scalarField sourceCmpt = source.component(cmpt);
scalarField sourceCmpt(source.component(cmpt));
FieldField<Field, scalar> bouCoeffsCmpt
(
@ -186,7 +186,7 @@ template<class Type>
tmp<Field<Type> > faMatrix<Type>::residual() const
{
tmp<Field<Type> > tres(source_);
Field<Type>& res = tres();
Field<Type>& res = tres().ref();
addBoundarySource(res);
@ -198,7 +198,7 @@ tmp<Field<Type> > faMatrix<Type>::residual() const
// Loop over field components
for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++)
{
scalarField psiCmpt = psi_.internalField().component(cmpt);
scalarField psiCmpt(psi_.internalField().component(cmpt));
scalarField boundaryDiagCmpt(psi_.size(), 0.0);
addBoundaryDiag(boundaryDiagCmpt, cmpt);

View File

@ -49,11 +49,9 @@ void faMatrix<scalar>::setComponentReference
const scalar value
)
{
const labelUList& faceLabels =
psi_.mesh().boundary()[patchI].edgeFaces();
const labelUList& faceLabels = psi_.mesh().boundary()[patchI].edgeFaces();
internalCoeffs_[patchI][edgeI] +=
diag()[faceLabels[edgeI]];
internalCoeffs_[patchI][edgeI] += diag()[faceLabels[edgeI]];
boundaryCoeffs_[patchI][edgeI] = value;
}
@ -75,10 +73,10 @@ solverPerformance faMatrix<scalar>::solve
GeometricField<scalar, faPatchField, areaMesh>& psi =
const_cast<GeometricField<scalar, faPatchField, areaMesh>&>(psi_);
scalarField saveDiag = diag();
scalarField saveDiag(diag());
addBoundaryDiag(diag(), 0);
scalarField totalSource = source_;
scalarField totalSource(source_);
addBoundarySource(totalSource, 0);
// Solver call
@ -148,7 +146,7 @@ tmp<areaScalarField> faMatrix<scalar>::H() const
zeroGradientFaPatchScalarField::typeName
)
);
areaScalarField Hphi = tHphi();
areaScalarField& Hphi = tHphi.ref();
Hphi.primitiveFieldRef() = (lduMatrix::H(psi_.primitiveField()) + source_);
addBoundarySource(Hphi.primitiveFieldRef());

View File

@ -188,7 +188,7 @@ void Foam::faMesh::clearOut() const
Foam::faMesh::faMesh(const polyMesh& pMesh)
:
GeoMesh<polyMesh>(pMesh),
MeshObject<polyMesh, UpdateableMeshObject, faMesh>(pMesh),
MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>(pMesh),
edgeInterpolation(*this),
faceLabels_
(
@ -282,7 +282,7 @@ Foam::faMesh::faMesh
)
:
GeoMesh<polyMesh>(pMesh),
MeshObject<polyMesh, UpdateableMeshObject, faMesh>(pMesh),
MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>(pMesh),
edgeInterpolation(*this),
faceLabels_
(
@ -347,7 +347,7 @@ Foam::faMesh::faMesh
)
:
GeoMesh<polyMesh>(pMesh),
MeshObject<polyMesh, UpdateableMeshObject, faMesh>(pMesh),
MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>(pMesh),
edgeInterpolation(*this),
faceLabels_
(
@ -831,7 +831,7 @@ Foam::faMesh::faMesh
)
:
GeoMesh<polyMesh>(pMesh),
MeshObject<polyMesh, UpdateableMeshObject, faMesh>(pMesh),
MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>(pMesh),
edgeInterpolation(*this),
faceLabels_
(

View File

@ -76,7 +76,7 @@ class faMeshMapper;
class faMesh
:
public GeoMesh<polyMesh>,
public MeshObject<polyMesh, UpdateableMeshObject, faMesh>,
public MeshObject<polyMesh, Foam::UpdateableMeshObject, faMesh>,
public lduMesh,
public edgeInterpolation
{
@ -317,7 +317,12 @@ public:
const polyMesh& mesh() const
{
return
MeshObject<polyMesh, UpdateableMeshObject, faMesh>::mesh();
MeshObject
<
polyMesh,
Foam::UpdateableMeshObject,
faMesh
>::mesh();
}
//- Return the local mesh directory (dbDir()/meshSubDir)

View File

@ -683,8 +683,7 @@ void faMesh::calcFaceCurvatures() const
// fac::edgeIntegrate(Le()*edgeLengthCorrection())
// &faceAreaNormals();
areaVectorField kN =
fac::edgeIntegrate(Le()*edgeLengthCorrection());
areaVectorField kN(fac::edgeIntegrate(Le()*edgeLengthCorrection()));
faceCurvatures = sign(kN&faceAreaNormals())*mag(kN);
}
@ -795,11 +794,9 @@ void faMesh::calcEdgeTransformTensors() const
const labelUList& edgeFaces =
boundary()[patchI].edgeFaces();
vectorField ngbCf =
Cf.boundaryField()[patchI].patchNeighbourField();
vectorField ngbCf(Cf.boundaryField()[patchI].patchNeighbourField());
vectorField ngbNf =
Nf.boundaryField()[patchI].patchNeighbourField();
vectorField ngbNf(Nf.boundaryField()[patchI].patchNeighbourField());
forAll(edgeFaces, edgeI)
{
@ -1304,7 +1301,7 @@ void faMesh::calcPointAreaNormals() const
labelList patchPoints = boundary()[patchI].pointLabels();
vectorField N = boundary()[patchI].ngbPolyPatchPointNormals();
const vectorField N(boundary()[patchI].ngbPolyPatchPointNormals());
forAll (patchPoints, pointI)
{

View File

@ -255,7 +255,7 @@ public:
virtual void initInternalFieldTransfer
(
const Pstream::commsTypes commsType,
labelUList& iF
const labelUList& iF
) const
{}

View File

@ -61,7 +61,7 @@ void Foam::cyclicFaPatch::calcTransforms()
vectorField half0Normals(size()/2);
vectorField half1Normals(size()/2);
vectorField eN = edgeNormals()*magEdgeLengths();
const vectorField eN(edgeNormals()*magEdgeLengths());
scalar maxMatchError = 0;
label errorEdge = -1;
@ -159,7 +159,7 @@ void cyclicFaPatch::makeWeights(scalarField& w) const
{
const scalarField& magL = magEdgeLengths();
scalarField deltas = edgeNormals() & faPatch::delta();
const scalarField deltas(edgeNormals() & faPatch::delta());
label sizeby2 = deltas.size()/2;
scalar maxMatchError = 0;
@ -213,7 +213,7 @@ void cyclicFaPatch::makeWeights(scalarField& w) const
// Make patch edge - neighbour cell distances
void cyclicFaPatch::makeDeltaCoeffs(scalarField& dc) const
{
scalarField deltas = edgeNormals() & faPatch::delta();
const scalarField deltas(edgeNormals() & faPatch::delta());
label sizeby2 = deltas.size()/2;
for (label edgei = 0; edgei < sizeby2; edgei++)
@ -255,7 +255,7 @@ void Foam::cyclicFaPatch::movePoints(const pointField& p)
// Return delta (P to N) vectors across coupled patch
tmp<vectorField> cyclicFaPatch::delta() const
{
vectorField patchD = faPatch::delta();
const vectorField patchD(faPatch::delta());
label sizeby2 = patchD.size()/2;
tmp<vectorField> tpdv(new vectorField(patchD.size()));

View File

@ -350,7 +350,7 @@ Foam::tmp<Foam::vectorField> Foam::faPatch::ngbPolyPatchPointNormals() const
tmp<vectorField> tpN(new vectorField(pntEdges.size(), vector::zero));
vectorField& pN = tpN.ref();
vectorField faceNormals = ngbPolyPatchFaceNormals();
const vectorField faceNormals(ngbPolyPatchFaceNormals());
forAll(pN, pointI)
{

View File

@ -100,7 +100,8 @@ basicSymmetryFaPatchField<Type>::basicSymmetryFaPatchField
template<class Type>
tmp<Field<Type> > basicSymmetryFaPatchField<Type>::snGrad() const
{
vectorField nHat = this->patch().edgeNormals();
const vectorField nHat(this->patch().edgeNormals());
return
(
transform(I - 2.0*sqr(nHat), this->patchInternalField())
@ -118,7 +119,7 @@ void basicSymmetryFaPatchField<Type>::evaluate(const Pstream::commsTypes)
this->updateCoeffs();
}
vectorField nHat = this->patch().edgeNormals();
const vectorField nHat(this->patch().edgeNormals());
Field<Type>::operator=
(
(
@ -135,7 +136,7 @@ void basicSymmetryFaPatchField<Type>::evaluate(const Pstream::commsTypes)
template<class Type>
tmp<Field<Type> > basicSymmetryFaPatchField<Type>::snGradTransformDiag() const
{
vectorField nHat = this->patch().edgeNormals();
const vectorField nHat(this->patch().edgeNormals());
vectorField diag(nHat.size());
diag.replace(vector::X, mag(nHat.component(vector::X)));

View File

@ -127,7 +127,7 @@ wedgeFaPatchField<Type>::wedgeFaPatchField
template<class Type>
tmp<Field<Type> > wedgeFaPatchField<Type>::snGrad() const
{
Field<Type> pif = this->patchInternalField();
const Field<Type> pif(this->patchInternalField());
return
(

View File

@ -96,9 +96,11 @@ gaussConvectionScheme<Type>::famDiv
// }
// Non-euclidian and other corrections
GeometricField<Type, faePatchField, edgeMesh> convFluxCorr =
GeometricField<Type, faePatchField, edgeMesh> convFluxCorr
(
flux(faceFlux, vf)
- faceFlux*tinterpScheme_().euclidianInterpolate(vf);;
- faceFlux*tinterpScheme_().euclidianInterpolate(vf)
);
fam += fac::edgeIntegrate(convFluxCorr);

View File

@ -197,7 +197,8 @@ boundedBackwardFaDdtScheme::facDdt
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
areaScalarField phict =
areaScalarField phict
(
mag
(
vf.oldTime().oldTime()
@ -210,13 +211,14 @@ boundedBackwardFaDdtScheme::facDdt
- vf.oldTime().oldTime()
)
+ dimensionedScalar("small", vf.dimensions(), SMALL)
);
)
);
areaScalarField limiter = pos(phict) - pos(phict - scalar(1));
areaScalarField limiter(pos(phict) - pos(phict - scalar(1)));
areaScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0);
areaScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0));
areaScalarField coefft0 = coefft + coefft00;
areaScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
areaScalarField coefft00(limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)));
areaScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
@ -293,7 +295,8 @@ boundedBackwardFaDdtScheme::facDdt0
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
areaScalarField phict =
areaScalarField phict
(
mag
(
vf.oldTime().oldTime()
@ -306,13 +309,14 @@ boundedBackwardFaDdtScheme::facDdt0
- vf.oldTime().oldTime()
)
+ dimensionedScalar("small", vf.dimensions(), SMALL)
);
)
);
areaScalarField limiter = pos(phict) - pos(phict - scalar(1));
areaScalarField limiter(pos(phict) - pos(phict - scalar(1)));
areaScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0);
areaScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0));
areaScalarField coefft0 = coefft + coefft00;
areaScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
areaScalarField coefft00(limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)));
areaScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
@ -387,7 +391,8 @@ boundedBackwardFaDdtScheme::facDdt
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
areaScalarField phict =
areaScalarField phict
(
mag
(
vf.oldTime().oldTime()
@ -400,13 +405,14 @@ boundedBackwardFaDdtScheme::facDdt
- vf.oldTime().oldTime()
)
+ dimensionedScalar("small", vf.dimensions(), SMALL)
);
)
);
areaScalarField limiter = pos(phict) - pos(phict - scalar(1));
areaScalarField limiter(pos(phict) - pos(phict - scalar(1)));
areaScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0);
areaScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0));
areaScalarField coefft0 = coefft + coefft00;
areaScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
areaScalarField coefft00(limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)));
areaScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
@ -483,7 +489,8 @@ boundedBackwardFaDdtScheme::facDdt0
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
areaScalarField phict =
areaScalarField phict
(
mag
(
vf.oldTime().oldTime()
@ -496,13 +503,14 @@ boundedBackwardFaDdtScheme::facDdt0
- vf.oldTime().oldTime()
)
+ dimensionedScalar("small", vf.dimensions(), SMALL)
);
)
);
areaScalarField limiter = pos(phict) - pos(phict - scalar(1));
areaScalarField limiter(pos(phict) - pos(phict - scalar(1)));
areaScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0);
areaScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0));
areaScalarField coefft0 = coefft + coefft00;
areaScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
areaScalarField coefft00(limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)));
areaScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
@ -577,7 +585,8 @@ boundedBackwardFaDdtScheme::facDdt
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
areaScalarField phict =
areaScalarField phict
(
mag
(
rho.oldTime().oldTime()*vf.oldTime().oldTime()
@ -590,13 +599,14 @@ boundedBackwardFaDdtScheme::facDdt
- rho.oldTime().oldTime()*vf.oldTime().oldTime()
)
+ dimensionedScalar("small", rho.dimensions()*vf.dimensions(), SMALL)
);
)
);
areaScalarField limiter = pos(phict) - pos(phict - scalar(1));
areaScalarField limiter(pos(phict) - pos(phict - scalar(1)));
areaScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0);
areaScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0));
areaScalarField coefft0 = coefft + coefft00;
areaScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
areaScalarField coefft00(limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)));
areaScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
@ -677,7 +687,8 @@ boundedBackwardFaDdtScheme::facDdt0
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
areaScalarField phict =
areaScalarField phict
(
mag
(
rho.oldTime().oldTime()*vf.oldTime().oldTime()
@ -690,13 +701,14 @@ boundedBackwardFaDdtScheme::facDdt0
- rho.oldTime().oldTime()*vf.oldTime().oldTime()
)
+ dimensionedScalar("small", rho.dimensions()*vf.dimensions(), SMALL)
);
)
);
areaScalarField limiter = pos(phict) - pos(phict - scalar(1));
areaScalarField limiter(pos(phict) - pos(phict - scalar(1)));
areaScalarField coefft = scalar(1) + limiter*deltaT/(deltaT + deltaT0);
areaScalarField coefft00 = limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0));
areaScalarField coefft0 = coefft + coefft00;
areaScalarField coefft(scalar(1) + limiter*deltaT/(deltaT + deltaT0));
areaScalarField coefft00(limiter*sqr(deltaT)/(deltaT0*(deltaT + deltaT0)));
areaScalarField coefft0(coefft + coefft00);
if (mesh().moving())
{
@ -775,7 +787,8 @@ boundedBackwardFaDdtScheme::famDdt
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
scalarField phict =
scalarField phict
(
mag
(
vf.oldTime().oldTime().internalField()
@ -788,13 +801,14 @@ boundedBackwardFaDdtScheme::famDdt
- vf.oldTime().oldTime().internalField()
)
+ SMALL
);
)
);
scalarField limiter(pos(phict) - pos(phict - 1.0));
scalarField coefft = 1.0 + limiter*deltaT/(deltaT + deltaT0);
scalarField coefft00 = limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
scalarField coefft0 = coefft + coefft00;
scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0));
scalarField coefft00(limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)));
scalarField coefft0(coefft + coefft00);
fam.diag() = (coefft*rDeltaT)*mesh().S();
@ -845,7 +859,8 @@ boundedBackwardFaDdtScheme::famDdt
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
scalarField phict =
scalarField phict
(
mag
(
vf.oldTime().oldTime().internalField()
@ -858,13 +873,14 @@ boundedBackwardFaDdtScheme::famDdt
- vf.oldTime().oldTime().internalField()
)
+ SMALL
);
)
);
scalarField limiter(pos(phict) - pos(phict - 1.0));
scalarField coefft = 1.0 + limiter*deltaT/(deltaT + deltaT0);
scalarField coefft00 = limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
scalarField coefft0 = coefft + coefft00;
scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0));
scalarField coefft00(limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)));
scalarField coefft0(coefft + coefft00);
fam.diag() = (coefft*rDeltaT*rho.value())*mesh().S();
@ -915,7 +931,8 @@ boundedBackwardFaDdtScheme::famDdt
// Calculate unboundedness indicator
// Note: all times moved by one because access to internal field
// copies current field into the old-time level.
scalarField phict =
scalarField phict
(
mag
(
rho.oldTime().oldTime().internalField()*
@ -932,13 +949,14 @@ boundedBackwardFaDdtScheme::famDdt
vf.oldTime().oldTime().internalField()
)
+ SMALL
);
)
);
scalarField limiter(pos(phict) - pos(phict - 1.0));
scalarField coefft = 1.0 + limiter*deltaT/(deltaT + deltaT0);
scalarField coefft00 = limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0));
scalarField coefft0 = coefft + coefft00;
scalarField coefft(1.0 + limiter*deltaT/(deltaT + deltaT0));
scalarField coefft00(limiter*deltaT*deltaT/(deltaT0*(deltaT + deltaT0)));
scalarField coefft0(coefft + coefft00);
fam.diag() = (coefft*rDeltaT)*rho.primitiveField()*mesh().S();

View File

@ -92,9 +92,11 @@ void gaussGrad<Type>::correctBoundaryConditions
{
if (!vsf.boundaryField()[patchI].coupled())
{
vectorField m =
const vectorField m
(
vsf.mesh().Le().boundaryField()[patchI]/
vsf.mesh().magLe().boundaryField()[patchI];
vsf.mesh().magLe().boundaryField()[patchI]
);
gGrad.boundaryFieldRef()[patchI] += m*
(

View File

@ -98,8 +98,8 @@ leastSquaresFaGrad<Type>::grad
forAll(own, edgei)
{
register label ownEdgeI = own[edgei];
register label neiEdgeI = nei[edgei];
label ownEdgeI = own[edgei];
label neiEdgeI = nei[edgei];
Type deltaVsf = vsf[neiEdgeI] - vsf[ownEdgeI];
@ -117,8 +117,10 @@ leastSquaresFaGrad<Type>::grad
if (vsf.boundaryField()[patchi].coupled())
{
Field<Type> neiVsf =
vsf.boundaryField()[patchi].patchNeighbourField();
Field<Type> neiVsf
(
vsf.boundaryField()[patchi].patchNeighbourField()
);
forAll(neiVsf, patchEdgeI)
{

View File

@ -42,7 +42,7 @@ namespace Foam
Foam::leastSquaresFaVectors::leastSquaresFaVectors(const faMesh& mesh)
:
MeshObject<faMesh, MoveableMeshObject, leastSquaresFaVectors>(mesh),
MeshObject<faMesh, Foam::MoveableMeshObject, leastSquaresFaVectors>(mesh),
pVectorsPtr_(NULL),
nVectorsPtr_(NULL)
{}
@ -135,7 +135,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
// HJ, reconsider deltas at the boundary, consistent with FVM
// Current implementation is good for fixedValue boudaries, but may
// cause problems with fixedGradient. HJ, 4/Oct/2010
vectorField pd = p.delta();
const vectorField pd(p.delta());
if (p.coupled())
{
@ -161,7 +161,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
// Invert the dd tensor
symmTensorField invDd = inv(dd);
const symmTensorField invDd(inv(dd));
// Revisit all faces and calculate the lsP and lsN vectors
@ -187,7 +187,7 @@ void Foam::leastSquaresFaVectors::makeLeastSquaresVectors() const
const labelUList& edgeFaces = p.edgeFaces();
// Build the d-vectors
vectorField pd = p.delta();
const vectorField pd(p.delta());
if (p.coupled())
{

View File

@ -58,7 +58,7 @@ class mapPolyMesh;
class leastSquaresFaVectors
:
public MeshObject<faMesh, MoveableMeshObject, leastSquaresFaVectors>
public MeshObject<faMesh, Foam::MoveableMeshObject, leastSquaresFaVectors>
{
// Private data

View File

@ -141,7 +141,7 @@ tmp<areaVectorField> edgeLimitedGrad<scalar>::grad
if (psf.coupled())
{
scalarField psfNei = psf.patchNeighbourField();
const scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pEdgei)
{
@ -290,7 +290,7 @@ tmp<areaTensorField> edgeLimitedGrad<vector>::grad
if (psf.coupled())
{
vectorField psfNei = psf.patchNeighbourField();
const vectorField psfNei(psf.patchNeighbourField());
forAll(pOwner, pEdgei)
{

View File

@ -78,7 +78,7 @@ inline void faceLimitedGrad<Type>::limitEdge
const Type& extrapolate
)
{
for(direction cmpt = 0; cmpt < Type::nComponents; cmpt++)
for (direction cmpt = 0; cmpt < Type::nComponents; cmpt++)
{
faceLimitedGrad<scalar>::limitEdge
(
@ -145,7 +145,7 @@ tmp<areaVectorField> faceLimitedGrad<scalar>::grad
if (psf.coupled())
{
scalarField psfNei = psf.patchNeighbourField();
scalarField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei)
{
@ -174,7 +174,7 @@ tmp<areaVectorField> faceLimitedGrad<scalar>::grad
if (k_ < 1.0)
{
scalarField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf);
scalarField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf;
minVsf -= maxMinVsf;
}
@ -293,7 +293,7 @@ tmp<areaTensorField> faceLimitedGrad<vector>::grad
if (psf.coupled())
{
vectorField psfNei = psf.patchNeighbourField();
vectorField psfNei(psf.patchNeighbourField());
forAll(pOwner, pFacei)
{
@ -322,7 +322,7 @@ tmp<areaTensorField> faceLimitedGrad<vector>::grad
if (k_ < 1.0)
{
vectorField maxMinVsf = (1.0/k_ - 1.0)*(maxVsf - minVsf);
vectorField maxMinVsf((1.0/k_ - 1.0)*(maxVsf - minVsf));
maxVsf += maxMinVsf;
minVsf -= maxMinVsf;

View File

@ -52,7 +52,7 @@ gaussLaplacianScheme<Type>::famLaplacian
tmp<edgeScalarField> tdeltaCoeffs = this->tlnGradScheme_().deltaCoeffs(vf);
const edgeScalarField& deltaCoeffs = tdeltaCoeffs();
edgeScalarField gammaMagSf = gamma*this->mesh().magLe();
const edgeScalarField gammaMagSf(gamma*this->mesh().magLe());
tmp<faMatrix<Type> > tfam
(

View File

@ -79,7 +79,7 @@ fourthLnGrad<Type>::correction
);
GeometricField<Type, faePatchField, edgeMesh>& corr = tcorr.ref();
edgeVectorField m = mesh.Le()/mesh.magLe();
edgeVectorField m(mesh.Le()/mesh.magLe());
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
{

View File

@ -67,10 +67,12 @@ limitedLnGrad<Type>::correction
const GeometricField<Type, faPatchField, areaMesh>& vf
) const
{
GeometricField<Type, faePatchField, edgeMesh> corr =
correctedLnGrad<Type>(this->mesh()).correction(vf);
const GeometricField<Type, faePatchField, edgeMesh> corr
(
correctedLnGrad<Type>(this->mesh()).correction(vf)
);
edgeScalarField limiter
const edgeScalarField limiter
(
min
(

View File

@ -569,7 +569,7 @@ void edgeInterpolation::makeCorrectionVectors() const
if (owner.size() > 0)
{
scalarField sinAlpha = deltaCoeffs*mag(CorrVecs.internalField());
scalarField sinAlpha(deltaCoeffs*mag(CorrVecs.internalField()));
forAll(sinAlpha, edgeI)
{
@ -660,10 +660,13 @@ void edgeInterpolation::makeSkewCorrectionVectors() const
}
edgeVectorField::Boundary& bSkewCorrVecs =
SkewCorrVecs.boundaryFieldRef();
forAll(SkewCorrVecs.boundaryField(), patchI)
{
faePatchVectorField& patchSkewCorrVecs =
SkewCorrVecs.boundaryFieldRef()[patchI];
faePatchVectorField& patchSkewCorrVecs = bSkewCorrVecs[patchI];
if (patchSkewCorrVecs.coupled())
{
@ -673,8 +676,7 @@ void edgeInterpolation::makeSkewCorrectionVectors() const
const edgeList::subList patchEdges =
mesh().boundary()[patchI].patchSlice(edges);
vectorField ngbC =
C.boundaryField()[patchI].patchNeighbourField();
vectorField ngbC(C.boundaryField()[patchI].patchNeighbourField());
forAll (patchSkewCorrVecs, edgeI)
{
@ -683,8 +685,9 @@ void edgeInterpolation::makeSkewCorrectionVectors() const
vector S = points[patchEdges[edgeI].start()];
vector e = patchEdges[edgeI].vec(points);
scalar alpha = - ( ( (N - P)^(S - P) )&( (N - P)^e ) )/
( ( (N - P)^e )&( (N - P)^e ) );
scalar alpha =
- (((N - P)^(S - P))&((N - P)^e))
/(((N - P)^e)&((N - P)^e));
vector E = S + alpha*e;

View File

@ -209,7 +209,7 @@ edgeInterpolationScheme<Type>::interpolate
Field<Type>& sfi = sf.primitiveFieldRef();
for (register label fi=0; fi<P.size(); fi++)
for (label fi=0; fi<P.size(); fi++)
{
// ZT, 22/Apr/2003
const tensorField& curT = mesh.edgeTransformTensors()[fi];
@ -330,7 +330,7 @@ edgeInterpolationScheme<Type>::interpolate
Field<Type>& sfi = sf.primitiveFieldRef();
for (register label eI = 0; eI < P.size(); eI++)
for (label eI = 0; eI < P.size(); eI++)
{
// ZT, 22/Apr/2003
const tensorField& curT = mesh.edgeTransformTensors()[eI];
@ -360,8 +360,8 @@ edgeInterpolationScheme<Type>::interpolate
label size = vf.boundaryField()[pi].patch().size();
label start = vf.boundaryField()[pi].patch().start();
Field<Type> pOwnVf = vf.boundaryField()[pi].patchInternalField();
Field<Type> pNgbVf = vf.boundaryField()[pi].patchNeighbourField();
Field<Type> pOwnVf(vf.boundaryField()[pi].patchInternalField());
Field<Type> pNgbVf(vf.boundaryField()[pi].patchNeighbourField());
Field<Type>& pSf = sf.boundaryFieldRef()[pi];
@ -449,7 +449,7 @@ edgeInterpolationScheme<Type>::euclidianInterpolate
Field<Type>& sfi = sf.primitiveFieldRef();
for (register label eI = 0; eI < P.size(); eI++)
for (label eI = 0; eI < P.size(); eI++)
{
sfi[eI] = lambda[eI]*vfi[P[eI]] + (1 - lambda[eI])*vfi[N[eI]];
}

View File

@ -55,11 +55,13 @@ inline tmp<areaScalarField> limiter(const areaScalarField& phi)
return phi;
}
inline tmp<areaScalarField> limiter(const areaVectorField& phi)
{
return magSqr(phi);
}
inline tmp<areaScalarField> limiter(const areaTensorField& phi)
{
return magSqr(phi);
@ -88,11 +90,13 @@ tmp<edgeScalarField> faNVDscheme<Type,NVDweight>::weights
tmp<areaScalarField> tvf = limiter(phi);
const areaScalarField& vf = tvf();
areaVectorField gradc(fac::grad(vf));
const areaVectorField gradc(fac::grad(vf));
// edgeVectorField d =
// edgeVectorField d
// (
// mesh.Le()
// /(mesh.magLe()*mesh.edgeInterpolation::deltaCoeffs());
// /(mesh.magLe()*mesh.edgeInterpolation::deltaCoeffs())
// );
// if (!mesh.orthogonal())
// {
@ -110,7 +114,7 @@ tmp<edgeScalarField> faNVDscheme<Type,NVDweight>::weights
{
vector d = vector::zero;
if(edgeFlux_[edge] > 0)
if (edgeFlux_[edge] > 0)
{
d = c[neighbour[edge]] - c[owner[edge]];
d -= n[owner[edge]]*(n[owner[edge]]&d);
@ -148,41 +152,53 @@ tmp<edgeScalarField> faNVDscheme<Type,NVDweight>::weights
const scalarField& pEdgeFlux = edgeFlux_.boundaryField()[patchI];
scalarField pVfP =
vf.boundaryField()[patchI].patchInternalField();
scalarField pVfP(vf.boundaryField()[patchI].patchInternalField());
scalarField pVfN =
vf.boundaryField()[patchI].patchNeighbourField();
scalarField pVfN(vf.boundaryField()[patchI].patchNeighbourField());
vectorField pGradcP =
gradc.boundaryField()[patchI].patchInternalField();
vectorField pGradcP
(
gradc.boundaryField()[patchI].patchInternalField()
);
vectorField pGradcN =
gradc.boundaryField()[patchI].patchNeighbourField();
vectorField pGradcN
(
gradc.boundaryField()[patchI].patchNeighbourField()
);
vectorField CP = mesh.areaCentres().boundaryField()[patchI]
.patchInternalField();
vectorField CP
(
mesh.areaCentres().boundaryField()[patchI].patchInternalField()
);
vectorField CN =
vectorField CN
(
mesh.areaCentres().boundaryField()[patchI]
.patchNeighbourField();
.patchNeighbourField()
);
vectorField nP =
vectorField nP
(
mesh.faceAreaNormals().boundaryField()[patchI]
.patchInternalField();
.patchInternalField()
);
vectorField nN =
vectorField nN
(
mesh.faceAreaNormals().boundaryField()[patchI]
.patchNeighbourField();
.patchNeighbourField()
);
scalarField pLPN =
mesh.edgeInterpolation::lPN().boundaryField()[patchI];
scalarField pLPN
(
mesh.edgeInterpolation::lPN().boundaryField()[patchI]
);
forAll(pWeights, edgeI)
{
vector d = vector::zero;
if(pEdgeFlux[edgeI] > 0)
if (pEdgeFlux[edgeI] > 0)
{
d = CN[edgeI] - CP[edgeI];
d -= nP[edgeI]*(nP[edgeI]&d);