Gyselalib++
 
Loading...
Searching...
No Matches
output.hpp
1// SPDX-License-Identifier: MIT
2
3#pragma once
4#include <ddc/ddc.hpp>
5#include <ddc/pdi.hpp>
6
7#include "ddc_aliases.hpp"
8
16template <class Mesh>
17void expose_mesh_to_pdi(std::string pdi_name, IdxRange<Mesh> idx_range)
18{
19 using Dim = typename Mesh::continuous_dimension_type;
20 using FieldMem = host_t<FieldMem<Coord<Dim>, IdxRange<Mesh>>>;
21 using Idx = Idx<Mesh>;
22
23 FieldMem mesh_coord(idx_range);
24 for (Idx const idx : idx_range) {
25 mesh_coord(idx) = ddc::coordinate(idx);
26 }
27 ddc::expose_to_pdi(pdi_name, mesh_coord);
28}