mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: surfaceFieldValue fails writing legacy VTK format
- number of fields was not set. - interpolated surfaces incorrectly written for all formats
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2017-2020 OpenCFD Ltd.
|
Copyright (C) 2017-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -1034,6 +1034,16 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
|
|||||||
mesh_,
|
mesh_,
|
||||||
dict.subDict("sampledSurfaceDict")
|
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
|
Info<< type() << ' ' << name() << ':' << nl
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
Copyright (C) 2011-2017 OpenFOAM Foundation
|
Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
Copyright (C) 2015-2020 OpenCFD Ltd.
|
Copyright (C) 2015-2021 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -388,6 +388,15 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::writeValues
|
|||||||
false // serial - already merged
|
false // serial - already merged
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Point data? Should probably disallow
|
||||||
|
if (sampledPtr_)
|
||||||
|
{
|
||||||
|
surfaceWriterPtr_->isPointData() =
|
||||||
|
sampledPtr_->interpolate();
|
||||||
|
}
|
||||||
|
|
||||||
|
surfaceWriterPtr_->nFields() = 1; // Needed for VTK legacy
|
||||||
|
|
||||||
surfaceWriterPtr_->write(fieldName, allValues);
|
surfaceWriterPtr_->write(fieldName, allValues);
|
||||||
|
|
||||||
surfaceWriterPtr_->clear();
|
surfaceWriterPtr_->clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user