Skip to content

Commit

Permalink
Ensure bounding box of mesh is correctly initialized with negative pr…
Browse files Browse the repository at this point in the history
…ojected coordinates
  • Loading branch information
Chrismarsh committed Oct 20, 2024
1 parent 44abc6b commit f98f9e4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/mesh/triangulation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,11 +939,14 @@ class triangulation
boost::mpi::communicator _comm_world;
#endif

// some of the coordinates might be negative, so by init with a nan
// when this is filled using std::min and std::max, the nan willbe ignored on the first
// comparison
struct bounding_box{
double x_min {0};
double x_max {0};
double y_min {0};
double y_max {0};
double x_min {std::nan("")};
double x_max {std::nan("")};
double y_min {std::nan("")};
double y_max {std::nan("")};
} _bounding_box;

protected:
Expand Down Expand Up @@ -1052,7 +1055,7 @@ class triangulation
#else
std::map<std::string, vtkSmartPointer<vtkFloatArray> > data;
std::map<std::string, vtkSmartPointer<vtkFloatArray> > vectors;
std::map<std::string, vtkSmartPointer<vtkFloatArray> > vertex_data;
std::map<std::string, vtkSmartPointer<vtkFloatArray> > vertex_data;
#endif

//should we write parameters to the vtu file?
Expand Down

0 comments on commit f98f9e4

Please sign in to comment.