boundaryField() -> boundaryFieldRef()

This commit is contained in:
Henry Weller
2016-04-23 23:16:30 +01:00
parent 45f73bf64f
commit 7c12f7743b
26 changed files with 142 additions and 110 deletions

View File

@ -111,7 +111,7 @@ Foam::tmp<Foam::volScalarField> Foam::consumptionSpeed::omega0Sigma
iomega0[celli] = omega0Sigma(sigma[celli], 1.0); iomega0[celli] = omega0Sigma(sigma[celli], 1.0);
} }
volScalarField::GeometricBoundaryField& bomega0 = omega0.boundaryField(); volScalarField::GeometricBoundaryField& bomega0 = omega0.boundaryFieldRef();
forAll(bomega0, patchi) forAll(bomega0, patchi)
{ {

View File

@ -384,11 +384,11 @@ Foam::dynamicRefineFvMesh::refine
} }
// Recalculate new boundary faces. // Recalculate new boundary faces.
surfaceScalarField::GeometricBoundaryField& bphi = surfaceScalarField::GeometricBoundaryField& phiBf =
phi.boundaryField(); phi.boundaryFieldRef();
forAll(bphi, patchI) forAll(phiBf, patchI)
{ {
fvsPatchScalarField& patchPhi = bphi[patchI]; fvsPatchScalarField& patchPhi = phiBf[patchI];
const fvsPatchScalarField& patchPhiU = const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI]; phiU.boundaryField()[patchI];
@ -430,7 +430,7 @@ Foam::dynamicRefineFvMesh::refine
const fvsPatchScalarField& patchPhiU = const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI]; phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI]; fvsPatchScalarField& patchPhi = phiBf[patchI];
patchPhi[i] = patchPhiU[i]; patchPhi[i] = patchPhiU[i];
} }
@ -574,8 +574,8 @@ Foam::dynamicRefineFvMesh::unrefine
} }
surfaceScalarField& phi = *iter(); surfaceScalarField& phi = *iter();
surfaceScalarField::GeometricBoundaryField& bphi = surfaceScalarField::GeometricBoundaryField& phiBf =
phi.boundaryField(); phi.boundaryFieldRef();
const surfaceScalarField phiU const surfaceScalarField phiU
( (
@ -610,7 +610,7 @@ Foam::dynamicRefineFvMesh::unrefine
const fvsPatchScalarField& patchPhiU = const fvsPatchScalarField& patchPhiU =
phiU.boundaryField()[patchI]; phiU.boundaryField()[patchI];
fvsPatchScalarField& patchPhi = bphi[patchI]; fvsPatchScalarField& patchPhi = phiBf[patchI];
patchPhi[i] = patchPhiU[i]; patchPhi[i] = patchPhiU[i];
} }
} }

View File

@ -62,7 +62,7 @@ void Foam::fvMeshAdder::MapVolField
// ~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~
typename GeometricField<Type, fvPatchField, volMesh>:: typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& bfld = fld.boundaryField(); GeometricBoundaryField& bfld = fld.boundaryFieldRef();
{ {
const labelList& oldPatchMap = meshMap.oldPatchMap(); const labelList& oldPatchMap = meshMap.oldPatchMap();
@ -330,7 +330,7 @@ void Foam::fvMeshAdder::MapSurfaceField
const labelList& oldPatchStarts = meshMap.oldPatchStarts(); const labelList& oldPatchStarts = meshMap.oldPatchStarts();
typename GeometricField<Type, fvsPatchField, surfaceMesh>:: typename GeometricField<Type, fvsPatchField, surfaceMesh>::
GeometricBoundaryField& bfld = fld.boundaryField(); GeometricBoundaryField& bfld = fld.boundaryFieldRef();
// Internal field // Internal field
// ~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~

View File

@ -114,7 +114,7 @@ void Foam::fvMeshDistribute::mapBoundaryFields
{ {
fldType& fld = *iter(); fldType& fld = *iter();
typename fldType::GeometricBoundaryField& bfld = typename fldType::GeometricBoundaryField& bfld =
fld.boundaryField(); fld.boundaryFieldRef();
const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldI++]; const FieldField<fvsPatchField, T>& oldBfld = oldBflds[fieldI++];
@ -162,7 +162,7 @@ void Foam::fvMeshDistribute::initPatchFields
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField(); fld.boundaryFieldRef();
forAll(bfld, patchI) forAll(bfld, patchI)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -48,7 +48,7 @@ void Foam::fvMeshTools::addPatchFields
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField(); fld.boundaryFieldRef();
label sz = bfld.size(); label sz = bfld.size();
bfld.setSize(sz+1); bfld.setSize(sz+1);
@ -102,7 +102,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField(); fld.boundaryFieldRef();
if (patchFieldDict.found(fld.name())) if (patchFieldDict.found(fld.name()))
{ {
@ -141,7 +141,7 @@ void Foam::fvMeshTools::setPatchFields
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField(); fld.boundaryFieldRef();
bfld[patchI] == value; bfld[patchI] == value;
} }
@ -160,7 +160,7 @@ void Foam::fvMeshTools::trimPatchFields(fvMesh& mesh, const label nPatches)
forAllIter(typename HashTable<GeoField*>, flds, iter) forAllIter(typename HashTable<GeoField*>, flds, iter)
{ {
GeoField& fld = *iter(); GeoField& fld = *iter();
fld.boundaryField().setSize(nPatches); fld.boundaryFieldRef().setSize(nPatches);
} }
} }
@ -183,7 +183,7 @@ void Foam::fvMeshTools::reorderPatchFields
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryField(); fld.boundaryFieldRef();
bfld.reorder(oldToNew); bfld.reorder(oldToNew);
} }

