NiHu  2.0
NiHu::fmm::cluster_base< Derived > Class Template Reference

CRTP base class of clusters. More...

#include <cluster.hpp>

Public Types

typedef cluster_traits< Derived > traits_t
 Traits structure.
 
typedef bounding_box< dimension, double > bounding_box_t
 Bounding box type.
 
typedef bounding_box_t::location_t location_t
 Location type.
 
typedef std::vector< size_t > idx_list_t
 Index list type for storing children and contained nodes.
 
typedef traits_t::multipole_t multipole_t
 Multipole type.
 
typedef traits_t::local_t local_t
 Local type.
 

Public Member Functions

NIHU_CRTP_HELPERS void set_level (size_t level)
 Set cluster's level. More...
 
size_t get_level () const
 Get cluster's level. More...
 
void set_parent (size_t parent)
 Set the parent cluster's index. More...
 
size_t get_parent () const
 return parent cluster's index More...
 
void set_bounding_box (bounding_box_t const &bb)
 set the cluster's bounding box More...
 
const bounding_box_tget_bounding_box () const
 return cluster's bounding box More...
 
void set_src_node_idx (idx_list_t const &node_idx)
 set indices of source nodes More...
 
template<class ForwardIt >
void set_src_node_idx (ForwardIt begin, ForwardIt end)
 set indices of source nodes with range More...
 
const idx_list_tget_src_node_idx () const
 get indices of source nodes More...
 
size_t get_n_src_nodes () const
 return number of sources contained in cluster More...
 
void set_rec_node_idx (idx_list_t const &node_idx)
 set indices of receiver nodes More...
 
template<class ForwardIt >
void set_rec_node_idx (ForwardIt begin, ForwardIt end)
 set indices of receiver nodes with range More...
 
const idx_list_tget_rec_node_idx () const
 get indices of receiver nodes More...
 
size_t get_n_rec_nodes () const
 get number of receiver nodes contained in cluster More...
 
void add_child (size_t child)
 add a new child to a cluster More...
 
const idx_list_tget_children () const
 get indices of children More...
 
bool is_leaf () const
 indicates if cluster is leaf More...
 
bool is_root () const
 indicates if cluster is root (0-level) More...
 
bool is_source () const
 indicates if cluster is source More...
 
bool is_receiver () const
 indicates if cluster is receiver More...
 
void print_debug (std::ostream &os=std::cout) const
 prints debug information of the cluster to an output stream More...
 
multipole_t zero_multipole () const
 return a cleared (zero) multipole contribution More...
 
local_t zero_local () const
 return a cleared (zero) local contribution More...
 

Static Public Attributes

static const size_t dimension = traits_t::dimension
 Space dimension.
 

Detailed Description

template<class Derived>
class NiHu::fmm::cluster_base< Derived >

CRTP base class of clusters.

Template Parameters
DerivedCRTP derived class

Definition at line 40 of file cluster.hpp.

Member Function Documentation

◆ add_child()

template<class Derived >
void NiHu::fmm::cluster_base< Derived >::add_child ( size_t  child)
inline

add a new child to a cluster

Parameters
[in]childthe new child to add

Does not add child if it is already contained

Definition at line 189 of file cluster.hpp.

◆ get_bounding_box()

template<class Derived >
const bounding_box_t& NiHu::fmm::cluster_base< Derived >::get_bounding_box ( ) const
inline

return cluster's bounding box

Returns
the bounding box

Definition at line 111 of file cluster.hpp.

◆ get_children()

template<class Derived >
const idx_list_t& NiHu::fmm::cluster_base< Derived >::get_children ( ) const
inline

get indices of children

Returns
indices of children

Definition at line 200 of file cluster.hpp.

◆ get_level()

template<class Derived >
size_t NiHu::fmm::cluster_base< Derived >::get_level ( ) const
inline

Get cluster's level.

Returns
level

Definition at line 78 of file cluster.hpp.

◆ get_n_rec_nodes()

template<class Derived >
size_t NiHu::fmm::cluster_base< Derived >::get_n_rec_nodes ( ) const
inline

get number of receiver nodes contained in cluster

Returns
number of receiver nodes

Definition at line 179 of file cluster.hpp.

◆ get_n_src_nodes()

template<class Derived >
size_t NiHu::fmm::cluster_base< Derived >::get_n_src_nodes ( ) const
inline

return number of sources contained in cluster

Returns
the number of source nodes

Definition at line 145 of file cluster.hpp.

◆ get_parent()

template<class Derived >
size_t NiHu::fmm::cluster_base< Derived >::get_parent ( ) const
inline

return parent cluster's index

Returns
index of parent cluster

Definition at line 95 of file cluster.hpp.

