LocalCoords used in the local reference element.
More...
#include <LocalCoords.hpp>
|
using | unique_ptr = std::unique_ptr<LocalCoords> |
| Alias to unique_ptr.
|
|
|
double | r () const noexcept |
| Access coordinate r of the point.
|
|
double | s () const noexcept |
| Access coordinate s of the point.
|
|
double | t () const noexcept |
| Access coordinate t of the point.
|
|
double | operator[] (std::size_t index) const noexcept |
| Subscript operator, const version.
|
|
double & | GetNonCstValue (std::size_t index) noexcept |
| Subscript operator, non-const version.
|
|
std::size_t | GetDimension () const noexcept |
| Get the dimension of the LocalCoords.
|
|
void | Print (std::ostream &stream) const |
|
const std::vector< double > & | GetCoordinates () const noexcept |
| Return the coordinates of the LocalCoords.
|
|
double | GetValueOrZero (std::size_t index) const noexcept |
|
|
template<class T > |
| LocalCoords (T &&coordinates_as_double) |
| Constructor from a vector.
|
|
| LocalCoords (std::initializer_list< double > &&coor) |
|
| LocalCoords (const LocalCoords &rhs)=default |
| The copy constructor.
|
|
| LocalCoords (LocalCoords &&rhs)=default |
| The move constructor.
|
|
LocalCoords & | operator= (const LocalCoords &rhs)=default |
| The (copy) operator=.
|
|
LocalCoords & | operator= (LocalCoords &&rhs)=default |
| The (move) operator=.
|
|
virtual | ~LocalCoords () |
| Destructor.
|
|
LocalCoords used in the local reference element.
- Note
- You shouldn't have to handle this directly at all, even if you're writing your own operators. The only reason it is in Advanced rather than in Internal namespace is that you might need it should you define your own QuadratureRule.
LocalCoords doesn't inherit SpatialPoint on purpose: I do not want a IS-A relationship induced by a public inheritance. The reason is that I want the strong typing to help keep the code clean and clear: there is hence no risk on giving a SpatialPoint when a LocalCoords is expected, or vice-versa. Another reason is that for performance reasons I do not want virtual methods in SpatialPoint classes, and I would have to put the destructor virtual as SpatialPoint are an obvious candidate to be used polymorphically.
◆ LocalCoords() [1/4]
template<class T >
MoReFEM::LocalCoords::LocalCoords |
( |
T && | coordinates_as_double | ) |
|
|
explicit |
Constructor from a vector.
T is expected to be std::vector<double>.
- Parameters
-
[in] | coordinates_as_double | Value for each component of the object to build. Contrary to Coords, a LocalCoords may encompass 1, 2 or 3 components. |
◆ LocalCoords() [2/4]
MoReFEM::LocalCoords::LocalCoords |
( |
std::initializer_list< double > && | coor | ) |
|
Constructor from an initializer list.
- Parameters
-
[in] | coor | Initializer list which gives the (x, y, z) values. |
◆ LocalCoords() [3/4]
MoReFEM::LocalCoords::LocalCoords |
( |
const LocalCoords & | rhs | ) |
|
|
default |
The copy constructor.
- Parameters
-
[in] | rhs | The object from which the construction occurs. |
◆ LocalCoords() [4/4]
MoReFEM::LocalCoords::LocalCoords |
( |
LocalCoords && | rhs | ) |
|
|
default |
The move constructor.
- Parameters
-
[in] | rhs | The object from which the construction occurs. |
◆ 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::LocalCoords::operator[] |
( |
std::size_t | index | ) |
const |
|
noexcept |
Subscript operator, const version.
- Parameters
-
[in] | index | Component index. x, y and z coordinates may be accessed respectively with [0], [1], [2]. |
- Returns
- Coordinate at the index-th component.
◆ GetNonCstValue()
double & MoReFEM::LocalCoords::GetNonCstValue |
( |
std::size_t | index | ) |
|
|
noexcept |
Subscript operator, non-const version.
- Parameters
-
[in] | index | Component index. x, y and z coordinates may be accessed respectively with [0], [1], [2]. |
- Returns
- Coordinate at the index-th component.
◆ Print()
void MoReFEM::LocalCoords::Print |
( |
std::ostream & | stream | ) |
const |
Print function (used also for operator<< overload).
- Parameters
-
[in,out] | stream | Stream upon which object information are written. |
◆ GetValueOrZero()
double MoReFEM::LocalCoords::GetValueOrZero |
( |
std::size_t | index | ) |
const |
|
noexcept |
Returns the value of the index -th coordinates, or 0 if there are none.
- Parameters
-
[in] | index | Index of the component requested: 0 for x, 1 for y, 2 for z. |
◆ coordinate_list_
std::vector<double> MoReFEM::LocalCoords::coordinate_list_ |
|
private |
List of coordinates. Might be 1, 2 or 3 depending on the dimension of the element for which the coords are defined.
The documentation for this class was generated from the following file:
- /builds/2mk6rsew/0/MoReFEM/CoreLibrary/MoReFEM/Sources/Geometry/Coords/LocalCoords.hpp