8 #include <dune/common/ftraits.hh>
9 #include <dune/common/typelist.hh>
10 #include <dune/common/version.hh>
11 #include <dune/geometry/type.hh>
12 #include <dune/grid/io/file/vtk/common.hh>
81 using F =
typename FieldTraits<T>::field_type;
99 template <
template <
class>
class C =
NoConstraint,
class Caller>
103 case DataTypes::INT8:
if constexpr(C<std::int8_t>::value) caller(MetaType<std::int8_t>{});
break;
104 case DataTypes::UINT8:
if constexpr(C<std::uint8_t>::value) caller(MetaType<std::uint8_t>{});
break;
105 case DataTypes::INT16:
if constexpr(C<std::int16_t>::value) caller(MetaType<std::int16_t>{});
break;
106 case DataTypes::UINT16:
if constexpr(C<std::uint16_t>::value) caller(MetaType<std::uint16_t>{});
break;
107 case DataTypes::INT32:
if constexpr(C<std::int32_t>::value) caller(MetaType<std::int32_t>{});
break;
108 case DataTypes::UINT32:
if constexpr(C<std::uint32_t>::value) caller(MetaType<std::uint32_t>{});
break;
109 case DataTypes::INT64:
if constexpr(C<std::int64_t>::value) caller(MetaType<std::int64_t>{});
break;
110 case DataTypes::UINT64:
if constexpr(C<std::uint64_t>::value) caller(MetaType<std::uint64_t>{});
break;
111 case DataTypes::FLOAT32:
if constexpr(C<float>::value) caller(MetaType<float>{});
break;
112 case DataTypes::FLOAT64:
if constexpr(C<double>::value) caller(MetaType<double>{});
break;
120 template <
template <
class>
class Constraint1 = NoConstraint,
121 template <
class>
class Constraint2 = NoConstraint,
125 mapDataTypes<Constraint1>(t1, [&](
auto type1) {
126 mapDataTypes<Constraint2>(t2, [&](
auto type2) {
127 caller(type1, type2);
133 template <
template <
class>
class Constraint1 = NoConstraint,
134 template <
class>
class Constraint2 = NoConstraint,
135 template <
class>
class Constraint3 = NoConstraint,
139 mapDataTypes<Constraint1>(t1, [&](
auto type1) {
140 mapDataTypes<Constraint2>(t2, [&](
auto type2) {
141 mapDataTypes<Constraint3>(t3, [&](
auto type3) {
142 caller(type1, type2, type3);
211 return permutation_[idx];
216 return noPermutation_;
221 std::vector<int> permutation_;
222 bool noPermutation_ =
true;
230 template <
class... Args>
232 : name_(std::move(
name))
233 , ncomps_(
getArg<int,unsigned int,long,unsigned long>(args..., 1))
247 std::string
const&
name ()
const
Macro for wrapping error checks and throwing exceptions.
#define VTK_ASSERT_MSG(cond, text)
check if condition cond holds; otherwise, throw a VtkError with a message.
Definition: errors.hh:19
Vtk::DataTypes dataTypeOf(Dune::VTK::Precision p)
Definition: types.cc:99
std::string to_string(Vtk::FormatTypes type)
Definition: types.cc:12
auto formatTypesList
Definition: types.hh:28
FormatTypes
Type used for representing the output format.
Definition: types.hh:21
auto dataTypesLists
Definition: types.hh:62
void mapDataTypes(Vtk::DataTypes t, Caller caller)
Map a given enum DataType to a type passed to Caller as MetaType.
Definition: types.hh:100
CompressorTypes
Definition: types.hh:149
Vtk::FormatTypes formatTypeOf(Dune::VTK::OutputType o)
Map the dune-grid OutputType to FormatTypes.
Definition: types.cc:25
RangeTypes
Type used to determine whether to limit output components to e.g. 3 (vector), or 9 (tensor)
Definition: types.hh:35
DataTypes
Definition: types.hh:52
decltype(auto) getArg(Arg0 &&arg0, Args &&... args)
Definition: arguments.hh:29
GeometryType to_geometry(std::uint8_t cell)
Definition: types.cc:146
Vtk::RangeTypes rangeTypeOf(Dune::VTK::FieldInfo::Type t)
Definition: types.cc:56
auto rangeTypesList
Definition: types.hh:43
Mapping of Dune geometry types to VTK cell types.
Definition: types.hh:160
CellType(GeometryType const &t, Parametrization=LINEAR)
Definition: types.cc:180
bool noPermutation() const
Definition: types.hh:214
Parametrization
Definition: types.hh:161
@ LINEAR
Definition: types.hh:162
@ QUADRATIC
Definition: types.hh:163
@ LAGRANGE
Definition: types.hh:164
std::uint8_t type() const
Return VTK Cell type.
Definition: types.hh:203
int permutation(int idx) const
Return a permutation of Dune elemenr vertices to conform to VTK element numbering.
Definition: types.hh:209
Type
Definition: types.hh:167
@ QUADRATIC_EDGE
Definition: types.hh:184
@ POLYGON
Definition: types.hh:175
@ QUADRATIC_HEXAHEDRON
Definition: types.hh:188
@ LAGRANGE_WEDGE
Definition: types.hh:195
@ HEXAHEDRON
Definition: types.hh:180
@ VERTEX
Definition: types.hh:169
@ LINE
Definition: types.hh:171
@ LAGRANGE_PYRAMID
Definition: types.hh:196
@ QUAD
Definition: types.hh:177
@ QUADRATIC_QUAD
Definition: types.hh:186
@ PYRAMID
Definition: types.hh:182
@ TETRA
Definition: types.hh:178
@ LAGRANGE_HEXAHEDRON
Definition: types.hh:194
@ LAGRANGE_CURVE
Definition: types.hh:190
@ LAGRANGE_TRIANGLE
Definition: types.hh:191
@ WEDGE
Definition: types.hh:181
@ QUADRATIC_TRIANGLE
Definition: types.hh:185
@ QUADRATIC_TETRA
Definition: types.hh:187
@ LAGRANGE_TETRAHEDRON
Definition: types.hh:193
@ LAGRANGE_QUADRILATERAL
Definition: types.hh:192
@ TRIANGLE
Definition: types.hh:173
int size() const
The number of components in the data field.
Definition: types.hh:253
std::string const & name() const
The name of the data field.
Definition: types.hh:247
FieldInfo(Dune::VTK::FieldInfo info)
Definition: types.hh:242
Vtk::RangeTypes rangeType() const
Return the category of the stored range.
Definition: types.hh:259
Vtk::DataTypes dataType() const
Return the data tpe of the data field.
Definition: types.hh:265
FieldInfo(std::string name, Args... args)
Definition: types.hh:231