boundaryField() -> boundaryFieldRef()

This commit is contained in:
Henry Weller
2016-04-23 23:37:53 +01:00
parent 89397e8076
commit 77cad08dfa
10 changed files with 37 additions and 31 deletions

View File

@ -118,7 +118,7 @@ int main(int argc, char *argv[])
{ {
pf[faceI] = Foam::sqrt(allFaceInfo[faceI].distSqr()); pf[faceI] = Foam::sqrt(allFaceInfo[faceI].distSqr());
} }
vsf.boundaryField()[patch.index()] = pf; vsf.boundaryFieldRef()[patch.index()] = pf;
Info<< "Writing patchDist volScalarField to " << runTime.value() Info<< "Writing patchDist volScalarField to " << runTime.value()
<< endl; << endl;
@ -152,7 +152,7 @@ int main(int argc, char *argv[])
mesh, mesh,
dimensionedScalar("otherPatchDist", dimLength, 0.0) dimensionedScalar("otherPatchDist", dimLength, 0.0)
); );
vsf.boundaryField()[patch.index()] = pwd; vsf.boundaryFieldRef()[patch.index()] = pwd;
Info<< "Writing otherPatchDist volScalarField to " << runTime.value() Info<< "Writing otherPatchDist volScalarField to " << runTime.value()
<< endl; << endl;

View File

@ -87,7 +87,7 @@ int main(int argc, char *argv[])
); );
cc.internalField() = mesh.C().internalField(); cc.internalField() = mesh.C().internalField();
cc.boundaryField().updateCoeffs(); cc.boundaryFieldRef().updateCoeffs();
forAll(cc.boundaryField(), patchI) forAll(cc.boundaryField(), patchI)
{ {

View File

@ -428,7 +428,7 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
pointVectorField& displacement pointVectorField& displacement
) )
{ {
typename pointVectorField::GeometricBoundaryField& displacementBf = pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef(); 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
@ -584,7 +584,7 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule(); const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule();
typename pointVectorField::GeometricBoundaryField& displacementBf = pointVectorField::GeometricBoundaryField& displacementBf =
displacement.boundaryFieldRef(); displacement.boundaryFieldRef();
// 1. evaluate on adaptPatches // 1. evaluate on adaptPatches

View File

@ -90,7 +90,7 @@ void Foam::skewCorrectionVectors::calcSkewCorrectionVectors()
Cpf - ((Sf[facei] & Cpf)/(Sf[facei] & d))*d; Cpf - ((Sf[facei] & Cpf)/(Sf[facei] & d))*d;
} }
typename surfaceVectorField::GeometricBoundaryField& skewCorrVecsBf = surfaceVectorField::GeometricBoundaryField& skewCorrVecsBf =
skewCorrectionVectors_.boundaryFieldRef(); skewCorrectionVectors_.boundaryFieldRef();
forAll(skewCorrVecsBf, patchi) forAll(skewCorrVecsBf, patchi)

View File

