MoReFEM
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | Friends
MoReFEM::Node Class Referencefinal

A Node is an ensemble of Dofs located at the same place and addressing the same unknown and shape function label. More...

#include <Node.hpp>

Inheritance diagram for MoReFEM::Node:
Collaboration diagram for MoReFEM::Node:

Public Types

using shared_ptr = std::shared_ptr<Node>
 Shared pointer.
 
using vector_shared_ptr = std::vector<shared_ptr>
 Vector of shared pointers.
 

Public Member Functions

void Init (std::size_t Ndof)
 This method must be called to fulfill construction of the object.
 
const UnknownGetUnknown () const noexcept
 Get the unknown.
 
const std::string & GetShapeFunctionLabel () const noexcept
 Get the shape function label.
 
const Dof::vector_shared_ptrGetDofList () const noexcept
 Get the list of dofs.
 
const DofGetDof (std::size_t i) const
 
const Dof::shared_ptrGetDofPtr (std::size_t i) const
 
std::size_t Ndof () const noexcept
 Returns the number of dofs.
 
void RegisterNumberingSubset (NumberingSubset::const_shared_ptr numbering_subset)
 Register a numbering subset for the node if it does not exist yet; do nothing otherwise.
 
bool IsInNumberingSubset (const NumberingSubset &numbering_subset) const
 
const NumberingSubset::vector_const_shared_ptrGetNumberingSubsetList () const noexcept
 Return the list of numbering subset.
 
std::shared_ptr< const NodeBearerGetNodeBearerFromWeakPtr () const
 Return a pointer to the NodeBearer to which the current Node belongs to.
 
Special members.
 Node (const std::shared_ptr< const NodeBearer > &node_bearer_ptr, const ExtendedUnknown &extended_unknown)
 Constructor.
 
 ~Node ()=default
 Destructor.
 
 Node (const Node &rhs)=delete
 The copy constructor.
 
 Node (Node &&rhs)=delete
 The move constructor.
 
Nodeoperator= (const Node &rhs)=delete
 The (copy) operator=.
 
Nodeoperator= (Node &&rhs)=delete
 The (move) operator=.
 

Private Attributes

const Unknownunknown_
 Unknown.
 
const std::string & shape_function_label_
 Shape function.
 
NumberingSubset::vector_const_shared_ptr numbering_subset_list_
 List of numbering subsets to which the node belongs.
 
Dof::vector_shared_ptr dof_list_
 List of dofs.
 
std::weak_ptr< const NodeBearernode_bearer_
 Weak pointer to NodeBearer.
 
bool init_called_ = false
 This variable is initialized to true once Init() method has beenc called.
 

Friends

class NodeBearer
 Friendship to NodeBearer (the only class allowed to create Node object).
 

Detailed Description

A Node is an ensemble of Dofs located at the same place and addressing the same unknown and shape function label.

A node doesn't store directly an ExtendedUnknown: if the Unknown and the ShapeFunctionLabel are obvious, a same Node might be registered in several FEltSpace for different NumberingSubset.

Constructor & Destructor Documentation

◆ Node() [1/3]

MoReFEM::Node::Node ( const std::shared_ptr< const NodeBearer > & node_bearer_ptr,
const ExtendedUnknown & extended_unknown )
explicit

Constructor.

Attention
I had to make it public as std::make_shared doesn't propagate friendship and weak_ptr construction requires to build it directly as a smart pointer (rather than converting after the fact a raw one) but for all intents and purposes this constructor should be viewed as private: creating Node objects is something only NodeBearer class is allowed to do.
Parameters
[in]extended_unknownUnknown addressed by all the dofs in the Node (e.g. 'displacement', 'pressure'). It is here an extended unknown because when it is created it is within a given numbering subset, however it's important to remember a given Node might be related to many numbering subsets in the end (some may be added through RegisterNumberingSubset()).
[in]node_bearer_ptrPointer to the node bearer onto which the Node is created.

◆ Node() [2/3]

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

The copy constructor.

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

◆ Node() [3/3]

MoReFEM::Node::Node ( Node && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

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

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

The (move) operator=.

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

◆ Init()

void MoReFEM::Node::Init ( std::size_t Ndof)

This method must be called to fulfill construction of the object.

Parameters
[in]NdofNumber of dofs to create.

The Dof are built there as they need weak pointer to current object - which the constructor can't give directly.

◆ GetDof()

const Dof & MoReFEM::Node::GetDof ( std::size_t i) const

Returns the i -th dof of the list.

Parameters
[in]iPosition of the Dof in the vector.

◆ GetDofPtr()

const Dof::shared_ptr & MoReFEM::Node::GetDofPtr ( std::size_t i) const

Returns the i -th dof of the list as a smart pointer.

Parameters
[in]iPosition of the Dof in the vector.

◆ RegisterNumberingSubset()

void MoReFEM::Node::RegisterNumberingSubset ( NumberingSubset::const_shared_ptr numbering_subset)

Register a numbering subset for the node if it does not exist yet; do nothing otherwise.

Parameters
[in]numbering_subsetNumberingSubset to be registered.

◆ IsInNumberingSubset()

bool MoReFEM::Node::IsInNumberingSubset ( const NumberingSubset & numbering_subset) const

Returns whether the node belongs to the numbering_subset.

Parameters
[in]numbering_subsetNumberingSubset used as filter.

◆ GetNodeBearerFromWeakPtr()

std::shared_ptr< const NodeBearer > MoReFEM::Node::GetNodeBearerFromWeakPtr ( ) const

Return a pointer to the NodeBearer to which the current Node belongs to.

[internal] No reference on purpose here: node_bearer_ is stored as a weak_ptr not to introduce circular dependency.

Returns
Shared pointer to the enclosing NodeBearer.

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