Define a spatial three-dimensional point.
More...
#include <SpatialPoint.hpp>
|
using | self = SpatialPoint |
| Alias to the type of the class.
|
|
using | unique_ptr = std::unique_ptr<self> |
| Convenient smart pointer.
|
|
using | vector_unique_ptr = std::vector<unique_ptr> |
| Vector of unique_ptr.
|
|
|
double | x () const |
| Return the first component of the point.
|
|
double | y () const |
| Return the second component of the point (if relevant; if not an exception is thrown).
|
|
double | z () const |
| Return the third component of the point (if relevant; if not an exception is thrown).
|
|
double | operator[] (std::size_t i) const |
| Constant accessor to the i -th element of the object.
|
|
double & | GetNonCstValue (std::size_t index) |
| Non constant access to the value for component.
|
|
void | Print (std::ostream &stream) const |
|
const std::array< double, 3 > & | GetCoordinateList () const noexcept |
| Get the position as a std::array.
|
|
void | Reset () |
| Reset the coords to 0.
|
|
|
| SpatialPoint () |
| Default constructor; all coordinates are set to 0.
|
|
| SpatialPoint (double x, double y, double z, const double space_unit) |
| Constructor from three scalars.
|
|
template<typename T > |
| SpatialPoint (T &&value, const double space_unit) |
| Constructor from an array.
|
|
| SpatialPoint (std::size_t Ncoor, std::istream &stream, const double space_unit) |
| Constructor from a input stream.
|
|
| SpatialPoint (const SpatialPoint &rhs)=delete |
| The copy constructor.
|
|
| SpatialPoint (SpatialPoint &&rhs)=delete |
| The move constructor.
|
|
| ~SpatialPoint () |
| Destructor.
|
|
SpatialPoint & | operator= (const SpatialPoint &rhs)=delete |
| The (copy) operator=.
|
|
SpatialPoint & | operator= (SpatialPoint &&rhs)=delete |
| The (move) operator=.
|
|
|
std::array< double, 3 > | coordinate_list_ |
| List of coordinates.
|
|
Define a spatial three-dimensional point.
If the point is actually part of a mesh, you should look for derived class Coords.
- Todo
- #887 Should probably be advanced, but currently FindSpatialPointOfGlobalVector requires public and casual access to it. However this class was avoided in Poromechanics; I'll have to check whether the new mechanism would work in CardiacMechanics where FindSpatialPointOfGlobalVector is applied (the priority of this task is not very high, and I have to retrieve what I did in Poromechanics.
◆ self
Alias to the type of the class.
◆ SpatialPoint() [1/5]
MoReFEM::SpatialPoint::SpatialPoint |
( |
double | x, |
|
|
double | y, |
|
|
double | z, |
|
|
const double | space_unit ) |
|
explicit |
Constructor from three scalars.
- Parameters
-
[in] | x | Value for first component. |
[in] | y | Value for second component. |
[in] | z | Value for third component. |
- Parameters
-
[in] | space_unit | The unit of the mesh, in meters. |
◆ SpatialPoint() [2/5]
template<typename T >
MoReFEM::SpatialPoint::SpatialPoint |
( |
T && | value, |
|
|
const double | space_unit ) |
|
explicit |
Constructor from an array.
- Template Parameters
-
T | Must be std::array<Floating-point type, 3>. |
- Parameters
-
[in] | value | Value of the array to set. |
- Parameters
-
[in] | space_unit | The unit of the mesh, in meters. |
◆ SpatialPoint() [3/5]
MoReFEM::SpatialPoint::SpatialPoint |
( |
std::size_t | Ncoor, |
|
|
std::istream & | stream, |
|
|
const double | space_unit ) |
|
explicit |
Constructor from a input stream.
- Parameters
-
[in] | Ncoor | Number of coordinates to be read. Expected to be at most 3. |
[in,out] | stream | Stream from which the point is read. Coordinates are expected to be separated by tabs or spaces. Stream is read until failbit is met; then it is put back at the position just before that failure. |
- Parameters
-
[in] | space_unit | The unit of the mesh, in meters. |
◆ SpatialPoint() [4/5]
MoReFEM::SpatialPoint::SpatialPoint |
( |
const SpatialPoint & | rhs | ) |
|
|
delete |
The copy constructor.
- Parameters
-
[in] | rhs | The object from which the construction occurs. |
◆ SpatialPoint() [5/5]
The move constructor.
- Parameters
-
[in] | rhs | The object from which the construction occurs. |
◆ ~SpatialPoint()
MoReFEM::SpatialPoint::~SpatialPoint |
( |
| ) |
|
Destructor.
Virtual status is avoided as Coords objects are not supposed to be used through a SpatialPoint pointer, and at the time being no other child class is expected.
◆ operator=() [1/2]
The (copy) operator=.
- Parameters
-
[in] | rhs | The object from which the affectation occurs. |
- Returns
- Reference to the object (to enable chained affectation).
◆ operator=() [2/2]
The (move) operator=.
- Parameters
-
[in] | rhs | The object from which the affectation occurs. |
- Returns
- Reference to the object (to enable chained affectation).
◆ operator[]()
double MoReFEM::SpatialPoint::operator[] |
( |
std::size_t | i | ) |
const |
Constant accessor to the i -th element of the object.
- Parameters
-
[in] | i | Index for of the sought value. |
- Returns
- Value of the i -th element of the object.
i might be 0 (for 'x' component), 1 (for 'y') or 2 (for 'z').
◆ GetNonCstValue()
double & MoReFEM::SpatialPoint::GetNonCstValue |
( |
std::size_t | index | ) |
|
Non constant access to the value for component.
- Parameters
-
[in] | index | Index of the sought component: 0 for x, 1 for y and 2 for z. |
◆ Print()
void MoReFEM::SpatialPoint::Print |
( |
std::ostream & | stream | ) |
const |
Print function: display the coordinates.
- Parameters
-
[in,out] | stream | Stream upon which object information are written. |
◆ Distance
Friendship.
- Parameters
-
[in] | lhs | Left-hand side. |
[in] | rhs | Right-hand side. |
- Returns
- Distance between two points following L2 norm.
The documentation for this class was generated from the following file:
- /builds/2mk6rsew/0/MoReFEM/CoreLibrary/MoReFEM/Sources/Geometry/Coords/SpatialPoint.hpp