ENH: AMI code refactoring

This commit is contained in:
andy
2011-08-02 10:58:56 +01:00
parent 8ffd5df908
commit b73049222c
5 changed files with 18 additions and 26 deletions

View File

@ -47,7 +47,7 @@ void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const
const scalarField nbrDeltas
(
interpolateToSource(nbrPatch.nf() & nbrPatch.fvPatch::delta())
interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta())
);
forAll(deltas, faceI)
@ -68,7 +68,7 @@ void Foam::cyclicAMIFvPatch::makeDeltaCoeffs(scalarField& dc) const
const scalarField nbrDeltas
(
interpolateToSource(nbrPatch.nf() & nbrPatch.fvPatch::delta())
interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta())
);
forAll(deltas, faceI)
@ -86,12 +86,12 @@ Foam::tmp<Foam::vectorField> Foam::cyclicAMIFvPatch::delta() const
const vectorField patchD(fvPatch::delta());
const cyclicAMIFvPatch& nbrPatch = neighbFvPatch();
const vectorField nbrPatchD(interpolateToSource(nbrPatch.fvPatch::delta()));
const vectorField nbrPatchD(interpolate(nbrPatch.fvPatch::delta()));
tmp<vectorField> tpdv(new vectorField(patchD.size()));
vectorField& pdv = tpdv();
// To the transformation if necessary
// do the transformation if necessary
if (parallel())
{
forAll(patchD, faceI)
@ -132,12 +132,7 @@ Foam::tmp<Foam::labelField> Foam::cyclicAMIFvPatch::internalFieldTransfer
const labelUList& iF
) const
{
tmp<labelField> tnpif(neighbFvPatch().patchInternalField(iF));
labelField& npif = tnpif();
interpolateToSource(npif);
return tnpif;
return interpolate(neighbFvPatch().patchInternalField(iF));
}

View File

@ -147,15 +147,15 @@ public:
virtual tmp<vectorField> delta() const;
template<class Type>
tmp<Field<Type> > interpolateToSource(const Field<Type>& fld) const
tmp<Field<Type> > interpolate(const Field<Type>& fld) const
{
return cyclicAMIPolyPatch_.interpolateToSource(fld);
return cyclicAMIPolyPatch_.interpolate(fld);
}
template<class Type>
tmp<Field<Type> > interpolateToSource(const tmp<Field<Type> >& tFld) const
tmp<Field<Type> > interpolate(const tmp<Field<Type> >& tFld) const
{
return cyclicAMIPolyPatch_.interpolateToSource(tFld);
return cyclicAMIPolyPatch_.interpolate(tFld);
}

View File

@ -167,7 +167,7 @@ Foam::cyclicAMIFvPatchField<Type>::patchNeighbourField() const
}
}
return cyclicAMIPatch_.interpolateToSource(pnf);
return cyclicAMIPatch_.interpolate(pnf);
}
@ -209,11 +209,11 @@ void Foam::cyclicAMIFvPatchField<Type>::updateInterfaceMatrix
pnf[faceI] = psiInternal[nbrFaceCells[faceI]];
}
pnf = cyclicAMIPatch_.interpolate(pnf);
// Transform according to the transformation tensors
transformCoupleField(pnf, cmpt);
pnf = cyclicAMIPatch_.interpolateToSource(pnf);
// Multiply the field by coefficients and add into the result
const labelUList& faceCells = cyclicAMIPatch_.faceCells();

View File

@ -306,16 +306,13 @@ public:
// Interpolations
//- Interpolate from target field to source
//- Interpolate field
template<class Type>
tmp<Field<Type> > interpolateToSource
(
const Field<Type>& fld
) const;
tmp<Field<Type> > interpolate(const Field<Type>& fld) const;
//- Interpolate from target tmp field to source
//- Interpolate tmp field
template<class Type>
tmp<Field<Type> > interpolateToSource
tmp<Field<Type> > interpolate
(
const tmp<Field<Type> >& tFld
) const;

View File

@ -28,7 +28,7 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolateToSource
Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolate
(
const Field<Type>& fld
) const
@ -45,7 +45,7 @@ Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolateToSource
template<class Type>
Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolateToSource
Foam::tmp<Foam::Field<Type> > Foam::cyclicAMIPolyPatch::interpolate
(
const tmp<Field<Type> >& tFld
) const