11#include <dune/python/common/typeregistry.hh>
12#include <dune/python/pybind11/eigen.h>
13#include <dune/python/pybind11/functional.h>
14#include <dune/python/pybind11/pybind11.h>
15#include <dune/python/pybind11/stl.h>
16#include <dune/python/pybind11/stl_bind.h>
17#include <dune/vtk/vtkwriter.hh>
49template <
class Writer,
class... options>
51 using pybind11::operator
""_a;
55 using Assembler =
typename Writer::Assembler;
56 using FE =
typename Writer::FEType;
57 using GridView =
typename Writer::GridView;
58 using VirtualizedGF = Dune::Vtk::Function<GridView>;
61 [](std::shared_ptr<Assembler> assembler, Dune::Vtk::FormatTypes format, Dune::Vtk::DataTypes datatype,
62 Dune::Vtk::DataTypes headertype) {
return new Writer(assembler, format, datatype, headertype); }),
63 pybind11::arg(
"assembler"), pybind11::arg(
"format") = Dune::Vtk::FormatTypes::BINARY,
64 pybind11::arg(
"datatype") = Dune::Vtk::DataTypes::FLOAT32,
65 pybind11::arg(
"headertype") = Dune::Vtk::DataTypes::UINT32, pybind11::keep_alive<1, 2>());
67 cls.def(
"setFormat", &Writer::setFormat);
68 cls.def(
"setDatatype", &Writer::setDatatype);
69 cls.def(
"setHeadertype", &Writer::setHeadertype);
75 auto addResultImpl = [](
Writer& self,
const std::string& resType,
auto type) {
80 self.template addResult<RT::template Rebind>(type);
84 DUNE_THROW(Dune::NotImplemented,
"Element " + Dune::className<FE>() +
" doesn't support ResultType " + resType);
90 addResultImpl(self, resType, tag);
Definition of the LinearElastic class for finite element mechanics computations.
void registerVtkWriter(pybind11::handle scope, pybind11::class_< Writer, options... > cls)
Register Python bindings for a VtkWriter class. .
Definition: python/io/vtkwriter.hh:50
void init(int argc, char **argv, bool enableFileLogger=true)
Initializes the Ikarus framework.
Definition: init.hh:82
constexpr std::string toString(DBCOption _e)
Definition: dirichletbcenforcement.hh:7
Writer(std::shared_ptr< AS >, Args...) -> Writer< AS, typename DefaultVTKWriterManager< typename AS::GridView >::DefaultDataCollector, typename DefaultVTKWriterManager< typename AS::GridView >::template DefaultVTKWriter<> >
DataTag
Tag enum indicating cell data or point data.
Definition: vtkdatatag.hh:13
Definition: flatassembler.hh:21
FE class is a base class for all finite elements.
Definition: febase.hh:79
decltype(std::tuple_cat(computeSupportedResultTypes< Skills...< PreFE, typename PreFE::template FE< Skills... ... > > >()...)) SupportedResultTypes
Type alias for the supported result types by the mixin.
Definition: mixin.hh:64
Ikarus VTK Writer for finite element results.