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

A NodeBearer is created whenever some dofs are located on a given geometric Interface. More...

#include <NodeBearer.hpp>

Inheritance diagram for MoReFEM::NodeBearer:
Collaboration diagram for MoReFEM::NodeBearer:

Public Types

using shared_ptr = std::shared_ptr<NodeBearer>
 Shared smart pointer.
 
using vector_shared_ptr = std::vector<shared_ptr>
 Vector of shared smart pointers.
 
using const_shared_ptr = std::shared_ptr<const NodeBearer>
 
using vector_const_shared_ptr = std::vector<const_shared_ptr>
 

Public Member Functions

::MoReFEM::NodeBearerNS::program_wise_index_type GetProgramWiseIndex () const noexcept
 Get index.
 
Node::vector_shared_ptr GetNodeList (const Unknown &unknown, const std::string &shape_function_label) const
 Returns the list of Node matching the given unknown and shape_function_label.
 
void SetProcessor (std::size_t processor)
 
void SetGhost (const NumberingSubset &numbering_subset, std::size_t processor)
 Specify the NodeBearer is a ghost on processor.
 
std::size_t GetProcessor () const noexcept
 Get the processor to which the node bearer belongs to.
 
InterfaceNS::Nature GetNature () const noexcept
 Returns the nature of the node.
 
std::size_t Ndof () const
 Returns the number of dofs born by the node.
 
std::size_t Ndof (const NumberingSubset &numbering_subset) const
 
bool IsUnknown (const Unknown &unknown) const
 
const InterfaceGetInterface () const noexcept
 Returns the interface on which the node is located.
 
void SetProgramWiseIndex (NodeBearerNS::program_wise_index_type index)
 
std::size_t Nnode (const Unknown &unknown, const std::string &shape_function_label) const
 
bool IsEmpty () const noexcept
 Whether there are nodes in the node bearer.
 
const Node::vector_shared_ptrGetNodeList () const noexcept
 Return the list of nodes.
 
Node::vector_shared_ptr GetNodeList (const NumberingSubset &numbering_subset) const noexcept
 Return the list of nodes that match the given NumberingSubset.
 
bool IsGhost (const Wrappers::Mpi &mpi) const noexcept
 Whether the NodeBearer is a ghost or not.
 
bool IsInNumberingSubset (const NumberingSubset &numbering_subset) const
 Returns whether the NodeBearer is in the numbering_subset.
 
const std::set< std::size_t > & GetGhostProcessorList (const NumberingSubset &numbering_subset) const noexcept
 Returns the list of processors that store the NodeBearer as a ghost.
 
std::set< std::size_t > ComputeGhostProcessorList () const
 Compute the list of all processors that track current NodeBearer.
 
bool IsGhosted (const NumberingSubset &numbering_subset) const noexcept
 Whether there are other processors that ghost the NodeBearer.
 
Special members.
 NodeBearer (const Interface::shared_ptr &interface)
 Constructor.
 
 ~NodeBearer ()=default
 Destructor.
 
 NodeBearer (const NodeBearer &rhs)=delete
 The copy constructor.
 
 NodeBearer (NodeBearer &&rhs)=delete
 The move constructor.
 
NodeBeareroperator= (const NodeBearer &rhs)=delete
 The (copy) operator=.
 
NodeBeareroperator= (NodeBearer &&rhs)=delete
 The (move) operator=.
 

Private Types

using ghost_processor_list_per_numbering_subset_type
 Convenient alias.
 

Private Member Functions

const ghost_processor_list_per_numbering_subset_typeGetGhostProcessorListPerNumberingSubset () const noexcept
 Processors that include as ghost the current NodeBearer for each NumberingSubset.
 
ghost_processor_list_per_numbering_subset_typeGetNonCstGhostProcessorListPerNumberingSubset () noexcept
 Processors that include as ghost the current NodeBearer for each NumberingSubset.
 
Node::shared_ptr AddNode (const ExtendedUnknown &extended_unknown, std::size_t Ndof)
 Add a new node.
 

Private Attributes

::MoReFEM::NodeBearerNS::program_wise_index_type program_wise_index_
 An internal index that is useful during partitioning steps.
 
