OGS
GMSHPoint.cpp
Go to the documentation of this file.
1 
11 #include "GMSHPoint.h"
12 
13 #include <cmath>
14 #include <limits>
15 
16 namespace FileIO
17 {
18 namespace GMSH
19 {
20 GMSHPoint::GMSHPoint(GeoLib::Point const& pnt, std::size_t id,
21  double mesh_density)
22  : GeoLib::Point(pnt, id), _mesh_density(mesh_density)
23 {
24 }
25 
26 void GMSHPoint::write(std::ostream& os) const
27 {
28  os << "Point(" << getID() << ") = {" << (*this)[0] << ", " << (*this)[1]
29  << ", " << (*this)[2];
30  if (fabs(_mesh_density) > std::numeric_limits<double>::epsilon())
31  {
32  os << ", " << _mesh_density << "};";
33  }
34  else
35  {
36  os << "};";
37  }
38 }
39 
40 std::ostream& operator<<(std::ostream& os, GMSHPoint const& p)
41 {
42  p.write(os);
43  return os;
44 }
45 
46 } // end namespace GMSH
47 } // end namespace FileIO
GMSHPoint(GeoLib::Point const &pnt, std::size_t id, double mesh_density)
Definition: GMSHPoint.cpp:20
void write(std::ostream &os) const override
Definition: GMSHPoint.cpp:26
std::size_t getID() const
Definition: Point3dWithID.h:62
static std::ostream & operator<<(std::ostream &os, std::vector< GMSHPoint * > const &points)
TemplateElement< PointRule1 > Point
Definition: Point.h:20