diff options
Diffstat (limited to 'lib/core/c++/write_vtk.hpp')
| -rw-r--r-- | lib/core/c++/write_vtk.hpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/core/c++/write_vtk.hpp b/lib/core/c++/write_vtk.hpp index e84cf9d..3c60a66 100644 --- a/lib/core/c++/write_vtk.hpp +++ b/lib/core/c++/write_vtk.hpp @@ -100,6 +100,8 @@ struct lbm_vtk_writer<sch::Chunk<T,Ghost,D...>> { } } + vtk_file<<"\n"; + return saw::make_void(); } }; @@ -129,6 +131,21 @@ struct lbm_vtk_writer<sch::Vector<T,D>> { } }; +template<typename T> +struct lbm_vtk_writer<sch::Scalar<T>> { + static saw::error_or<void> apply_header(std::ostream& vtk_file, std::string_view name){ + vtk_file<<"SCALARS "<<name<<" float\n"; + vtk_file<<"LOOKUP_TABLE default\n"; + return saw::make_void(); + } + static saw::error_or<void> apply(std::ostream& vtk_file, const saw::data<sch::Scalar<T>>& field){ + // vtk_file<<"VECTORS "<<name<<" float\n"; + vtk_file<<field.at({}).get(); + vtk_file<<"\n"; + return saw::make_void(); + } +}; + template<typename... MemberT, saw::string_literal... Keys, uint64_t... Ghost, uint64_t... Dims> struct lbm_vtk_writer<sch::Struct<sch::Member<sch::Chunk<MemberT,Ghost,Dims...>,Keys>...>> final { template<uint64_t i> @@ -176,7 +193,6 @@ struct lbm_vtk_writer<sch::Struct<sch::Member<sch::Chunk<MemberT,Ghost,Dims...>, static_assert(saw::ct_multiply<uint64_t,Dims...>::value > 0u, "Invalid Dim size resulting in length 0u"); for(saw::data<sch::UInt64> i{0u}; i.get() < sizeof...(Dims); ++i){ - pd_size = pd_size * meta.at(i); vtk_file << " " << meta.at(i).get(); } for(saw::data<sch::UInt64> i{sizeof...(Dims)}; i.get() < 3u; ++i){ |
