BUG: inconsistent surfaceFieldValue writing (fixes #1999)

- setup writer outside the data loop to ensure that the number of
  output fields is correct (VTK format).

- ignore 'interpolate' on sampled surfaces to ensure proper
  face sampling, never allow point sampling

BUG: incorrect debug-switch for sampledIsoSurface
This commit is contained in:
Mark Olesen
2021-02-10 13:03:50 +01:00
parent 4245909efb
commit 77c31a7bef
3 changed files with 57 additions and 53 deletions

View File

@ -1034,16 +1034,6 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
mesh_,
dict.subDict("sampledSurfaceDict")
);
if (sampledPtr_->interpolate())
{
// Should probably ignore interpolate entirely,
// but the oldest isoSurface algorithm requires it!
WarningInFunction
<< type() << ' ' << name() << ": "
<< "sampledSurface with interpolate = true "
<< "is likely incorrect" << nl << nl;
}
}
Info<< type() << ' ' << name() << ':' << nl
@ -1061,15 +1051,6 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
if (usesWeight())
{
if (stSampled == regionType_)
{
FatalIOErrorInFunction(dict)
<< "Cannot use weighted operation '"
<< operationTypeNames_[operation_]
<< "' for sampledSurface"
<< exit(FatalIOError);
}
// Can have "weightFields" or "weightField"
bool missing = true;
@ -1140,6 +1121,9 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
)
);
// Propagate field counts (per surface)
surfaceWriterPtr_->nFields() = fields_.size();
if (debug)
{
surfaceWriterPtr_->verbose(true);