BUG: dynamicRefineFvMesh : error calculation, reading dictionary

This commit is contained in:
mattijs
2010-11-15 16:22:16 +00:00
parent a0806f5aca
commit aee09dd35c

View File

@ -620,24 +620,23 @@ Foam::dynamicRefineFvMesh::cellToPoint(const scalarField& vFld) const
} }
// Calculate error. Is < 0 or distance from inbetween levels // Calculate error. Is < 0 or distance to minLevel, maxLevel
Foam::scalarField Foam::scalarField Foam::dynamicRefineFvMesh::error
Foam::dynamicRefineFvMesh::error
( (
const scalarField& fld, const scalarField& fld,
const scalar minLevel, const scalar minLevel,
const scalar maxLevel const scalar maxLevel
) const ) const
{ {
const scalar halfLevel = 0.5*(minLevel + maxLevel);
scalarField c(fld.size(), -1); scalarField c(fld.size(), -1);
forAll(fld, i) forAll(fld, i)
{ {
if (fld[i] >= minLevel && fld[i] < maxLevel) scalar err = min(fld[i]-minLevel, maxLevel-fld[i]);
if (err >= 0)
{ {
c[i] = mag(fld[i] - halfLevel); c[i] = err;
} }
} }
return c; return c;
@ -877,6 +876,10 @@ Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io)
nRefinementIterations_(0), nRefinementIterations_(0),
protectedCell_(nCells(), 0) protectedCell_(nCells(), 0)
{ {
// Read static part of dictionary
readDict();
const labelList& cellLevel = meshCutter_.cellLevel(); const labelList& cellLevel = meshCutter_.cellLevel();
const labelList& pointLevel = meshCutter_.pointLevel(); const labelList& pointLevel = meshCutter_.pointLevel();