MoReFEM
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes
MoReFEM::LocalCoords Class Reference

LocalCoords used in the local reference element. More...

#include <LocalCoords.hpp>

Inheritance diagram for MoReFEM::LocalCoords:
Collaboration diagram for MoReFEM::LocalCoords:

Public Types

using unique_ptr = std::unique_ptr<LocalCoords>
 Alias to unique_ptr.
 

Public Member Functions

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
 
Constructors and destructor.
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.
 
LocalCoordsoperator= (const LocalCoords &rhs)=default
 The (copy) operator=.
 
LocalCoordsoperator= (LocalCoords &&rhs)=default
 The (move) operator=.
 
virtual ~LocalCoords ()
 Destructor.
 

Private Attributes

std::vector< double > coordinate_list_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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_doubleValue 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]coorInitializer list which gives the (x, y, z) values.

◆ LocalCoords() [3/4]

MoReFEM::LocalCoords::LocalCoords ( const LocalCoords & rhs)
default

The copy constructor.

Parameters
[in]rhsThe object from which the construction occurs.

◆ LocalCoords() [4/4]

MoReFEM::LocalCoords::LocalCoords ( LocalCoords && rhs)
default

The move constructor.

Parameters
[in]rhsThe object from which the construction occurs.

Member Function Documentation

◆ operator=() [1/2]

LocalCoords & MoReFEM::LocalCoords::operator= ( const LocalCoords & rhs)
default

The (copy) operator=.

Parameters
[in]rhsThe object from which the affectation occurs.
Returns
Reference to the object (to enable chained affectation).

◆ operator=() [2/2]

LocalCoords & MoReFEM::LocalCoords::operator= ( LocalCoords && rhs)
default

The (move) operator=.

Parameters
[in]rhsThe 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]indexComponent 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]indexComponent 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]streamStream 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]indexIndex of the component requested: 0 for x, 1 for y, 2 for z.

Field Documentation

◆ 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: