BUG: fixedFluxPressure: map if no internal field. Fixes #61

This commit is contained in:
mattijs
2016-02-04 14:57:44 +00:00
parent 21bc7a0c39
commit 427b3704b4

View File

@ -86,15 +86,26 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField
gradient().map(ptf.gradient(), mapper);
// Evaluate the value field from the gradient if the internal field is valid
if (notNull(iF) && iF.size())
if (notNull(iF))
{
scalarField::operator=
(
//patchInternalField() + gradient()/patch().deltaCoeffs()
// ***HGW Hack to avoid the construction of mesh.deltaCoeffs
// which fails for AMI patches for some mapping operations
patchInternalField() + gradient()*(patch().nf() & patch().delta())
);
if (iF.size())
{
// Note: cannot ask for nf() if zero faces
scalarField::operator=
(
//patchInternalField() + gradient()/patch().deltaCoeffs()
// ***HGW Hack to avoid the construction of mesh.deltaCoeffs
// which fails for AMI patches for some mapping operations
patchInternalField()
+ gradient()*(patch().nf() & patch().delta())
);
}
}
else
{
// Enforce mapping of values so we have a valid starting value
this->map(ptf, mapper);
}
}