diff --git a/dumux/io/vtkmultiwriter.hh b/dumux/io/vtkmultiwriter.hh index af9f1d5bc61c378daa6930ce2266daaae3426e27..97ee6a8caca12c3ecd0bb61683407b9d4ac2d81e 100644 --- a/dumux/io/vtkmultiwriter.hh +++ b/dumux/io/vtkmultiwriter.hh @@ -122,11 +122,16 @@ public: template <class VectorField> void addVertexData(VectorField *field, const char *name) { -#ifndef NDEBUG // make sure the field is well defined - for (int i = 0; i < field->size(); ++i) + for (int i = 0; i < field->size(); ++i) { Valgrind::CheckDefined((*field)[i]); -#endif + + // set values which are too small to 0 to avoid problems + // with paraview + if (std::abs((*field)[i]) < FLT_MIN) + (*field)[i] = 0.0; + } + curWriter_->addVertexData(*field, name); }