added boundaryManipulate function

This commit is contained in:
andy
2008-08-27 11:14:21 +01:00
parent 1dc35beb58
commit 2b614594ed
2 changed files with 27 additions and 6 deletions

View File

@ -456,10 +456,10 @@ void Foam::fvMatrix<Type>::setValues
if (internalCoeffs_[patchi].size()) if (internalCoeffs_[patchi].size())
{ {
label patchFacei = label patchFacei =
mesh.boundaryMesh()[patchi].whichFace(facei); mesh.boundaryMesh()[patchi].whichFace(facei);
internalCoeffs_[patchi][patchFacei] = internalCoeffs_[patchi][patchFacei] =
pTraits<Type>::zero; pTraits<Type>::zero;
boundaryCoeffs_[patchi][patchFacei] = boundaryCoeffs_[patchi][patchFacei] =
@ -591,6 +591,20 @@ void Foam::fvMatrix<Type>::relax()
} }
template<class Type>
void Foam::fvMatrix<Type>::boundaryManipulate
(
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& bFields
)
{
forAll(bFields, patchI)
{
bFields[patchI].manipulateMatrix(*this);
}
}
template<class Type> template<class Type>
Foam::tmp<Foam::scalarField> Foam::fvMatrix<Type>::D() const Foam::tmp<Foam::scalarField> Foam::fvMatrix<Type>::D() const
{ {
@ -653,7 +667,7 @@ Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::A() const
template<class Type> template<class Type>
Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> > Foam::tmp<Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh> >
Foam::fvMatrix<Type>::H() const Foam::fvMatrix<Type>::H() const
{ {
tmp<GeometricField<Type, fvPatchField, volMesh> > tHphi tmp<GeometricField<Type, fvPatchField, volMesh> > tHphi
@ -838,7 +852,7 @@ flux() const
forAll(fieldFlux.boundaryField(), patchI) forAll(fieldFlux.boundaryField(), patchI)
{ {
fieldFlux.boundaryField()[patchI] = fieldFlux.boundaryField()[patchI] =
InternalContrib[patchI] - NeighbourContrib[patchI]; InternalContrib[patchI] - NeighbourContrib[patchI];
} }
@ -1255,7 +1269,7 @@ Foam::lduMatrix::solverPerformance Foam::solve
Istream& solverControls Istream& solverControls
) )
{ {
lduMatrix::solverPerformance solverPerf = lduMatrix::solverPerformance solverPerf =
const_cast<fvMatrix<Type>&>(tfvm()).solve(solverControls); const_cast<fvMatrix<Type>&>(tfvm()).solve(solverControls);
tfvm.clear(); tfvm.clear();

View File

@ -350,6 +350,13 @@ public:
// alpha is read from controlDict // alpha is read from controlDict
void relax(); void relax();
//- Manipulate based on a boundary field
void boundaryManipulate
(
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& values
);
//- Construct and return the solver //- Construct and return the solver
// Solver controls read from Istream // Solver controls read from Istream
autoPtr<fvSolver> solver(Istream&); autoPtr<fvSolver> solver(Istream&);
@ -386,7 +393,7 @@ public:
//- Return the face-flux field from the matrix //- Return the face-flux field from the matrix
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
flux() const; flux() const;
// Member operators // Member operators