◆ get_rec_node_idx()

template<class Derived >
const idx_list_t& NiHu::fmm::cluster_base< Derived >::get_rec_node_idx ( ) const
inline

get indices of receiver nodes

Returns
indices of receiver nodes

Definition at line 171 of file cluster.hpp.

◆ get_src_node_idx()

template<class Derived >
const idx_list_t& NiHu::fmm::cluster_base< Derived >::get_src_node_idx ( ) const
inline

get indices of source nodes

Returns
indices of source nodes

Definition at line 137 of file cluster.hpp.

◆ is_leaf()

template<class Derived >
bool NiHu::fmm::cluster_base< Derived >::is_leaf ( ) const
inline

indicates if cluster is leaf

Returns
true if cluster is leaf The cluster is leaf if it does not have children

Definition at line 209 of file cluster.hpp.

◆ is_receiver()

template<class Derived >
bool NiHu::fmm::cluster_base< Derived >::is_receiver ( ) const
inline

indicates if cluster is receiver

Returns
true if cluster is receiver The cluster is receiver if its receiver indices is not empty

Definition at line 235 of file cluster.hpp.

◆ is_root()

template<class Derived >
bool NiHu::fmm::cluster_base< Derived >::is_root ( ) const
inline

indicates if cluster is root (0-level)

Returns
true if cluster is root

Definition at line 217 of file cluster.hpp.

◆ is_source()

template<class Derived >
bool NiHu::fmm::cluster_base< Derived >::is_source ( ) const
inline

indicates if cluster is source

Returns
true if cluster is source The cluster is source if its source indices is not empty

Definition at line 226 of file cluster.hpp.

◆ print_debug()

template<class Derived >
void NiHu::fmm::cluster_base< Derived >::print_debug ( std::ostream &  os = std::cout) const
inline

prints debug information of the cluster to an output stream

Parameters
[in]osthe output stream

Definition at line 243 of file cluster.hpp.

◆ set_bounding_box()

template<class Derived >
void NiHu::fmm::cluster_base< Derived >::set_bounding_box ( bounding_box_t const &  bb)
inline

set the cluster's bounding box

Parameters
[in]bbthe bounding box

Definition at line 103 of file cluster.hpp.

◆ set_level()

template<class Derived >
NIHU_CRTP_HELPERS void NiHu::fmm::cluster_base< Derived >::set_level ( size_t  level)
inline

Set cluster's level.

Parameters
[in]level

Definition at line 69 of file cluster.hpp.

◆ set_parent()

template<class Derived >
void NiHu::fmm::cluster_base< Derived >::set_parent ( size_t  parent)
inline

Set the parent cluster's index.

Parameters
[in]parentthe parent cluster's index

Definition at line 87 of file cluster.hpp.

◆ set_rec_node_idx() [1/2]

template<class Derived >
template<class ForwardIt >
void NiHu::fmm::cluster_base< Derived >::set_rec_node_idx ( ForwardIt  begin,
ForwardIt  end 
)
inline

set indices of receiver nodes with range

Parameters
[in]beginbegin iterator
[in]endend iterator

Definition at line 163 of file cluster.hpp.

◆ set_rec_node_idx() [2/2]

template<class Derived >
void NiHu::fmm::cluster_base< Derived >::set_rec_node_idx ( idx_list_t const &  node_idx)
inline

set indices of receiver nodes

Parameters
[in]node_idxindices of receiver nodes

Definition at line 153 of file cluster.hpp.

◆ set_src_node_idx() [1/2]

template<class Derived >
template<class ForwardIt >
void NiHu::fmm::cluster_base< Derived >::set_src_node_idx ( ForwardIt  begin,
ForwardIt  end 
)
inline

set indices of source nodes with range

Parameters
[in]beginbegin iterator
[in]endend iterator

Definition at line 129 of file cluster.hpp.

◆ set_src_node_idx() [2/2]

template<class Derived >
void NiHu::fmm::cluster_base< Derived >::set_src_node_idx ( idx_list_t const &  node_idx)
inline

set indices of source nodes

Parameters
[in]node_idxindices of source nodes

Definition at line 119 of file cluster.hpp.

◆ zero_local()

template<class Derived >
local_t NiHu::fmm::cluster_base< Derived >::zero_local ( ) const
inline

return a cleared (zero) local contribution

Returns
a zero local contribution

Definition at line 266 of file cluster.hpp.

◆ zero_multipole()

template<class Derived >
multipole_t NiHu::fmm::cluster_base< Derived >::zero_multipole ( ) const
inline

return a cleared (zero) multipole contribution

Returns
a zero multipole contribution

Definition at line 258 of file cluster.hpp.


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