HyperHDG
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t > Class Template Reference

This class is responsible for the mapping of hypernodes to global degrees of freedom. More...

#include <hypernodefactory.hxx>

Public Member Functions

 HyperNodeFactory (const hyNode_index_t n_hyNodes)
 Construct HyperNodeFactory from total number of hypernodes. More...
 
 HyperNodeFactory (const HyperNodeFactory< n_dofs_per_nodeT > &hnf)
 Copy constructot for HypernodeFactory. More...
 
HyperNodeFactory< n_dofs_per_nodeT > & operator= (const HyperNodeFactory< n_dofs_per_nodeT > &other)
 Copy assignment. More...
 
HyperNodeFactory< n_dofs_per_nodeT > & operator= (HyperNodeFactory< n_dofs_per_nodeT > &&other) noexcept
 Move assignment. More...
 
hyNode_index_t n_hyNodes () const
 Returns the total amount of hypernodes in the considered hypergraph. More...
 
template<typename dof_index_t = hyNode_index_t>
dof_index_t n_global_dofs () const
 Returns the total amount of degrees of freedom in the considered hypergraph. More...
 
template<typename SmallVecT >
SmallVecT & get_dof_indices (const hyNode_index_t hyNode_index, SmallVecT &dof_indices) const
 Calculate global indices of degrees of freedom related to a hypernode. More...
 
template<typename dof_index_t >
hyNode_index_t get_hyNode_from_dof_index (const dof_index_t dof_index) const
 Calculate index of hypernode holding a special degree of freedom. More...
 
template<typename dof_index_t = hyNode_index_t, typename SmallVecT , typename LargeVecT >
SmallVecT & get_dof_values (const hyNode_index_t hyNode_index, const LargeVecT &global_dof_vector, SmallVecT &local_dof_values) const
 Evaluate values of degrees of freedom related to a hypernode. More...
 
template<typename dof_index_t = hyNode_index_t, typename SmallVecT , typename LargeVecT >
LargeVecT & add_to_dof_values (const hyNode_index_t hyNode_index, LargeVecT &global_dof_vector, const SmallVecT &local_dof_vector) const
 Add different values to values of degrees of freedom related to a hypernode. More...
 
template<typename dof_index_t = hyNode_index_t, typename SmallVecT , typename LargeVecT >
LargeVecT & set_dof_values (const hyNode_index_t hyNode_index, LargeVecT &global_dof_vector, const SmallVecT &local_dof_vector) const
 Set different values of degrees of freedom related to a hypernode. More...
 
template<typename dof_index_t = hyNode_index_t, typename LargeVecT >
LargeVecT & set_dof_values (const hyNode_index_t hyNode_index, LargeVecT &global_dof_vector, const typename LargeVecT::value_type value) const
 Set all values of degrees of freedom of a hypernode to a predefined value. More...
 

Static Public Member Functions

static constexpr unsigned int n_dofs_per_node ()
 Return the template parameter representing the amount of dofs per node. More...
 

Private Attributes

hyNode_index_t n_hyNodes_
 Amount of hypernodes within hypergraph. More...
 

Detailed Description

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
class HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >

This class is responsible for the mapping of hypernodes to global degrees of freedom.


This class administrates the mapping of topological information (i.e. a hypernode) to information related to the approximation of solutions to PDEs. Thus, it is capable of mapping an hypernode index to the indices and values of degrees of freedom. It is the only class to manage the access to the global vectors comprising degrees of freedom and is universal to (almost) all kinds of possible equations.

Template Parameters
n_dofs_per_nodeTAmount of degrees of freedom associated to an hypernode. This is the number of local trial functions for the skeletal variable.
hyNode_index_tUnsigned integer type specification. Default is unsigned int.
Authors
Andreas Rupp, Heidelberg University, 2019–2020.

Constructor & Destructor Documentation

◆ HyperNodeFactory() [1/2]

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::HyperNodeFactory ( const hyNode_index_t  n_hyNodes)
inline

Construct HyperNodeFactory from total number of hypernodes.


Parameters
n_hyNodesTotal number of hypernodes.

◆ HyperNodeFactory() [2/2]

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::HyperNodeFactory ( const HyperNodeFactory< n_dofs_per_nodeT > &  hnf)
inline

Copy constructot for HypernodeFactory.


Function that evaluates the condensed, matrix-free version of the matrix-vector product \(A x = y\), where \(A\) is the condensed matrix of the LDG-H method, \(x\) is the vector of parameters to define the skeletal variable \(\lambda\), and \(y\) is the resulting vector, which has the same size as the input vector \(x\).

Parameters
hnfA HyperNodeFactory to be copied.

Member Function Documentation

◆ add_to_dof_values()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename dof_index_t = hyNode_index_t, typename SmallVecT , typename LargeVecT >
LargeVecT& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::add_to_dof_values ( const hyNode_index_t  hyNode_index,
LargeVecT &  global_dof_vector,
const SmallVecT &  local_dof_vector 
) const
inline

Add different values to values of degrees of freedom related to a hypernode.


Add local values of the small vector local_dof_vector to the respective values of the large vector global_dof_vector comprising all degrees of freedom.

Template Parameters
dof_index_tUnsigned integer type specification. Default is hyNode_index_t.
SmallVecTThe typename of a small vector to be filled. Needs to provide the operator [] for random access and size().
LargeVecTThe typename of a large vector to be filled. Needs to provide the operator [] for random access and size().
Parameters
hyNode_indexIndex of the considered hypernode.
global_dof_vectorLarge vector containing the values of all degrees of freedom.
local_dof_vectorSmall vector containing the local values to be added to the global ones.
Return values
global_dof_vectorLarge vector containing the values of all degrees of freedom.

