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