Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
6 #ifndef NIHU_CLUSTER_HPP_INCLUDED
7 #define NIHU_CLUSTER_HPP_INCLUDED
32 template <
class Derived>
39 template <
class Derived>
47 static size_t const dimension = traits_t::dimension;
89 m_parent_idx = parent;
121 m_src_node_idx = node_idx;
128 template <
class ForwardIt>
139 return m_src_node_idx;
147 return m_src_node_idx.size();
155 m_rec_node_idx = node_idx;
162 template <
class ForwardIt>
173 return m_rec_node_idx;
181 return m_rec_node_idx.size();
191 if (std::find(m_children_idx.begin(), m_children_idx.end(), child) ==
192 m_children_idx.end())
193 m_children_idx.push_back(child);
194 else throw std::logic_error(
"Child already contained");
202 return m_children_idx;
211 return m_children_idx.empty();
228 return !m_src_node_idx.empty();
237 return !m_rec_node_idx.empty();
245 os <<
"Level:" << this->
get_level() << std::endl;
246 os <<
"Bounding box: " << m_bb << std::endl;
247 std::ostream_iterator<size_t> out_it(os,
", ");
248 os <<
"Source indices:" << std::endl;
251 os <<
"Receiver indices:" << std::endl;
260 return derived().zero_multipole();
268 return derived().zero_local();
286 template <
class Derived>
NIHU_CRTP_HELPERS void set_level(size_t level)
Set cluster's level.
void set_rec_node_idx(idx_list_t const &node_idx)
set indices of receiver nodes
multipole_t zero_multipole() const
return a cleared (zero) multipole contribution
void print_debug(std::ostream &os=std::cout) const
prints debug information of the cluster to an output stream
void set_rec_node_idx(ForwardIt begin, ForwardIt end)
set indices of receiver nodes with range
bounding_box< dimension, double > bounding_box_t
Bounding box type.
std::ostream & operator<<(std::ostream &os, const quadrature_base< Derived > &Q)
print a quadrature into an ouput stream
cvector_t multipole_t
Multipole type.
cvector_t local_t
Local type.
traits_t::local_t local_t
Local type.
std::vector< size_t > idx_list_t
Index list type for storing children and contained nodes.
size_t get_level() const
Get cluster's level.
Implementation of class NiHu::fmm::bounding_box.
Define CRTP helper functions and metafunctions.
void set_src_node_idx(idx_list_t const &node_idx)
set indices of source nodes
bounding_box_t::location_t location_t
Location type.
const idx_list_t & get_src_node_idx() const
get indices of source nodes
size_t get_n_rec_nodes() const
get number of receiver nodes contained in cluster
const idx_list_t & get_children() const
get indices of children
size_t get_n_src_nodes() const
return number of sources contained in cluster
bool is_receiver() const
indicates if cluster is receiver
bool is_leaf() const
indicates if cluster is leaf
Eigen::Matrix< scalar_t, dimension, 1 > location_t
the location type in the bounding box
local_t zero_local() const
return a cleared (zero) local contribution
bool is_root() const
indicates if cluster is root (0-level)
void set_parent_idx(size_t parent)
Set the parent cluster's index.
size_t get_parent_idx() const
return parent cluster's index
static const size_t dimension
Space dimension.
cluster_traits< Derived > traits_t
Traits structure.
CRTP base class of clusters.
const bounding_box_t & get_bounding_box() const
return cluster's bounding box
void set_bounding_box(bounding_box_t const &bb)
set the cluster's bounding box
void add_child(size_t child)
add a new child to a cluster
const idx_list_t & get_rec_node_idx() const
get indices of receiver nodes
bool is_source() const
indicates if cluster is source
#define NIHU_CRTP_HELPERS
define CRTP helper function
traits_t::multipole_t multipole_t
Multipole type.
void set_src_node_idx(ForwardIt begin, ForwardIt end)
set indices of source nodes with range
CRTP traits structure of a cluster.