◆ get_dof_indices()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename SmallVecT >
SmallVecT& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::get_dof_indices ( const hyNode_index_t  hyNode_index,
SmallVecT &  dof_indices 
) const
inline

Calculate global indices of degrees of freedom related to a hypernode.


Template Parameters
SmallVecTThe typename of a small vector to be filled. Needs to provide the operator [] for random access and sizes().
Parameters
hyNode_indexIndex of the considered hypernode.
dof_indicesReference to small vector to be filled.
Return values
dof_indicesReference to small vector containing the global indices of related degrees of freedom.

◆ get_dof_values()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename dof_index_t = hyNode_index_t, typename SmallVecT , typename LargeVecT >
SmallVecT& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::get_dof_values ( const hyNode_index_t  hyNode_index,
const LargeVecT &  global_dof_vector,
SmallVecT &  local_dof_values 
) const
inline

Evaluate values of degrees of freedom related to a hypernode.


Template Parameters
dof_index_tUnsigned integer type specification. Default is hyNode_index_t.
SmallVecTThe typename of a small vector to be filled. Needs to provide the operator [] for random access and size().
LargeVecTThe typename of a large vector to be filled. Needs to provide the operator [] for random access and size().
Parameters
hyNode_indexIndex of the considered hypernode.
global_dof_vectorGlobal vector of degrees of freedom.
local_dof_valuesReference to small vector to be filled.
Return values
local_dof_valuesReference to small vector containing the values of related degrees of freedom.

◆ get_hyNode_from_dof_index()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename dof_index_t >
hyNode_index_t HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::get_hyNode_from_dof_index ( const dof_index_t  dof_index) const
inline

Calculate index of hypernode holding a special degree of freedom.


Template Parameters
dof_index_tUnsigned integer type specification. Default is unsigned int.
Parameters
dof_indexGlobal index of related degree of freedom.
Return values
hyNode_indexIndex of the considered hypernode.

◆ n_dofs_per_node()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
static constexpr unsigned int HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::n_dofs_per_node ( )
inlinestaticconstexpr

Return the template parameter representing the amount of dofs per node.


Return values
n_dofs_per_nodeThe amount of degrees of freedom per node.

◆ n_global_dofs()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename dof_index_t = hyNode_index_t>
dof_index_t HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::n_global_dofs ( ) const
inline

Returns the total amount of degrees of freedom in the considered hypergraph.


Template Parameters
dof_index_tUnsigned integer type specification. Default is hyNode_index_t.
Return values
n_global_dofsThe total amount of degreees of freedom in the considered hypergraph.

◆ n_hyNodes()

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
hyNode_index_t HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::n_hyNodes ( ) const
inline

Returns the total amount of hypernodes in the considered hypergraph.


Return values
n_hypernodesThe total amount of hypernodes in the considered hypergraph.

◆ operator=() [1/2]

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
HyperNodeFactory<n_dofs_per_nodeT>& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::operator= ( const HyperNodeFactory< n_dofs_per_nodeT > &  other)
inline

Copy assignment.


◆ operator=() [2/2]

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
HyperNodeFactory<n_dofs_per_nodeT>& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::operator= ( HyperNodeFactory< n_dofs_per_nodeT > &&  other)
inlinenoexcept

Move assignment.


◆ set_dof_values() [1/2]

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename dof_index_t = hyNode_index_t, typename SmallVecT , typename LargeVecT >
LargeVecT& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::set_dof_values ( const hyNode_index_t  hyNode_index,
LargeVecT &  global_dof_vector,
const SmallVecT &  local_dof_vector 
) const
inline

Set different values of degrees of freedom related to a hypernode.


Set local values of the std::array local_dof_vector as the respective values of the std::vector global_dof_vector comprising all degrees of freedom.

Template Parameters
dof_index_tUnsigned integer type specification. Default is hyNode_index_t.
SmallVecTThe typename of a small vector to be filled. Needs to provide the operator [] for random access and size().
LargeVecTThe typename of a large vector to be filled. Needs to provide the operator [] for random access and size().
Parameters
hyNode_indexIndex of the considered hypernode.
global_dof_vectorLarge vector containing the values of all degrees of freedom.
local_dof_vectorSmall vector containing the local values to be set at the global ones.
Return values
global_dof_vectorLarge vector containing the values of all degrees of freedom.

◆ set_dof_values() [2/2]

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
template<typename dof_index_t = hyNode_index_t, typename LargeVecT >
LargeVecT& HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::set_dof_values ( const hyNode_index_t  hyNode_index,
LargeVecT &  global_dof_vector,
const typename LargeVecT::value_type  value 
) const
inline

Set all values of degrees of freedom of a hypernode to a predefined value.


Template Parameters
dof_index_tUnsigned integer type specification. Default is hyNode_index_t.
LargeVecTThe typename of a large vector to be filled. Needs to provide the operator [] for random access and size().
Parameters
hyNode_indexIndex of the considered hypernode.
global_dof_vectorLarge vector containing the values of all degrees of freedom.
valueThe future value of related degrees of freedom.
Return values
global_dof_vectorLarge vector containing the values of all degrees of freedom.

Member Data Documentation

◆ n_hyNodes_

template<unsigned int n_dofs_per_nodeT, typename hyNode_index_t = unsigned int>
hyNode_index_t HyperNodeFactory< n_dofs_per_nodeT, hyNode_index_t >::n_hyNodes_
private

Amount of hypernodes within hypergraph.


The number of hypernodes within the considered hypergraph is needed to construct vectors of the correct size, to check whether a vector has the appropriate size, and to check whether a degree of freedom has a valid index.


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