OGS
Node.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "MeshLib/Node.h"
5
6#include "Elements/Element.h"
7
8namespace MeshLib
9{
10Node::Node(const double coords[3], std::size_t id)
12 std::array<double, 3>{{coords[0], coords[1], coords[2]}}, id)
13{
14}
15
16Node::Node(std::array<double, 3> const& coords, std::size_t id)
17 : MathLib::Point3dWithID(coords, id)
18{
19}
20
21Node::Node(double x, double y, double z, std::size_t id)
22 : MathLib::Point3dWithID(std::array<double, 3>({{x, y, z}}), id)
23{
24}
25
26std::ostream& operator<<(std::ostream& os, MeshLib::Node const& n)
27{
28 return os << "node #" << n.getID() << " { "
29 << static_cast<MathLib::Point3d const&>(n) << "}";
30}
31} // namespace MeshLib
std::size_t getID() const
Point3dWithID(double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
Node(const double coords[3], std::size_t id=std::numeric_limits< std::size_t >::max())
Constructor using a coordinate array.
Definition Node.cpp:10
std::ostream & operator<<(std::ostream &os, Element const &e)
Definition Element.cpp:97