@ -183,7 +183,7 @@ void Foam::surfaceInterpolation::makeWeights() const
w[facei] = SfdNei/(SfdOwn + SfdNei); w[facei] = SfdNei/(SfdOwn + SfdNei);
} }
typename surfaceScalarField::GeometricBoundaryField& wBf = surfaceScalarField::GeometricBoundaryField& wBf =
weights.boundaryFieldRef(); weights.boundaryFieldRef();
forAll(mesh_.boundary(), patchi) forAll(mesh_.boundary(), patchi)
@ -240,7 +240,7 @@ void Foam::surfaceInterpolation::makeDeltaCoeffs() const
deltaCoeffs[facei] = 1.0/mag(C[neighbour[facei]] - C[owner[facei]]); deltaCoeffs[facei] = 1.0/mag(C[neighbour[facei]] - C[owner[facei]]);
} }
typename surfaceScalarField::GeometricBoundaryField& deltaCoeffsBf = surfaceScalarField::GeometricBoundaryField& deltaCoeffsBf =
deltaCoeffs.boundaryFieldRef(); deltaCoeffs.boundaryFieldRef();
forAll(deltaCoeffsBf, patchi) forAll(deltaCoeffsBf, patchi)
@ -305,7 +305,7 @@ void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs() const
nonOrthDeltaCoeffs[facei] = 1.0/max(unitArea & delta, 0.05*mag(delta)); nonOrthDeltaCoeffs[facei] = 1.0/max(unitArea & delta, 0.05*mag(delta));
} }
typename surfaceScalarField::GeometricBoundaryField& nonOrthDeltaCoeffsBf = surfaceScalarField::GeometricBoundaryField& nonOrthDeltaCoeffsBf =
nonOrthDeltaCoeffs.boundaryFieldRef(); nonOrthDeltaCoeffs.boundaryFieldRef();
forAll(nonOrthDeltaCoeffsBf, patchi) forAll(nonOrthDeltaCoeffsBf, patchi)
@ -363,7 +363,7 @@ void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors() const
// and calculated consistently with internal corrections for // and calculated consistently with internal corrections for
// coupled patches // coupled patches
typename surfaceVectorField::GeometricBoundaryField& corrVecsBf = surfaceVectorField::GeometricBoundaryField& corrVecsBf =
corrVecs.boundaryFieldRef(); corrVecs.boundaryFieldRef();
forAll(corrVecsBf, patchi) forAll(corrVecsBf, patchi)

View File

@ -127,7 +127,7 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
faceDiffusivity_[faceI] = 1.0/sqrt(dist); faceDiffusivity_[faceI] = 1.0/sqrt(dist);
} }
typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf = surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
faceDiffusivity_.boundaryFieldRef(); faceDiffusivity_.boundaryFieldRef();
forAll(faceDiffusivityBf, patchI) forAll(faceDiffusivityBf, patchI)

View File

@ -153,7 +153,7 @@ void Foam::inversePointDistanceDiffusivity::correct()
} }
typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf = surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
faceDiffusivity_.boundaryFieldRef(); faceDiffusivity_.boundaryFieldRef();
forAll(faceDiffusivityBf, patchI) forAll(faceDiffusivityBf, patchI)

View File

@ -2658,7 +2658,7 @@ bool Foam::snappyLayerDriver::writeLayerData
); );
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf = volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef(); fld.boundaryFieldRef();
forAll(patchIDs, i) forAll(patchIDs, i)
@ -2697,7 +2697,7 @@ bool Foam::snappyLayerDriver::writeLayerData
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf = volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef(); fld.boundaryFieldRef();
forAll(patchIDs, i) forAll(patchIDs, i)
@ -2732,7 +2732,7 @@ bool Foam::snappyLayerDriver::writeLayerData
const polyBoundaryMesh& pbm = mesh.boundaryMesh(); const polyBoundaryMesh& pbm = mesh.boundaryMesh();
typename volScalarField::GeometricBoundaryField& fldBf = volScalarField::GeometricBoundaryField& fldBf =
fld.boundaryFieldRef(); fld.boundaryFieldRef();
forAll(patchIDs, i) forAll(patchIDs, i)

View File

