Skip to content
Snippets Groups Projects
Commit e710c1cc authored by Christoph Rettinger's avatar Christoph Rettinger
Browse files

Fixed possible divide by zero in mesh vtk writer and added case to test

parent fd01f6c9
Branches
No related tags found
No related merge requests found
...@@ -106,7 +106,7 @@ public: ...@@ -106,7 +106,7 @@ public:
inline bool isFaceFilterSet() const { return static_cast<bool>(faceFilter_); } inline bool isFaceFilterSet() const { return static_cast<bool>(faceFilter_); }
void incrementTimeStep() { ++timestep_; } void incrementTimeStep() { ++timestep_; }
bool isWriteScheduled() const { return timestep_ % writeFrequency_ == 0; } bool isWriteScheduled() const { return writeFrequency_ > 0 && timestep_ % writeFrequency_ == 0; }
protected: protected:
void write( std::ostream & os ) const; void write( std::ostream & os ) const;
......
...@@ -150,6 +150,11 @@ void test( const std::string & meshFile ) ...@@ -150,6 +150,11 @@ void test( const std::string & meshFile )
meshWriterStatusfiltered.setFaceFilter( mesh::StatusFaceFilter< MeshType >( OpenMesh::Attributes::TAGGED ) ); meshWriterStatusfiltered.setFaceFilter( mesh::StatusFaceFilter< MeshType >( OpenMesh::Attributes::TAGGED ) );
meshWriterStatusfiltered(); meshWriterStatusfiltered();
VTKMeshWriter< MeshType > meshWriterDeactivated( mesh, "mesh_vtk_test_deactivated", 0 );
meshWriterDeactivated();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment