28#include <field/iterators/IteratorMacros.h>
47class VTKWriter :
public vtk::BlockCellDataWriter<OutputType, F_SIZE_ARG> {
59 return (
static_cast<std::size_t
>(x) *
m_dims[2] *
m_dims[1] +
60 static_cast<std::size_t
>(y) *
m_dims[2] +
61 static_cast<std::size_t
>(z)) *
75template <
typename FloatType,
typename OutputType =
float>
77 :
public VTKWriter<FloatType, std::vector<FloatType>, 1u, OutputType> {
92template <
typename FloatType,
typename OutputType =
float>
94 :
public VTKWriter<FloatType, std::vector<FloatType>, 3u, OutputType> {
109template <
typename FloatType,
typename OutputType =
float>
111 :
public VTKWriter<FloatType, std::vector<FloatType>, 9u, OutputType> {
115 using Base::evaluate;
126template <
typename FlagField_T,
typename OutputType =
float>
129 using Base = vtk::BlockCellDataWriter<OutputType, 1u>;
130 using Base::evaluate;
133 : vtk::BlockCellDataWriter<
OutputType, 1u>(id),
158template <
typename FloatType, lbmpy::Arch Architecture>
164 auto const blocks = m_lattice->get_blocks();
166 auto density_writer = std::make_shared<DensityVTKWriter<FloatType, float>>(
183 auto const blocks = m_lattice->get_blocks();
186 std::make_shared<VelocityVTKWriter<FloatType, float>>(
193 auto const offset = m_lattice->get_block_corner(
block,
true);
199 Cell const global(offset[0] + x, offset[1] + y, offset[2] + z);
200 auto const &vel = m_boundary->get_node_value_at_boundary(global);
201 Cell const local(x, y, z);
202 lbm::accessor::Vector::set(velocity_field, vel, local);
219 auto const blocks = m_lattice->get_blocks();
222 std::make_shared<PressureTensorVTKWriter<FloatType, float>>(
230 for (std::size_t n = 0
u; n <
values.size(); n += 9u) {
231 pressure_tensor_correction(
232 std::span<FloatType, 9ul>(&
values[n], 9ul));
245 m_flag_field_id,
"boundary", Boundary_flag));
std::unordered_map< std::string, double > units_map
void configure() override
vtk::BlockCellDataWriter< OutputType, 1u > Base
FlagField_T const * m_flag_field
FlagUID const m_boundary_flag
BoundaryVTKWriter(ConstBlockDataID const &flag_field_id, std::string const &id, FlagUID const &boundary_flag)
FlagField_T::flag_t m_boundary_flag_value
ConstBlockDataID const m_flag_field_id
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const) override
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const) override
void register_vtk_field_writers(walberla::vtk::VTKOutput &vtk_obj, LatticeModel::units_map const &units, int flag_observables) override
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const f) override
Base class for LB field VTK writers.
void configure() override
VTKWriter(ConstBlockDataID const &block_id, std::string const &id, FloatType unit_conversion)
void set_dims(Vector3< uint_t > dims)
std::size_t get_first_index(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z)
void set_content(VecType content)
OutputType evaluate(cell_idx_t const x, cell_idx_t const y, cell_idx_t const z, cell_idx_t const f) override
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static double * block(double *p, std::size_t index, std::size_t size)
double get(GhostLayerField< double, uint_t{19u}> const *pdf_field, double const density, Cell const &cell)
auto get(GhostLayerField< double, uint_t{19u}> const *pdf_field, double const density, Cell const &cell)
auto get(GhostLayerField< double, uint_t{3u}> const *vec_field, Cell const &cell)
\file PackInfoPdfDoublePrecision.cpp \author pystencils
static Utils::Vector3d velocity(Particle const &p_ref, Particle const &p_vs)
Velocity of the virtual site.