OGS
SpatialPosition.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 "
SpatialPosition.h
"
5
6
#include <iomanip>
7
#include <limits>
8
#include <ostream>
9
10
namespace
ParameterLib
11
{
12
std::ostream&
operator<<
(std::ostream& os,
SpatialPosition
const
& pos)
13
{
14
auto
const
default_precision = os.precision();
15
os <<
"{ node: "
;
16
if
(
auto
const
node_id = pos.
getNodeID
())
17
{
18
os << *node_id;
19
}
20
else
21
{
22
os <<
"not set"
;
23
}
24
25
os <<
", element: "
;
26
if
(
auto
const
element_id = pos.
getElementID
())
27
{
28
os << *element_id;
29
}
30
else
31
{
32
os <<
"not set"
;
33
}
34
35
os <<
", coordinates: "
;
36
if
(
auto
const
coordinates = pos.
getCoordinates
())
37
{
38
os << std::setprecision(std::numeric_limits<double>::digits10 + 1)
39
<<
"("
<< *coordinates <<
")"
40
<< std::setprecision(default_precision);
41
}
42
else
43
{
44
os <<
"not set"
;
45
}
46
os <<
" }"
;
47
return
os;
48
}
49
}
// namespace ParameterLib
SpatialPosition.h
ParameterLib::SpatialPosition
Definition
SpatialPosition.h:24
ParameterLib::SpatialPosition::getNodeID
std::optional< std::size_t > getNodeID() const
Definition
SpatialPosition.h:50
ParameterLib::SpatialPosition::getElementID
std::optional< std::size_t > getElementID() const
Definition
SpatialPosition.h:54
ParameterLib::SpatialPosition::getCoordinates
std::optional< MathLib::Point3d > const getCoordinates() const
Definition
SpatialPosition.h:59
ParameterLib
Definition
ChemicalSolverInterface.h:103
ParameterLib::operator<<
std::ostream & operator<<(std::ostream &os, SpatialPosition const &pos)
Definition
SpatialPosition.cpp:12
ParameterLib
SpatialPosition.cpp
Generated by
1.14.0