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 <iomanip>
7
8
#include "
Elements/Element.h
"
9
10
namespace
MeshLib
11
{
12
Node::Node
(
const
double
coords[3], std::size_t
id
)
13
:
MathLib
::
Point3dWithID
(
14
std::array<double, 3>{{coords[0], coords[1], coords[2]}}, id)
15
{
16
}
17
18
Node::Node
(std::array<double, 3>
const
& coords, std::size_t
id
)
19
:
MathLib
::
Point3dWithID
(coords, id)
20
{
21
}
22
23
Node::Node
(
double
x,
double
y,
double
z, std::size_t
id
)
24
:
MathLib
::
Point3dWithID
(std::array<double, 3>({{x, y, z}}),
id
)
25
{
26
}
27
28
std::ostream&
operator<<
(std::ostream& os,
MeshLib::Node
const
& n)
29
{
30
auto
const
default_precision = os.precision();
31
os <<
"node #"
<< n.
getID
() <<
" { "
32
<< std::setprecision(std::numeric_limits<double>::digits10 + 1)
33
<<
static_cast<
MathLib::Point3d
const&
>
(n) <<
"}"
;
34
os << std::setprecision(default_precision);
35
return
os;
36
}
37
}
// namespace MeshLib
Element.h
Node.h
MathLib::Point3dWithID::getID
std::size_t getID() const
Definition
Point3dWithID.h:53
MathLib::Point3dWithID::Point3dWithID
Point3dWithID(double x0, double x1, double x2, std::size_t id=std::numeric_limits< std::size_t >::max())
Definition
Point3dWithID.h:24
MathLib::Point3d
Definition
Point3d.h:15
MeshLib::Node
Definition
Node.h:21
MeshLib::Node::Node
Node(const double coords[3], std::size_t id=std::numeric_limits< std::size_t >::max())
Constructor using a coordinate array.
Definition
Node.cpp:12
MathLib
Definition
CreateComponent.h:23
MeshLib
Definition
ProjectData.h:26
MeshLib::operator<<
std::ostream & operator<<(std::ostream &os, Element const &e)
Definition
Element.cpp:97
MeshLib
Node.cpp
Generated by
1.14.0