std::size_t processor_ = NumericNS::UninitializedIndex<std::size_t>()
 Processor that holds the node.
 
ghost_processor_list_per_numbering_subset_type ghost_processor_list_per_numbering_subset_
 Processors that include as ghost the current NodeBearer for each NumberingSubset.
 
Node::vector_shared_ptr node_list_
 List of nodes.
 
Interface::shared_ptr interface_
 Interface that bears the node.
 

Friends

class Internal::FEltSpaceNS::MatrixPattern
 Friendship to give access to internal class.
 
class Internal::FEltSpaceNS::MatchInterfaceNodeBearer
 Friendship to give access to internal class.
 
class GodOfDof
 Friendship to GodOfDof.
 

Detailed Description

A NodeBearer is created whenever some dofs are located on a given geometric Interface.

So for instance if in a mesh there are triangles P1:

Of course, the same is true for Face or Volume interfaces.

There is only one NodeBearer for a given interface; there is further classification within NodeBearer objects (Dofs are grouped per Node).

Member Typedef Documentation

◆ const_shared_ptr

using MoReFEM::NodeBearer::const_shared_ptr = std::shared_ptr<const NodeBearer>

Shared smart pointer to a const value. This is used for instance when a Node creates such a pointer from a weak_ptr.

◆ vector_const_shared_ptr

Vector of shared smart pointers to a const value. This is used for instance when a Node creates such a pointer from a weak_ptr.

◆ ghost_processor_list_per_numbering_subset_type

Initial value:
std::unordered_map<NumberingSubsetNS::unique_id, std::set<std::size_t>>

Convenient alias.

Constructor & Destructor Documentation

◆ NodeBearer() [1/3]

MoReFEM::NodeBearer::NodeBearer ( const Interface::shared_ptr & interface)
explicit

Constructor.

Parameters
[in]interfaceInterface onto which the node is built.

[internal] index is given as a std::size_t as in practice it will be the size of the list that will be passed to this constructor:

node_list_.push_back(std::make_shared<Node>(interface, node_list_.size()));
Node::vector_shared_ptr node_list_
List of nodes.
Definition NodeBearer.hpp:349

◆ NodeBearer() [2/3]

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

The copy constructor.

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

◆ NodeBearer() [3/3]

MoReFEM::NodeBearer::NodeBearer ( NodeBearer && rhs)
delete

The move constructor.

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

Member Function Documentation

◆ operator=() [1/2]

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

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

The (move) operator=.

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

◆ GetNodeList() [1/2]

Node::vector_shared_ptr MoReFEM::NodeBearer::GetNodeList ( const Unknown & unknown,
const std::string & shape_function_label ) const

Returns the list of Node matching the given unknown and shape_function_label.

[internal] This method is expected to be used only in init phase, hence the brutal return by value of a vector. No restriction upon NumberingSubset in purpose; that's the reason ExtendedUnknown is not used. A same Node might be defined upon several NumberingSubset.

Parameters
[in]unknownUnknown for which the list of Node is sought.
[in]shape_function_labelShape function label for which the list of Node is sought.
Returns
List of Node related to unknown.

This method is only called in the initialization phase, and it should remain that way: it involves allocating and fillind a std::vector on the fly.

◆ SetProcessor()

void MoReFEM::NodeBearer::SetProcessor ( std::size_t processor)

Set the processor to which the node bearer belongs to.

Parameters
[in]processorProcessor that handles the current object.

◆ SetGhost()

void MoReFEM::NodeBearer::SetGhost ( const NumberingSubset & numbering_subset,
std::size_t processor )

Specify the NodeBearer is a ghost on processor.

Parameters
[in]processorThe processor on which NodeBearer exists as a ghost.
[in]numbering_subsetNumberingSubset for which current rank is following NodeBearer (there might be several)

◆ Ndof()

std::size_t MoReFEM::NodeBearer::Ndof ( const NumberingSubset & numbering_subset) const

Returns the number of dofs born by the node inside the numbering_subset.

Parameters
[in]numbering_subsetNumberingSubset used as filter.

◆ IsUnknown()