View File

@ -428,14 +428,17 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
pointVectorField& displacement pointVectorField& displacement
) )
{ {
typename pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef();
// Adapt the fixedValue bc's (i.e. copy internal point data to // Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches) // boundaryField for all affected patches)
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchi = patchIDs[i];
displacement.boundaryField()[patchI] == displacementBf[patchi] ==
displacement.boundaryField()[patchI].patchInternalField(); displacementBf[patchi].patchInternalField();
} }
// Make consistent with non-adapted bc's by evaluating those now and // Make consistent with non-adapted bc's by evaluating those now and
@ -449,18 +452,18 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
forAll(patchSchedule, patchEvalI) 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) if (patchSchedule[patchEvalI].init)
{ {
displacement.boundaryField()[patchI] displacementBf[patchi]
.initEvaluate(Pstream::scheduled); .initEvaluate(Pstream::scheduled);
} }
else else
{ {
displacement.boundaryField()[patchI] displacementBf[patchi]
.evaluate(Pstream::scheduled); .evaluate(Pstream::scheduled);
} }
} }
@ -474,10 +477,10 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
// by multi-corner constraints into account. // by multi-corner constraints into account.
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchi = patchIDs[i];
displacement.boundaryField()[patchI] == displacementBf[patchi] ==
displacement.boundaryField()[patchI].patchInternalField(); displacementBf[patchi].patchInternalField();
} }
} }
@ -581,21 +584,24 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule(); const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule();
typename pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef();
// 1. evaluate on adaptPatches // 1. evaluate on adaptPatches
forAll(patchSchedule, patchEvalI) 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) if (patchSchedule[patchEvalI].init)
{ {
displacement.boundaryField()[patchI] displacementBf[patchi]
.initEvaluate(Pstream::blocking); .initEvaluate(Pstream::blocking);
} }
else else
{ {
displacement.boundaryField()[patchI] displacementBf[patchi]
.evaluate(Pstream::blocking); .evaluate(Pstream::blocking);
} }
} }
@ -605,18 +611,18 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
// 2. evaluate on non-AdaptPatches // 2. evaluate on non-AdaptPatches
forAll(patchSchedule, patchEvalI) 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) if (patchSchedule[patchEvalI].init)
{ {
displacement.boundaryField()[patchI] displacementBf[patchi]
.initEvaluate(Pstream::blocking); .initEvaluate(Pstream::blocking);
} }
else else
{ {
displacement.boundaryField()[patchI] displacementBf[patchi]
.evaluate(Pstream::blocking); .evaluate(Pstream::blocking);
} }
} }
@ -757,9 +763,9 @@ Foam::tmp<Foam::pointField> Foam::motionSmootherAlgo::curPoints() const
{ {
const pointBoundaryMesh& pbm = displacement_.mesh().boundary(); const pointBoundaryMesh& pbm = displacement_.mesh().boundary();
actualPatchTypes.setSize(pbm.size()); 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 = const pointVectorField::GeometricBoundaryField& pfld =
displacement_.boundaryField(); displacement_.boundaryField();
actualPatchFieldTypes.setSize(pfld.size()); 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 // Get rid of funny
actualPatchFieldTypes[patchI] = actualPatchFieldTypes[patchi] =
fixedValuePointPatchField<vector>::typeName; fixedValuePointPatchField<vector>::typeName;
} }
else else
{ {
actualPatchFieldTypes[patchI] = pfld[patchI].type(); actualPatchFieldTypes[patchi] = pfld[patchi].type();
} }
} }
} }
@ -847,14 +853,14 @@ bool Foam::motionSmootherAlgo::scaleMesh
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh_.boundaryMesh();
Pout<< "Entering scaleMesh : coupled patches:" << endl; Pout<< "Entering scaleMesh : coupled patches:" << endl;
forAll(patches, patchI) forAll(patches, patchi)
{ {
if (patches[patchI].coupled()) if (patches[patchi].coupled())
{ {
const coupledPolyPatch& pp = 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() << " parallel:" << pp.parallel()
<< " separated:" << pp.separated() << " separated:" << pp.separated()
<< " forwardT:" << pp.forwardT().size() << " forwardT:" << pp.forwardT().size()
@ -1034,20 +1040,20 @@ void Foam::motionSmootherAlgo::updateMesh()
// Check whether displacement has fixed value b.c. on adaptPatchID // Check whether displacement has fixed value b.c. on adaptPatchID
forAll(adaptPatchIDs_, i) forAll(adaptPatchIDs_, i)
{ {
label patchI = adaptPatchIDs_[i]; label patchi = adaptPatchIDs_[i];
if if
( (
!isA<fixedValuePointPatchVectorField> !isA<fixedValuePointPatchVectorField>
( (
displacement_.boundaryField()[patchI] displacement_.boundaryField()[patchi]
) )
) )
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Patch " << patches[patchI].name() << "Patch " << patches[patchi].name()
<< " has wrong boundary condition " << " has wrong boundary condition "
<< displacement_.boundaryField()[patchI].type() << displacement_.boundaryField()[patchi].type()
<< " on field " << displacement_.name() << nl << " on field " << displacement_.name() << nl
<< "Only type allowed is " << "Only type allowed is "
<< fixedValuePointPatchVectorField::typeName << fixedValuePointPatchVectorField::typeName

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -71,7 +71,8 @@ void Foam::fvMotionSolverEngineMesh::move()
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue(); scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
motionSolver_.pointMotionU().boundaryField()[pistonIndex_] == pistonSpeed; motionSolver_.pointMotionU().boundaryFieldRef()[pistonIndex_] ==
pistonSpeed;
{ {
scalarField linerPoints scalarField linerPoints
@ -79,7 +80,7 @@ void Foam::fvMotionSolverEngineMesh::move()
boundary()[linerIndex_].patch().localPoints().component(vector::Z) boundary()[linerIndex_].patch().localPoints().component(vector::Z)
); );
motionSolver_.pointMotionU().boundaryField()[linerIndex_] == motionSolver_.pointMotionU().boundaryFieldRef()[linerIndex_] ==
pistonSpeed*pos(deckHeight_.value() - linerPoints) pistonSpeed*pos(deckHeight_.value() - linerPoints)
*(deckHeight_.value() - linerPoints) *(deckHeight_.value() - linerPoints)
/(deckHeight_.value() - pistonPlusLayers); /(deckHeight_.value() - pistonPlusLayers);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -223,7 +223,7 @@ void Foam::displacementComponentLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points()); movePoints(fvMesh_.points());
diffusivityPtr_->correct(); diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs(); pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve Foam::solve
( (

View File

@ -121,7 +121,7 @@ void Foam::velocityComponentLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points()); movePoints(fvMesh_.points());
diffusivityPtr_->correct(); diffusivityPtr_->correct();
pointMotionU_.boundaryField().updateCoeffs(); pointMotionU_.boundaryFieldRef().updateCoeffs();
Foam::solve Foam::solve
( (

View File

@ -121,7 +121,7 @@ void Foam::displacementSBRStressFvMotionSolver::solve()
movePoints(fvMesh_.points()); movePoints(fvMesh_.points());
diffusivityPtr_->correct(); diffusivityPtr_->correct();
pointDisplacement_.boundaryField().updateCoeffs(); pointDisplacement_.boundaryFieldRef().updateCoeffs();
surfaceScalarField Df(diffusivityPtr_->operator()()); surfaceScalarField Df(diffusivityPtr_->operator()());

View File

@ -227,7 +227,7 @@ void Foam::displacementLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points()); movePoints(fvMesh_.points());
diffusivity().correct(); diffusivity().correct();
pointDisplacement_.boundaryField().updateCoeffs(); pointDisplacement_.boundaryFieldRef().updateCoeffs();
Foam::solve Foam::solve
( (

View File

@ -525,7 +525,7 @@ void Foam::displacementLayeredMotionMotionSolver::solve()
movePoints(mesh().points()); movePoints(mesh().points());
// Apply boundary conditions // Apply boundary conditions
pointDisplacement_.boundaryField().updateCoeffs(); pointDisplacement_.boundaryFieldRef().updateCoeffs();
// Solve motion on all regions (=cellZones) // Solve motion on all regions (=cellZones)
const dictionary& regionDicts = coeffDict().subDict("regions"); const dictionary& regionDicts = coeffDict().subDict("regions");

View File

@ -116,7 +116,7 @@ void Foam::velocityLaplacianFvMotionSolver::solve()
movePoints(fvMesh_.points()); movePoints(fvMesh_.points());
diffusivityPtr_->correct(); diffusivityPtr_->correct();
pointMotionU_.boundaryField().updateCoeffs(); pointMotionU_.boundaryFieldRef().updateCoeffs();
Foam::solve Foam::solve
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -127,9 +127,12 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/sqrt(dist); 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(); const labelUList& faceCells = bfld.patch().faceCells();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -152,9 +152,13 @@ void Foam::inversePointDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/dist; 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)) if (patchSet.found(patchI))
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -95,7 +95,7 @@ void Foam::fv::limitTemperature::correct(volScalarField& he)
// handle boundaries in the case of 'all' // handle boundaries in the case of 'all'
if (selectionMode_ == smAll) if (selectionMode_ == smAll)
{ {
volScalarField::GeometricBoundaryField& bf = he.boundaryField(); volScalarField::GeometricBoundaryField& bf = he.boundaryFieldRef();
forAll(bf, patchi) forAll(bf, patchi)
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -197,7 +197,7 @@ void Foam::ParticleErosion<CloudType>::postPatch
const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_); const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_);
const label patchFaceI = pp.whichFace(p.face()); 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) if (tan(alpha) < K_/6.0)
{ {
Q += coeff*(sin(2.0*alpha) - 6.0/K_*sqr(sin(alpha))); Q += coeff*(sin(2.0*alpha) - 6.0/K_*sqr(sin(alpha)));

View File

@ -204,7 +204,7 @@ bool Foam::LocalInteraction<CloudType>::correct
{ {
label pI = pp.index(); label pI = pp.index();
label fI = pp.whichFace(p.face()); label fI = pp.whichFace(p.face());
massEscape().boundaryField()[pI][fI] += dm; massEscape().boundaryFieldRef()[pI][fI] += dm;
} }
break; break;
} }
@ -221,7 +221,7 @@ bool Foam::LocalInteraction<CloudType>::correct
{ {
label pI = pp.index(); label pI = pp.index();
label fI = pp.whichFace(p.face()); label fI = pp.whichFace(p.face());
massStick().boundaryField()[pI][fI] += dm; massStick().boundaryFieldRef()[pI][fI] += dm;
} }
break; break;
} }

View File

@ -102,7 +102,7 @@ void Foam::displacementMeshMoverMotionSolver::solve()
movePoints(mesh().points()); movePoints(mesh().points());
// Update any point motion bcs (e.g. timevarying) // Update any point motion bcs (e.g. timevarying)
pointDisplacement().boundaryField().updateCoeffs(); pointDisplacement().boundaryFieldRef().updateCoeffs();
label nAllowableErrors = 0; label nAllowableErrors = 0;
labelList checkFaces(identity(mesh().nFaces())); labelList checkFaces(identity(mesh().nFaces()));

View File

@ -199,7 +199,6 @@ void Foam::meshRefinement::collectAndPrint
} }
//template<class T, class Mesh>
template<class GeoField> template<class GeoField>
void Foam::meshRefinement::addPatchFields void Foam::meshRefinement::addPatchFields
( (
@ -215,11 +214,12 @@ void Foam::meshRefinement::addPatchFields
forAllIter(typename HashTable<GeoField*>, flds, iter) forAllIter(typename HashTable<GeoField*>, flds, iter)
{ {
GeoField& fld = *iter(); GeoField& fld = *iter();
typename GeoField::GeometricBoundaryField& bfld = fld.boundaryField(); typename GeoField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
label sz = bfld.size(); label sz = fldBf.size();
bfld.setSize(sz+1); fldBf.setSize(sz+1);
bfld.set fldBf.set
( (
sz, sz,
GeoField::PatchFieldType::New GeoField::PatchFieldType::New
@ -233,7 +233,6 @@ void Foam::meshRefinement::addPatchFields
} }
// Reorder patch field
template<class GeoField> template<class GeoField>
void Foam::meshRefinement::reorderPatchFields void Foam::meshRefinement::reorderPatchFields
( (
@ -248,10 +247,7 @@ void Foam::meshRefinement::reorderPatchFields
forAllIter(typename HashTable<GeoField*>, flds, iter) forAllIter(typename HashTable<GeoField*>, flds, iter)
{ {
GeoField& fld = *iter(); iter()->boundaryFieldRef().reorder(oldToNew);
typename GeoField::GeometricBoundaryField& bfld = fld.boundaryField();
bfld.reorder(oldToNew);
} }
} }

View File

@ -2657,6 +2657,10 @@ bool Foam::snappyLayerDriver::writeLayerData
fixedValueFvPatchScalarField::typeName fixedValueFvPatchScalarField::typeName
); );
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchI = patchIDs[i];
@ -2667,7 +2671,7 @@ bool Foam::snappyLayerDriver::writeLayerData
{ {
pfld[i] = cellNLayers[faceCells[i]]; pfld[i] = cellNLayers[faceCells[i]];
} }
fld.boundaryField()[patchI] == pfld; fldBf[patchI] == pfld;
} }
Info<< indent << fld.name() << " : actual number of layers" Info<< indent << fld.name() << " : actual number of layers"
<< endl; << endl;
@ -2690,11 +2694,16 @@ bool Foam::snappyLayerDriver::writeLayerData
dimensionedScalar("zero", dimless, 0), dimensionedScalar("zero", dimless, 0),
fixedValueFvPatchScalarField::typeName fixedValueFvPatchScalarField::typeName
); );
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchI = patchIDs[i];
fld.boundaryField()[patchI] == pbm[patchI].patchSlice fldBf[patchI] == pbm[patchI].patchSlice
( (
faceRealThickness faceRealThickness
); );
@ -2720,7 +2729,12 @@ bool Foam::snappyLayerDriver::writeLayerData
dimensionedScalar("zero", dimless, 0), dimensionedScalar("zero", dimless, 0),
fixedValueFvPatchScalarField::typeName fixedValueFvPatchScalarField::typeName
); );
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef();
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
label patchI = patchIDs[i]; label patchI = patchIDs[i];
@ -2744,7 +2758,7 @@ bool Foam::snappyLayerDriver::writeLayerData
} }
} }
fld.boundaryField()[patchI] == pfld; fldBf[patchI] == pfld;
} }
Info<< indent << fld.name() Info<< indent << fld.name()
<< " : overall layer thickness (fraction" << " : overall layer thickness (fraction"

