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

Defines a quadrature rule. More...

#include <QuadratureRule.hpp>

Collaboration diagram for MoReFEM::QuadratureRule:

Public Types

using const_shared_ptr = std::shared_ptr<const QuadratureRule>
 Alias to shared_ptr to constant object.
 
using const_unique_ptr = std::unique_ptr<const QuadratureRule>
 Alias to unique_ptr to constant object.
 
using vector_const_shared_ptr = std::vector<const_shared_ptr>
 Alias to a vector of const_shared_ptr.
 

Public Member Functions

void AddQuadraturePoint (LocalCoords &&local_coords, double weight)
 Add a new quadrature point.
 
std::size_t NquadraturePoint () const noexcept
 Number of quadrature points.
 
const QuadraturePointPoint (std::size_t index) const noexcept
 
std::size_t DegreeOfExactness () const noexcept
 Return the degree of exactness if relevant (and will assert in debug if not).
 
TopologyNS::Type GetTopologyIdentifier () const noexcept
 Identifier of the topology upon which the rule is defined.
 
const std::string & GetName () const noexcept
 Returns the name of the quadrature rule.
 
const QuadraturePoint::vector_const_shared_ptrGetQuadraturePointList () const noexcept
 Returns the list of quadrature points.
 
Constructors and destructor.
 QuadratureRule (std::string &&name, QuadraturePoint::vector_const_shared_ptr &&point_list, TopologyNS::Type topology_id, std::size_t degree_of_exactness)
 
 QuadratureRule (std::string &&name, TopologyNS::Type topology_id, std::size_t degree_of_exactness=NumericNS::UninitializedIndex< std::size_t >())
 
 QuadratureRule (TopologyNS::Type topology_id, std::size_t degree_of_exactness)
 Dummy constructor with only degree of exactness defined.
 
 ~QuadratureRule ()=default
 Destructor.
 
 QuadratureRule (const QuadratureRule &rhs)=delete
 The copy constructor.
 
 QuadratureRule (QuadratureRule &&rhs)=default
 The move constructor.
 
QuadratureRuleoperator= (const QuadratureRule &rhs)=delete
 The (copy) operator=.
 
QuadratureRuleoperator= (QuadratureRule &&rhs)=delete
 The (move) operator=.
 

Private Attributes

std::string name_
 Name of the quadrature rule.
 
QuadraturePoint::vector_const_shared_ptr point_list_
 List of quadrature points.
 
const TopologyNS::Type topology_id_
 Identifier of the geometric element upon which the rule is defined.
 
const std::size_t degree_of_exactness_
 Degree of exactness.
 

Detailed Description

Defines a quadrature rule.

Constructor & Destructor Documentation

◆ QuadratureRule() [1/5]

MoReFEM::QuadratureRule::QuadratureRule ( std::string && name,
QuadraturePoint::vector_const_shared_ptr && point_list,
TopologyNS::Type topology_id,
std::size_t degree_of_exactness )
explicit

Constructor.

Parameters
[in]topology_idTopology identifier.
[in]degree_of_exactnessDegree of exactness of the rule. Choose NumericNS::UninitiazedIndex() for rules for which it is pointless.
Todo
This should be handled more properly with inheritance, so that rules for which it is pointless do not even have such an attribute, but convention above will do for the time being.
Parameters
[in]nameName of the quadrature rule.
[in]point_listList of quadrature points.

◆ QuadratureRule() [2/5]

MoReFEM::QuadratureRule::QuadratureRule ( std::string && name,
TopologyNS::Type topology_id,
std::size_t degree_of_exactness = NumericNS::UninitializedIndex< std::size_t >() )
explicit

Constructor.

In this overload, quadrature points aren't yet defined and must be added afterwards through AddQuadraturePoint() method.

Parameters
[in]topology_idTopology identifier.
[in]degree_of_exactnessDegree of exactness of the rule. Choose NumericNS::UninitiazedIndex() for rules for which it is pointless.
Todo
This should be handled more properly with inheritance, so that rules for which it is pointless do not even have such an attribute, but convention above will do for the time being.
Parameters
[in]nameName of the quadrature rule.

◆ QuadratureRule() [3/5]

MoReFEM::QuadratureRule::QuadratureRule ( TopologyNS::Type topology_id,
std::size_t degree_of_exactness )
explicit

Dummy constructor with only degree of exactness defined.

Should be used solely to ease definition of sorting functions.

Parameters
[in]topology_idTopology identifier.
[in]degree_of_exactnessDegree of exactness of the rule. Choose NumericNS::UninitiazedIndex() for rules for which it is pointless.
Todo
This should be handled more properly with inheritance, so that rules for which it is pointless do not even have such an attribute, but convention above will do for the time being.
auto sorting_rule = [](const GetQuadratureRule& rule1, const GetQuadratureRule& rule2)
{
return rule1.DegreeOfExactness() < rule2.DegreeOfExactness();
};
std::vector<QuadratureRule> list;
... defines your list ...
std::lower_bound(list.cbegin(), list.cend(), GetQuadratureRule(5), sorting_rule);

◆ QuadratureRule() [4/5]

MoReFEM::QuadratureRule::QuadratureRule ( const QuadratureRule & rhs)
delete

The copy constructor.

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

◆ QuadratureRule() [5/5]

MoReFEM::QuadratureRule::QuadratureRule ( QuadratureRule && rhs)
default

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

QuadratureRule & MoReFEM::QuadratureRule::operator= ( const QuadratureRule & rhs)
delete

The (copy) operator=.

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

◆ operator=() [2/2]

QuadratureRule & MoReFEM::QuadratureRule::operator= ( QuadratureRule && rhs)
delete

The (move) operator=.

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

◆ AddQuadraturePoint()

void MoReFEM::QuadratureRule::AddQuadraturePoint ( LocalCoords && local_coords,
double weight )

Add a new quadrature point.

The quadrature point is created inside the function from local_coords and weight.

Parameters
[in]local_coordsLocal coordinates of the quadrature point to create.
[in]weightWeight of the quadrature point to create.

◆ Point()

const QuadraturePoint & MoReFEM::QuadratureRule::Point ( std::size_t index) const
noexcept

Access to one quadrature point.

Parameters
[in]indexPosition in the vector of the sought QuadraturePoint.

Field Documentation

◆ degree_of_exactness_

const std::size_t MoReFEM::QuadratureRule::degree_of_exactness_
private

Degree of exactness.

Equal to NumericNS::UninitiazedIndex() for rules for which it is pointless.

Todo
This should be handled more properly with inheritance, so that rules for which it is pointless do not even have such an attribute, but convention above will do for the time being.

The documentation for this class was generated from the following file: