mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support VTK output of uniform field
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -195,6 +195,10 @@ public:
|
||||
|
||||
// Write
|
||||
|
||||
//- Write a uniform field of Cell (Face) or Point values
|
||||
template<class Type>
|
||||
void writeUniform(const word& fieldName, const Type& val);
|
||||
|
||||
//- Write a list of Cell (Face) or Point values
|
||||
template<class Type>
|
||||
void write(const word& fieldName, const UList<Type>& field);
|
||||
|
||||
@ -25,6 +25,34 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::vtk::indirectPatchWriter::writeUniform
|
||||
(
|
||||
const word& fieldName,
|
||||
const Type& val
|
||||
)
|
||||
{
|
||||
if (isState(outputState::CELL_DATA))
|
||||
{
|
||||
++nCellData_;
|
||||
vtk::fileWriter::writeUniform<Type>(fieldName, val, numberOfCells_);
|
||||
}
|
||||
else if (isState(outputState::POINT_DATA))
|
||||
{
|
||||
++nPointData_;
|
||||
vtk::fileWriter::writeUniform<Type>(fieldName, val, numberOfPoints_);
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Bad writer state (" << stateNames[state_]
|
||||
<< ") for field " << fieldName << nl << endl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::vtk::indirectPatchWriter::write
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user