bool MoReFEM::NodeBearer::IsUnknown ( const Unknown & unknown) const

Whether an unknown is present or not.

Parameters
[in]unknownUnknown under test.

◆ SetProgramWiseIndex()

void MoReFEM::NodeBearer::SetProgramWiseIndex ( NodeBearerNS::program_wise_index_type index)

Set the index.

Parameters
[in]indexIndex of the NodeBearer, computed outside the class.

◆ Nnode()

std::size_t MoReFEM::NodeBearer::Nnode ( const Unknown & unknown,
const std::string & shape_function_label ) const

Number of Nodes for a couple Unknown/Shape function label.

Parameters
[in]unknownUnknown used as filter.
[in]shape_function_labelString representing the shape function used as filter.

◆ GetNodeList() [2/2]

Node::vector_shared_ptr MoReFEM::NodeBearer::GetNodeList ( const NumberingSubset & numbering_subset) const
noexcept

Return the list of nodes that match the given NumberingSubset.

Parameters
[in]numbering_subsetOnly consider Node that are in this NumberingSubset.
Returns
The list of Node after filtering.
Attention
This method is not very efficient as it entails a memory allocation - should be performed only during initialization phase.

◆ IsGhost()

bool MoReFEM::NodeBearer::IsGhost ( const Wrappers::Mpi & mpi) const
noexcept

Whether the NodeBearer is a ghost or not.

Attention
This method is intended to be called ONLY once the partitioning is fully done (but if you're not a developer of the library you shouldn't bother as the partitioning occurs during Model::Initialize() or Model::Run() calls which should be one of your very first line of code in the main).

This is actually a simple test upon the processor: if processor is same as rank it is not a ghost.

Parameters
[in]mpiMpi object which knows the rank of the processor, the total number of processors, etc...
Returns
True if the NodeBearer is a ghost of a NodeBearer handled by another mpi rank.

◆ IsInNumberingSubset()

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

Returns whether the NodeBearer is in the numbering_subset.

Parameters
[in]numbering_subsetNumberingSubset used as filter.
Returns
True if one of its Node is in NumberingSubset.

◆ GetGhostProcessorList()

const std::set< std::size_t > & MoReFEM::NodeBearer::GetGhostProcessorList ( const NumberingSubset & numbering_subset) const
noexcept

Returns the list of processors that store the NodeBearer as a ghost.

Parameters
[in]numbering_subsetNumberingSubset for which we want the list of processors that follow current node bearer.
Returns
The list of processors.

◆ ComputeGhostProcessorList()

std::set< std::size_t > MoReFEM::NodeBearer::ComputeGhostProcessorList ( ) const

Compute the list of all processors that track current NodeBearer.

Returns
List of processors.

◆ IsGhosted()

bool MoReFEM::NodeBearer::IsGhosted ( const NumberingSubset & numbering_subset) const
noexcept

Whether there are other processors that ghost the NodeBearer.

Parameters
[in]numbering_subsetNumberingSubset for which we want the information.
Returns
True if there is at least one.

◆ AddNode()

Node::shared_ptr MoReFEM::NodeBearer::AddNode ( const ExtendedUnknown & extended_unknown,
std::size_t Ndof )
private

Add a new node.

[internal] It is assumed here the node does not exist yet; such liabilities are handled by the class in charge of actually calling such methods (MatchInterfaceNodeBearer).

Parameters
[in]extended_unknownCouple Unknown / Numbering subset for which the node is/are created.
[in]NdofNumber of dofs to create on the node.
Returns
Node newly created.

Field Documentation

◆ program_wise_index_

::MoReFEM::NodeBearerNS::program_wise_index_type MoReFEM::NodeBearer::program_wise_index_
private
Initial value:
=
NumericNS::UninitializedIndex<NodeBearerNS::program_wise_index_type>()

An internal index that is useful during partitioning steps.

◆ processor_

std::size_t MoReFEM::NodeBearer::processor_ = NumericNS::UninitializedIndex<std::size_t>()
private

Processor that holds the node.

Once data have been reduced to processor wise, this data might still be useful: ghost nodes keep existing!


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