View File

@ -99,13 +99,16 @@ void Foam::nearWallFields::sampleBoundaryField
sampledValues sampledValues
); );
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& fldBf = fld.boundaryFieldRef();
// Pick up data // Pick up data
label nPatchFaces = 0; label nPatchFaces = 0;
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchI = iter.key(); label patchi = iter.key();
fvPatchField<Type>& pfld = fld.boundaryField()[patchI]; fvPatchField<Type>& pfld = fldBf[patchi];
Field<Type> newFld(pfld.size()); Field<Type> newFld(pfld.size());
forAll(pfld, i) forAll(pfld, i)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -223,13 +223,15 @@ void Foam::dsmcFields::write()
const fvMesh& mesh = fDMean.mesh(); const fvMesh& mesh = fDMean.mesh();
volScalarField::GeometricBoundaryField& pBf = p.boundaryFieldRef();
forAll(mesh.boundaryMesh(), i) forAll(mesh.boundaryMesh(), i)
{ {
const polyPatch& patch = mesh.boundaryMesh()[i]; const polyPatch& patch = mesh.boundaryMesh()[i];
if (isA<wallPolyPatch>(patch)) if (isA<wallPolyPatch>(patch))
{ {
p.boundaryField()[i] = pBf[i] =
fDMean.boundaryField()[i] fDMean.boundaryField()[i]
& (patch.faceAreas()/mag(patch.faceAreas())); & (patch.faceAreas()/mag(patch.faceAreas()));
} }

View File

@ -61,13 +61,13 @@ void Foam::wallShearStress::calcShearStress
{ {
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchI = iter.key(); label patchi = iter.key();
const polyPatch& pp = mesh.boundaryMesh()[patchI]; const polyPatch& pp = mesh.boundaryMesh()[patchi];
vectorField& ssp = shearStress.boundaryField()[patchI]; vectorField& ssp = shearStress.boundaryFieldRef()[patchi];
const vectorField& Sfp = mesh.Sf().boundaryField()[patchI]; const vectorField& Sfp = mesh.Sf().boundaryField()[patchi];
const scalarField& magSfp = mesh.magSf().boundaryField()[patchI]; const scalarField& magSfp = mesh.magSf().boundaryField()[patchi];
const symmTensorField& Reffp = Reff.boundaryField()[patchI]; const symmTensorField& Reffp = Reff.boundaryField()[patchi];
ssp = (-Sfp/magSfp) & Reffp; ssp = (-Sfp/magSfp) & Reffp;
@ -175,11 +175,11 @@ void Foam::wallShearStress::read(const dictionary& dict)
if (patchSet_.empty()) if (patchSet_.empty())
{ {
forAll(pbm, patchI) forAll(pbm, patchi)
{ {
if (isA<wallPolyPatch>(pbm[patchI])) if (isA<wallPolyPatch>(pbm[patchi]))
{ {
patchSet_.insert(patchI); patchSet_.insert(patchi);
} }
} }
@ -191,17 +191,17 @@ void Foam::wallShearStress::read(const dictionary& dict)
labelHashSet filteredPatchSet; labelHashSet filteredPatchSet;
forAllConstIter(labelHashSet, patchSet_, iter) forAllConstIter(labelHashSet, patchSet_, iter)
{ {
label patchI = iter.key(); label patchi = iter.key();
if (isA<wallPolyPatch>(pbm[patchI])) if (isA<wallPolyPatch>(pbm[patchi]))
{ {
filteredPatchSet.insert(patchI); filteredPatchSet.insert(patchi);
Info<< " " << pbm[patchI].name() << endl; Info<< " " << pbm[patchi].name() << endl;
} }
else else
{ {
WarningInFunction WarningInFunction
<< "Requested wall shear stress on non-wall boundary " << "Requested wall shear stress on non-wall boundary "
<< "type patch: " << pbm[patchI].name() << endl; << "type patch: " << pbm[patchi].name() << endl;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -51,6 +51,9 @@ void Foam::yPlus::calcYPlus
const fvPatchList& patches = mesh.boundary(); const fvPatchList& patches = mesh.boundary();
volScalarField::GeometricBoundaryField& yPlusBf =
yPlus.boundaryFieldRef();
forAll(patches, patchi) forAll(patches, patchi)
{ {
const fvPatch& patch = patches[patchi]; const fvPatch& patch = patches[patchi];
@ -63,8 +66,8 @@ void Foam::yPlus::calcYPlus
nutBf[patchi] nutBf[patchi]
); );
yPlus.boundaryField()[patchi] = nutPf.yPlus(); yPlusBf[patchi] = nutPf.yPlus();
const scalarField& yPlusp = yPlus.boundaryField()[patchi]; const scalarField& yPlusp = yPlusBf[patchi];
const scalar minYplus = gMin(yPlusp); const scalar minYplus = gMin(yPlusp);
const scalar maxYplus = gMax(yPlusp); const scalar maxYplus = gMax(yPlusp);
@ -88,14 +91,14 @@ void Foam::yPlus::calcYPlus
} }
else if (isA<wallFvPatch>(patch)) else if (isA<wallFvPatch>(patch))
{ {
yPlus.boundaryField()[patchi] = yPlusBf[patchi] =
d[patchi] d[patchi]
*sqrt *sqrt
( (
nuEffBf[patchi] nuEffBf[patchi]
*mag(turbulenceModel.U().boundaryField()[patchi].snGrad()) *mag(turbulenceModel.U().boundaryField()[patchi].snGrad())
)/nuBf[patchi]; )/nuBf[patchi];
const scalarField& yPlusp = yPlus.boundaryField()[patchi]; const scalarField& yPlusp = yPlusBf[patchi];
const scalar minYplus = gMin(yPlusp); const scalar minYplus = gMin(yPlusp);
const scalar maxYplus = gMax(yPlusp); const scalar maxYplus = gMax(yPlusp);