@ -103,15 +103,15 @@ void reactingOneDim::updateQr()
// Retrieve field from coupled region using mapped boundary conditions // Retrieve field from coupled region using mapped boundary conditions
Qr_.correctBoundaryConditions(); Qr_.correctBoundaryConditions();
volScalarField::GeometricBoundaryField& QrBf = Qr_.boundaryFieldRef();
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
const label patchI = intCoupledPatchIDs_[i]; const label patchi = intCoupledPatchIDs_[i];
scalarField& Qrp = Qr_.boundaryField()[patchI];
// Qr is positive going in the solid // Qr is positive going in the solid
// If the surface is emitting the radiative flux is set to zero // If the surface is emitting the radiative flux is set to zero
Qrp = max(Qrp, scalar(0.0)); QrBf[patchi] = max(QrBf[patchi], scalar(0.0));
} }
const vectorField& cellC = regionMesh().cellCentres(); const vectorField& cellC = regionMesh().cellCentres();
@ -122,10 +122,10 @@ void reactingOneDim::updateQr()
label localPyrolysisFaceI = 0; label localPyrolysisFaceI = 0;
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
const label patchI = intCoupledPatchIDs_[i]; const label patchi = intCoupledPatchIDs_[i];
const scalarField& Qrp = Qr_.boundaryField()[patchI]; const scalarField& Qrp = Qr_.boundaryField()[patchi];
const vectorField& Cf = regionMesh().Cf().boundaryField()[patchI]; const vectorField& Cf = regionMesh().Cf().boundaryField()[patchi];
forAll(Qrp, faceI) forAll(Qrp, faceI)
{ {
@ -164,12 +164,15 @@ void reactingOneDim::updatePhiGas()
const DimensionedField<scalar, volMesh>& RRiGas = const DimensionedField<scalar, volMesh>& RRiGas =
solidChemistry_->RRg(gasI); solidChemistry_->RRg(gasI);
surfaceScalarField::GeometricBoundaryField& phiGasBf =
phiGas_.boundaryFieldRef();
label totalFaceId = 0; label totalFaceId = 0;
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
const label patchI = intCoupledPatchIDs_[i]; const label patchi = intCoupledPatchIDs_[i];
scalarField& phiGasp = phiGas_.boundaryField()[patchI]; scalarField& phiGasp = phiGasBf[patchi];
const scalarField& cellVol = regionMesh().V(); const scalarField& cellVol = regionMesh().V();
forAll(phiGasp, faceI) forAll(phiGasp, faceI)
@ -188,7 +191,7 @@ void reactingOneDim::updatePhiGas()
if (debug) if (debug)
{ {
Info<< " Gas : " << gasTable[gasI] Info<< " Gas : " << gasTable[gasI]
<< " on patch : " << patchI << " on patch : " << patchi
<< " mass produced at face(local) : " << " mass produced at face(local) : "
<< faceI << faceI
<< " is : " << massInt << " is : " << massInt
@ -362,8 +365,8 @@ void reactingOneDim::calculateMassTransfer()
totalGasMassFlux_ = 0; totalGasMassFlux_ = 0;
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
const label patchI = intCoupledPatchIDs_[i]; const label patchi = intCoupledPatchIDs_[i];
totalGasMassFlux_ += gSum(phiGas_.boundaryField()[patchI]); totalGasMassFlux_ += gSum(phiGas_.boundaryField()[patchi]);
} }
if (infoOutput_) if (infoOutput_)
@ -587,12 +590,12 @@ reactingOneDim::~reactingOneDim()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
scalar reactingOneDim::addMassSources(const label patchI, const label faceI) scalar reactingOneDim::addMassSources(const label patchi, const label faceI)
{ {
label index = 0; label index = 0;
forAll(primaryPatchIDs_, i) forAll(primaryPatchIDs_, i)
{ {
if (primaryPatchIDs_[i] == patchI) if (primaryPatchIDs_[i] == patchi)
{ {
index = i; index = i;
break; break;

View File

@ -122,14 +122,17 @@ void Foam::regionModels::regionModel1D::initialise()
surfaceScalarField& nMagSf = nMagSfPtr_(); surfaceScalarField& nMagSf = nMagSfPtr_();
surfaceScalarField::GeometricBoundaryField nMagSfBf =
nMagSf.boundaryFieldRef();
localPyrolysisFaceI = 0; localPyrolysisFaceI = 0;
forAll(intCoupledPatchIDs_, i) forAll(intCoupledPatchIDs_, i)
{ {
const label patchI = intCoupledPatchIDs_[i]; const label patchI = intCoupledPatchIDs_[i];
const polyPatch& ppCoupled = rbm[patchI]; const polyPatch& ppCoupled = rbm[patchI];
const vectorField& pNormals = ppCoupled.faceNormals(); const vectorField& pNormals = ppCoupled.faceNormals();
nMagSf.boundaryField()[patchI] = nMagSfBf[patchI] = regionMesh().Sf().boundaryField()[patchI] & pNormals;
regionMesh().Sf().boundaryField()[patchI] & pNormals;
forAll(pNormals, localFaceI) forAll(pNormals, localFaceI)
{ {
const vector& n = pNormals[localFaceI]; const vector& n = pNormals[localFaceI];