/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2025 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
\*---------------------------------------------------------------------------*/
#include "globalIndex.H"
#include "Pstream.H"
#include "ListOps.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
inline void Foam::vtk::write
(
vtk::formatter& fmt,
const Type& val,
const label n
)
{
const direction nCmpt = pTraits::nComponents;
for (label i=0; i < n; ++i)
{
for (direction cmpt=0; cmpt < nCmpt; ++cmpt)
{
fmt.write(component(val, cmpt));
}
}
}
template
void Foam::vtk::writeList
(
vtk::formatter& fmt,
const UList& values
)
{
for (const Type& val : values)
{
vtk::write(fmt, val);
}
}
template
void Foam::vtk::writeList
(
vtk::formatter& fmt,
const FixedList& values
)
{
for (const Type& val : values)
{
vtk::write(fmt, val);
}
}
template
void Foam::vtk::writeList
(
vtk::formatter& fmt,
const UList& values,
const labelUList& addressing
)
{
for (const label idx : addressing)
{
vtk::write(fmt, values[idx]);
}
}
template
void Foam::vtk::writeList
(
vtk::formatter& fmt,
const UList& values,
const bitSet& selected
)
{
for (const label idx : selected)
{
vtk::write(fmt, values[idx]);
}
}
template
void Foam::vtk::writeLists
(
vtk::formatter& fmt,
const UList& values,
const UList& indirect,
const labelUList& addressing
)
{
vtk::writeList(fmt, values);
vtk::writeList(fmt, indirect, addressing);
}
template
void Foam::vtk::writeValueParallel
(
vtk::formatter& fmt,
const Type& val,
const label count
)
{
if constexpr (!is_contiguous_v)
{
// Non-contiguous data does not make sense
FatalErrorInFunction
<< "Contiguous data only" << endl
<< Foam::exit(FatalError);
}
// Gather [count, value] tuples, including from master
const List