ENH: Added updateCoeffs and manipulateMatrix functions

This commit is contained in:
andy 2013-05-31 14:40:25 +01:00
parent fa2ed51f6b
commit a0d2760809
2 changed files with 48 additions and 18 deletions

View File

@ -284,6 +284,16 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicACMIFvPatchField<Type>::snGrad
}
template<class Type>
void Foam::cyclicACMIFvPatchField<Type>::updateCoeffs()
{
const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
const fvPatchField<Type>& npf = nonOverlapPatchField();
const_cast<fvPatchField<Type>&>(npf).updateCoeffs(mask);
}
template<class Type>
void Foam::cyclicACMIFvPatchField<Type>::evaluate
(
@ -376,6 +386,20 @@ Foam::cyclicACMIFvPatchField<Type>::gradientBoundaryCoeffs() const
}
template<class Type>
void Foam::cyclicACMIFvPatchField<Type>::manipulateMatrix
(
fvMatrix<Type>& matrix
)
{
// blend contrubutions from the coupled and non-overlap patches
const fvPatchField<Type>& npf = nonOverlapPatchField();
const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask();
const_cast<fvPatchField<Type>&>(npf).manipulateMatrix(matrix, mask);
}
template<class Type>
void Foam::cyclicACMIFvPatchField<Type>::write(Ostream& os) const
{

View File

@ -178,12 +178,34 @@ public:
//- Return reference to non-overlapping patchField
const fvPatchField<Type>& nonOverlapPatchField() const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
scalarField& result,
const scalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
Field<Type>&,
const Field<Type>&,
const scalarField&,
const Pstream::commsTypes commsType
) const;
//- Return patch-normal gradient
virtual tmp<Field<Type> > snGrad
(
const scalarField& deltaCoeffs
) const;
//- Update the coefficients associated with the patch field
void updateCoeffs();
//- Evaluate the patch field
virtual void evaluate
(
@ -226,24 +248,8 @@ public:
// evaluation of the gradient of this patchField
virtual tmp<Field<Type> > gradientBoundaryCoeffs() const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
scalarField& result,
const scalarField& psiInternal,
const scalarField& coeffs,
const direction cmpt,
const Pstream::commsTypes commsType
) const;
//- Update result field based on interface functionality
virtual void updateInterfaceMatrix
(
Field<Type>&,
const Field<Type>&,
const scalarField&,
const Pstream::commsTypes commsType
) const;
//- Manipulate matrix
virtual void manipulateMatrix(fvMatrix<Type>& matrix);
// Cyclic AMI coupled interface functions