Commit 7c12f774 authored by Henry Weller's avatar Henry Weller
Browse files

boundaryField() -> boundaryFieldRef()

parent 45f73bf6
......@@ -111,7 +111,7 @@ Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
iomega0[celli] = omega0Sigma(sigma[celli], 1.0);
}
volScalarField::GeometricBoundaryField& bomega0 = omega0.boundaryField();
volScalarField::GeometricBoundaryField& bomega0 = omega0.boundaryFieldRef();
forAll(bomega0, patchi)
{
......
......@@ -384,11 +384,11 @@ Foam::dynamicRefineFvMesh::refine
}
// Recalculate new boundary faces.
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();
forAll(bphi, patchI)
surfaceScalarField::GeometricBoundaryField& phiBf =
phi.boundaryFieldRef();
forAll(phiBf, patchI)
{
fvsPatchScalarField& patchPhi = bphi[patchI];
fvsPatchScalarField& patchPhi = phiBf[patchI];
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
......@@ -430,7 +430,7 @@ Foam::dynamicRefineFvMesh::refine
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
fvsPatchScalarField& patchPhi = phiBf[patchI];
patchPhi[i] = patchPhiU[i];
}
......@@ -574,8 +574,8 @@ Foam::dynamicRefineFvMesh::unrefine
}
surfaceScalarField& phi = *iter();
surfaceScalarField::GeometricBoundaryField& bphi =
phi.boundaryField();
surfaceScalarField::GeometricBoundaryField& phiBf =
phi.boundaryFieldRef();
const surfaceScalarField phiU
(
......@@ -610,7 +610,7 @@ Foam::dynamicRefineFvMesh::unrefine
const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI];
fvsPatchScalarField& patchPhi = phiBf[patchI];
patchPhi[i] = patchPhiU[i];
}
}
......
......@@ -62,7 +62,7 @@ void Foam::fvMeshAdder::MapVolField
// ~~~~~~~~~~~~~~~~~~~~~~~~~~
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& bfld = fld.boundaryField();
GeometricBoundaryField& bfld = fld.boundaryFieldRef();
{
const labelList& oldPatchMap = meshMap.oldPatchMap();
......@@ -330,7 +330,7 @@ void Foam::fvMeshAdder::MapSurfaceField
const labelList& oldPatchStarts = meshMap.oldPatchStarts();
typename GeometricField<Type, fvsPatchField, surfaceMesh>::
GeometricBoundaryField& bfld = fld.boundaryField();
GeometricBoundaryField& bfld = fld.boundaryFieldRef();
// Internal field
// ~~~~~~~~~~~~~~
......
......@@ -114,7 +114,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
{
fldType& fld = *iter();
typename fldType::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldI++];
......@@ -162,7 +162,7 @@ void Foam::fvMeshDistribute::initPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
forAll(bfld, patchI)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -48,7 +48,7 @@ void Foam::fvMeshTools::addPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
label sz = bfld.size();
bfld.setSize(sz+1);
......@@ -102,7 +102,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
if (patchFieldDict.found(fld.name()))
{
......@@ -141,7 +141,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
bfld[patchI] == value;
}
......@@ -160,7 +160,7 @@ void Foam::fvMeshTools::trimPatchFields(fvMesh& mesh, const label nPatches)
forAllIter(typename HashTable<GeoField*>, flds, iter)
{
GeoField& fld = *iter();
fld.boundaryField().setSize(nPatches);
fld.boundaryFieldRef().setSize(nPatches);
}
}
......@@ -183,7 +183,7 @@ void Foam::fvMeshTools::reorderPatchFields
GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField();
fld.boundaryFieldRef();
bfld.reorder(oldToNew);
}
......
......@@ -428,14 +428,17 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
pointVectorField& displacement
)
{
typename pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef();
// Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches)
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
label patchi = patchIDs[i];
displacement.boundaryField()[patchI] ==
displacement.boundaryField()[patchI].patchInternalField();
displacementBf[patchi] ==
displacementBf[patchi].patchInternalField();
}
// Make consistent with non-adapted bc's by evaluating those now and
......@@ -449,18 +452,18 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
forAll(patchSchedule, patchEvalI)
{
label patchI = patchSchedule[patchEvalI].patch;
label patchi = patchSchedule[patchEvalI].patch;
if (!adaptPatchSet.found(patchI))
if (!adaptPatchSet.found(patchi))
{
if (patchSchedule[patchEvalI].init)
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.initEvaluate(Pstream::scheduled);
}
else
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.evaluate(Pstream::scheduled);
}
}
......@@ -474,10 +477,10 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
// by multi-corner constraints into account.
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
label patchi = patchIDs[i];
displacement.boundaryField()[patchI] ==
displacement.boundaryField()[patchI].patchInternalField();
displacementBf[patchi] ==
displacementBf[patchi].patchInternalField();
}
}
......@@ -581,21 +584,24 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule();
typename pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef();
// 1. evaluate on adaptPatches
forAll(patchSchedule, patchEvalI)
{
label patchI = patchSchedule[patchEvalI].patch;
label patchi = patchSchedule[patchEvalI].patch;
if (adaptPatchSet.found(patchI))
if (adaptPatchSet.found(patchi))
{
if (patchSchedule[patchEvalI].init)
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.initEvaluate(Pstream::blocking);
}
else
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.evaluate(Pstream::blocking);
}
}
......@@ -605,18 +611,18 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
// 2. evaluate on non-AdaptPatches
forAll(patchSchedule, patchEvalI)
{
label patchI = patchSchedule[patchEvalI].patch;
label patchi = patchSchedule[patchEvalI].patch;
if (!adaptPatchSet.found(patchI))
if (!adaptPatchSet.found(patchi))
{
if (patchSchedule[patchEvalI].init)
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.initEvaluate(Pstream::blocking);
}
else
{
displacement.boundaryField()[patchI]
displacementBf[patchi]
.evaluate(Pstream::blocking);
}
}
......@@ -757,9 +763,9 @@ Foam::tmp<Foam::pointField> Foam::motionSmootherAlgo::curPoints() const
{
const pointBoundaryMesh& pbm = displacement_.mesh().boundary();
actualPatchTypes.setSize(pbm.size());
forAll(pbm, patchI)
forAll(pbm, patchi)
{
actualPatchTypes[patchI] = pbm[patchI].type();
actualPatchTypes[patchi] = pbm[patchi].type();
}
}
......@@ -768,17 +774,17 @@ Foam::tmp<Foam::pointField> Foam::motionSmootherAlgo::curPoints() const
const pointVectorField::GeometricBoundaryField& pfld =
displacement_.boundaryField();
actualPatchFieldTypes.setSize(pfld.size());
forAll(pfld, patchI)
forAll(pfld, patchi)
{
if (isA<fixedValuePointPatchField<vector>>(pfld[patchI]))
if (isA<fixedValuePointPatchField<vector>>(pfld[patchi]))
{
// Get rid of funny
actualPatchFieldTypes[patchI] =
actualPatchFieldTypes[patchi] =
fixedValuePointPatchField<vector>::typeName;
}
else
{
actualPatchFieldTypes[patchI] = pfld[patchI].type();
actualPatchFieldTypes[patchi] = pfld[patchi].type();
}
}
}
......@@ -847,14 +853,14 @@ bool Foam::motionSmootherAlgo::scaleMesh
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
Pout<< "Entering scaleMesh : coupled patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& pp =
refCast<const coupledPolyPatch>(patches[patchI]);
refCast<const coupledPolyPatch>(patches[patchi]);
Pout<< '\t' << patchI << '\t' << pp.name()
Pout<< '\t' << patchi << '\t' << pp.name()
<< " parallel:" << pp.parallel()
<< " separated:" << pp.separated()
<< " forwardT:" << pp.forwardT().size()
......@@ -1034,20 +1040,20 @@ void Foam::motionSmootherAlgo::updateMesh()
// Check whether displacement has fixed value b.c. on adaptPatchID
forAll(adaptPatchIDs_, i)
{
label patchI = adaptPatchIDs_[i];
label patchi = adaptPatchIDs_[i];
if
(
!isA<fixedValuePointPatchVectorField>
(
displacement_.boundaryField()[patchI]
displacement_.boundaryField()[patchi]
)
)
{
FatalErrorInFunction
<< "Patch " << patches[patchI].name()
<< "Patch " << patches[patchi].name()
<< " has wrong boundary condition "
<< displacement_.boundaryField()[patchI].type()
<< displacement_.boundaryField()[patchi].type()
<< " on field " << displacement_.name() << nl
<< "Only type allowed is "
<< fixedValuePointPatchVectorField::typeName
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -71,7 +71,8 @@ void Foam::fvMotionSolverEngineMesh::move()
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
motionSolver_.pointMotionU().boundaryField()[pistonIndex_] == pistonSpeed;
motionSolver_.pointMotionU().boundaryFieldRef()[pistonIndex_] ==
pistonSpeed;
{
scalarField linerPoints
......@@ -79,7 +80,7 @@ void Foam::fvMotionSolverEngineMesh::move()
boundary()[linerIndex_].patch().localPoints().component(vector::Z)
);
motionSolver_.pointMotionU().boundaryField()[linerIndex_] ==
motionSolver_.pointMotionU().boundaryFieldRef()[linerIndex_] ==
pistonSpeed*pos(deckHeight_.value() - linerPoints)
*(deckHeight_.value() - linerPoints)
/(deckHeight_.value() - pistonPlusLayers);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......
......@@ -223,7 +223,7 @@ void Foam::displacementComponentLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve
(
......
......@@ -121,7 +121,7 @@ void Foam::velocityComponentLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointMotionU_.boundaryField().updateCoeffs();
pointMotionU_.boundaryFieldRef().updateCoeffs();
Foam::solve
(
......
......@@ -121,7 +121,7 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
surfaceScalarField Df(diffusivityPtr_->operator()());
......
......@@ -227,7 +227,7 @@ void Foam::displacementLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivity().correct();
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve
(
......
......@@ -525,7 +525,7 @@ void Foam::displacementLayeredMotionMotionSolver::solve()
movePoints(mesh().points());
// Apply boundary conditions
pointDisplacement_.boundaryField().updateCoeffs();
pointDisplacement_.boundaryFieldRef().updateCoeffs();
// Solve motion on all regions (=cellZones)
const dictionary& regionDicts = coeffDict().subDict("regions");
......
......@@ -116,7 +116,7 @@ void Foam::velocityLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points());
diffusivityPtr_->correct();
pointMotionU_.boundaryField().updateCoeffs();
pointMotionU_.boundaryFieldRef().updateCoeffs();
Foam::solve
(
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -127,9 +127,12 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/sqrt(dist);
}
forAll(faceDiffusivity_.boundaryField(), patchI)
typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
faceDiffusivity_.boundaryFieldRef();
forAll(faceDiffusivityBf, patchI)
{
fvsPatchScalarField& bfld = faceDiffusivity_.boundaryField()[patchI];
fvsPatchScalarField& bfld = faceDiffusivityBf[patchI];
const labelUList& faceCells = bfld.patch().faceCells();
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -152,9 +152,13 @@ void Foam::inversePointDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/dist;
}
forAll(faceDiffusivity_.boundaryField(), patchI)
typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
faceDiffusivity_.boundaryFieldRef();
forAll(faceDiffusivityBf, patchI)
{
fvsPatchScalarField& bfld = faceDiffusivity_.boundaryField()[patchI];
fvsPatchScalarField& bfld = faceDiffusivityBf[patchI];
if (patchSet.found(patchI))
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -95,7 +95,7 @@ void Foam::fv::limitTemperature::correct(volScalarField& he)
// handle boundaries in the case of 'all'
if (selectionMode_ == smAll)
{
volScalarField::GeometricBoundaryField& bf = he.boundaryField();
volScalarField::GeometricBoundaryField& bf = he.boundaryFieldRef();
forAll(bf, patchi)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -197,7 +197,7 @@ void Foam::ParticleErosion<CloudType>::postPatch
const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_);
const label patchFaceI = pp.whichFace(p.face());
scalar& Q = QPtr_->boundaryField()[patchI][patchFaceI];
scalar& Q = QPtr_->boundaryFieldRef()[patchI][patchFaceI];
if (tan(alpha) < K_/6.0)
{
Q += coeff*(sin(2.0*alpha) - 6.0/K_*sqr(sin(alpha)));
......
......@@ -204,7 +204,7 @@ bool Foam::LocalInteraction<CloudType>::correct
{
label pI = pp.index();
label fI = pp.whichFace(p.face());
massEscape().boundaryField()[pI][fI] += dm;
massEscape().boundaryFieldRef()[pI][fI] += dm;
}
break;
}
......@@ -221,7 +221,7 @@ bool Foam::LocalInteraction<CloudType>::correct
{
label pI = pp.index();
label fI = pp.whichFace(p.face());
massStick().boundaryField()[pI][fI] += dm;
massStick().boundaryFieldRef()[pI][fI] += dm;
}
break;
}
......
......@@ -102,7 +102,7 @@ void Foam::displacementMeshMoverMotionSolver::solve()
movePoints(mesh().points());
// Update any point motion bcs (e.g. timevarying)
pointDisplacement().boundaryField().updateCoeffs();
pointDisplacement().boundaryFieldRef().updateCoeffs();
label nAllowableErrors = 0;
labelList checkFaces(identity(mesh().nFaces()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment