Loading [MathJax]/extensions/tex2jax.js
OGS
Node.cpp
Go to the documentation of this file.
1
15#include "MeshLib/Node.h"
16
17#include "Elements/Element.h"
18
19namespace MeshLib
20{
21Node::Node(const double coords[3], std::size_t id)
22 : MathLib::Point3dWithID(
23 std::array<double, 3>{{coords[0], coords[1], coords[2]}}, id)
24{
25}
26
27Node::Node(std::array<double, 3> const& coords, std::size_t id)
28 : MathLib::Point3dWithID(coords, id)
29{
30}
31
32Node::Node(double x, double y, double z, std::size_t id)
33 : MathLib::Point3dWithID(std::array<double, 3>({{x, y, z}}), id)
34{
35}
36
37Node::Node(const Node& node) : MathLib::Point3dWithID(node, node.getID()) {}
38
39std::ostream& operator<<(std::ostream& os, MeshLib::Node const& n)
40{
41 return os << "node #" << n.getID() << " { "
42 << static_cast<MathLib::Point3d const&>(n) << "}";
43}
44} // namespace MeshLib
Definition of the Element class.
Definition of the Node class.
std::size_t getID() const
Node(const double coords[3], std::size_t id=std::numeric_limits< std::size_t >::max())
Constructor using a coordinate array.
Definition Node.cpp:21
std::ostream & operator<<(std::ostream &os, Element const &e)
Definition Element.cpp:108