From 2b614594ed9f2e5e117121e58c1888c46ff848a7 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 27 Aug 2008 11:14:21 +0100 Subject: [PATCH] added boundaryManipulate function --- .../fvMatrices/fvMatrix/fvMatrix.C | 24 +++++++++++++++---- .../fvMatrices/fvMatrix/fvMatrix.H | 9 ++++++- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C index f78213e1d9..86783eae2d 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.C @@ -456,10 +456,10 @@ void Foam::fvMatrix::setValues if (internalCoeffs_[patchi].size()) { - label patchFacei = + label patchFacei = mesh.boundaryMesh()[patchi].whichFace(facei); - internalCoeffs_[patchi][patchFacei] = + internalCoeffs_[patchi][patchFacei] = pTraits::zero; boundaryCoeffs_[patchi][patchFacei] = @@ -591,6 +591,20 @@ void Foam::fvMatrix::relax() } +template +void Foam::fvMatrix::boundaryManipulate +( + typename GeometricField:: + GeometricBoundaryField& bFields +) +{ + forAll(bFields, patchI) + { + bFields[patchI].manipulateMatrix(*this); + } +} + + template Foam::tmp Foam::fvMatrix::D() const { @@ -653,7 +667,7 @@ Foam::tmp Foam::fvMatrix::A() const template -Foam::tmp > +Foam::tmp > Foam::fvMatrix::H() const { tmp > tHphi @@ -838,7 +852,7 @@ flux() const forAll(fieldFlux.boundaryField(), patchI) { - fieldFlux.boundaryField()[patchI] = + fieldFlux.boundaryField()[patchI] = InternalContrib[patchI] - NeighbourContrib[patchI]; } @@ -1255,7 +1269,7 @@ Foam::lduMatrix::solverPerformance Foam::solve Istream& solverControls ) { - lduMatrix::solverPerformance solverPerf = + lduMatrix::solverPerformance solverPerf = const_cast&>(tfvm()).solve(solverControls); tfvm.clear(); diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index f9c82a2d58..c40fa4b47e 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -350,6 +350,13 @@ public: // alpha is read from controlDict void relax(); + //- Manipulate based on a boundary field + void boundaryManipulate + ( + typename GeometricField:: + GeometricBoundaryField& values + ); + //- Construct and return the solver // Solver controls read from Istream autoPtr solver(Istream&); @@ -386,7 +393,7 @@ public: //- Return the face-flux field from the matrix tmp > - flux() const; + flux() const; // Member operators