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

Very generic information about a given unknown. More...

#include <Unknown.hpp>

Inheritance diagram for MoReFEM::Unknown:
Collaboration diagram for MoReFEM::Unknown:

Public Types

using const_shared_ptr = std::shared_ptr<const Unknown>
 Alias to shared pointer.
 
using vector_const_shared_ptr = std::vector<const_shared_ptr>
 Alias to vector of shared pointers.
 
using unique_id_parent = Crtp::UniqueId<Unknown, UnknownNS::unique_id, UniqueIdNS::AssignationMode::manual>
 Alias to the unique id parent.
 
using underlying_type
 Type used for the unique id.
 

Public Member Functions

UnknownNS::Nature GetNature () const noexcept
 Nature of the unknown.
 
const std::string & GetName () const noexcept
 Get the name of the variable.
 
UnknownNS::unique_id GetUniqueId () const
 Get the value of the internal unique ID.
 

Static Public Member Functions

static const std::string & ClassName ()
 Name of the class.
 
static UnknownNS::unique_id GenerateNewEligibleId ()
 Generate a unique id.
 
static void ClearUniqueIdList ()
 Clear all unique ids.
 

Static Private Member Functions

static UnknownNS::unique_id AssignUniqueId ()
 If AssignationMode is automatic, generates a new unique identifier.
 
static UnknownNS::unique_id NewUniqueId (UnknownNS::unique_id new_unique_id)
 If AssignationMode is manual, checks the unique identifier provided is valid.
 
static std::set< UnknownNS::unique_id > & StaticUniqueIdList ()
 List of all identifiers existing for DerivedT.
 

Private Attributes

const std::string name_
 Name of the variable.
 
const UnknownNS::Nature nature_
 Nature of the unknown.
 
const UnknownNS::unique_id unique_id_
 The value of the unique id for the current DerivedT object.
 

Friends

class UnknownManager
 Friendship.
 

Special members.

 Unknown (const std::string &name, UnknownNS::unique_id unique_id, const UnknownNS::Nature nature)
 Constructor.
 
 ~Unknown ()=default
 Destructor.
 
 Unknown (const Unknown &rhs)=delete
 The copy constructor.
 
 Unknown (Unknown &&rhs)=delete
 The move constructor.
 
Unknownoperator= (const Unknown &rhs)=delete
 The (copy) operator=.
 
Unknownoperator= (Unknown &&rhs)=delete
 The (move) operator=.
 

Detailed Description

Very generic information about a given unknown.

Constructor & Destructor Documentation

◆ Unknown() [1/3]

MoReFEM::Unknown::Unknown ( const std::string & name,
UnknownNS::unique_id unique_id,
const UnknownNS::Nature nature )
explicitprivate

Constructor.

Private as unknown should be created by UnknownManager.

Parameters
[in]unique_idUnique identifier of the unknown, used to tag it in the input data file.
[in]nameName of the unknown, which can be whatever you wish provided it's unique within the model.
[in]natureWhether the unknown is scalar or vectorial.

◆ Unknown() [2/3]

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

The copy constructor.

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

◆ Unknown() [3/3]

MoReFEM::Unknown::Unknown ( Unknown && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

Unknown & MoReFEM::Unknown::operator= ( const Unknown & 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]

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

The (move) operator=.

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

◆ GetUniqueId()

UnknownNS::unique_id MoReFEM::Crtp::UniqueId< Unknown , UnknownNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::GetUniqueId ( ) const
inherited

Get the value of the internal unique ID.

Returns
Unique id.

◆ GenerateNewEligibleId()

static UnknownNS::unique_id MoReFEM::Crtp::UniqueId< Unknown , UnknownNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::GenerateNewEligibleId ( )
staticinherited

Generate a unique id.

No new objects is created, and the new identifier is not counted in the list - the purpose here is just to provide a value that don't collide with existing objects. This is really used in a very edge case; think twice before using this functionality as it really might not be what you really seek.

Returns
A unique id that is not in use yet.

◆ ClearUniqueIdList()

static void MoReFEM::Crtp::UniqueId< Unknown , UnknownNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::ClearUniqueIdList ( )
staticinherited

Clear all unique ids.

Attention
This functionality has been put there only for the sake of writing tests; please do not use it! It should be considered as private, even if unfortunately I can't easily put it that way.

◆ AssignUniqueId()

static UnknownNS::unique_id MoReFEM::Crtp::UniqueId< Unknown , UnknownNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::AssignUniqueId ( )
staticprivateinherited

If AssignationMode is automatic, generates a new unique identifier.

Returns
The new unique id, which is just an increment from the previously assigned one.

◆ NewUniqueId()

static UnknownNS::unique_id MoReFEM::Crtp::UniqueId< Unknown , UnknownNS::unique_id , AssignationModeT, UniqueIdNS::DoAllowNoId::no >::NewUniqueId ( UnknownNS::unique_id new_unique_id)
staticprivateinherited

If AssignationMode is manual, checks the unique identifier provided is valid.

Parameters
[in]new_unique_idThe proposed new unique id. If it already exists an exception will be thrown.
Returns
The unmodified unique id.

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