NiHu  2.0
NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L > Class Template Reference

Matrix representation of the FMM method. More...

#include <fmm_matrix.hpp>

Public Types

typedef std::decay< P2P >::type p2p_t
 
typedef std::decay< P2M >::type p2m_t
 
typedef std::decay< P2L >::type p2l_t
 
typedef std::decay< M2P >::type m2p_t
 
typedef std::decay< L2P >::type l2p_t
 
typedef std::decay< M2M >::type m2m_t
 
typedef std::decay< L2L >::type l2l_t
 
typedef std::decay< M2L >::type m2l_t
 
typedef m2l_t::cluster_t cluster_t
 
typedef cluster_t::multipole_t multipole_t
 
typedef cluster_t::local_t local_t
 
typedef p2p_t::sparse_t sparse_t
 
typedef scalar< sparse_t >::type scalar_t
 
typedef Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > excitation_t
 
typedef Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > response_t
 
typedef cluster_tree< cluster_t > cluster_tree_t
 

Public Member Functions

 fmm_matrix (P2P &&p2p, P2M &&p2m, P2L &&p2l, M2P &&m2p, L2P &&l2p, M2M &&m2m, L2L &&l2l, M2L &&m2l, cluster_tree_t const &tree, interaction_lists const &lists)
 constructor from operator instances More...
 
void set_cut_ratio (double cut_ratio)
 set the cut ratio More...
 
double get_cut_ratio () const
 return the cut ratio More...
 
size_t get_dfs_cut_level () const
 determine cut level between bfs and dfs traverse sections More...
 
size_t rows () const
 return number of rows of the matrix More...
 
size_t cols () const
 return number of columns of the matrix More...
 
template<class RhsDerived >
void reorder_excitation (Eigen::MatrixBase< RhsDerived > const &rhs)
 cluster-continuous reordering of the excitation data More...
 
void upward_pass_dfs_rec (std::vector< multipole_t > &multipoles, size_t root)
 recursive depth first search single thread upward pass More...
 
void downward_pass_dfs_rec (std::vector< local_t > &locals, std::vector< multipole_t > const &multipoles, size_t to)
 recursive depth first search single thread downward pass More...
 
void upward_pass_dfs (std::vector< multipole_t > &multipoles)
 depth first search upward pass More...
 
void downward_pass_dfs (std::vector< local_t > &locals, std::vector< multipole_t > const &multipoles)
 
void upward_pass_bfs (std::vector< multipole_t > &multipoles)
 
void upward_pass_bfs (std::vector< multipole_t > &multipoles, size_t lowest_to_level)
 
void downward_pass_bfs (std::vector< local_t > &locals, std::vector< multipole_t > const &multipoles)
 
void downward_pass_bfs (std::vector< local_t > &locals, std::vector< multipole_t > const &multipoles, size_t max_to_level)
 
template<class Derived >
void reorder_response (Eigen::MatrixBase< Derived > &lhs) const
 cluster-continuous inverse-reordering of the response data More...
 
template<class ExcType >
response_t operator* (ExcType const &rhs)
 matrix vector multiplication More...
 
const fmm_timerget_timer () const
 
fmm_timerget_timer ()
 
Eigen::Matrix< scalar_t, Eigen::Dynamic, 1 > get_diagonal () const
 return the diagonal of the matrix ins a single column vector More...
 

Static Public Attributes

static const size_t num_dof_per_src = p2p_t::num_dof_per_src
 number of DOF for a source node in the mesh
 
static const size_t num_dof_per_rec = p2p_t::num_dof_per_rec
 number of DOF for a receiver node in the mesh
 

Detailed Description

template<class P2P, class P2M, class P2L, class M2P, class L2P, class M2M, class L2L, class M2L>
class NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >

Matrix representation of the FMM method.

Template Parameters
P2PP2P operator type
P2Mthe P2M operator's type
P2Lthe P2L operator's type
M2Pthe M2P operator's type
L2Pthe L2P operator's type
M2Mthe M2M operator's type
M2Lthe M2L operator's type
L2Lthe L2L operator's type @

Definition at line 69 of file fmm_matrix.hpp.

Constructor & Destructor Documentation

◆ fmm_matrix()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::fmm_matrix ( P2P &&  p2p,
P2M &&  p2m,
P2L &&  p2l,
M2P &&  m2p,
L2P &&  l2p,
M2M &&  m2m,
L2L &&  l2l,
M2L &&  m2l,
cluster_tree_t const &  tree,
interaction_lists const &  lists 
)
inline

constructor from operator instances

Parameters
[in]p2pthe P2P operator
[in]p2mthe P2M operator
[in]p2lthe P2L operator
[in]m2pthe M2P operator
[in]l2pthe L2P operator
[in]m2mthe M2M operator
[in]l2lthe L2L operator
[in]m2lthe M2L operator
[in]treethe cluster tree
[in]liststhe interaction lists

Definition at line 108 of file fmm_matrix.hpp.

Member Function Documentation

◆ cols()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
size_t NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::cols ( ) const
inline

return number of columns of the matrix

Returns
number of columns

Definition at line 191 of file fmm_matrix.hpp.

◆ downward_pass_dfs_rec()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
void NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::downward_pass_dfs_rec ( std::vector< local_t > &  locals,
std::vector< multipole_t > const &  multipoles,
size_t  to 
)
inline

recursive depth first search single thread downward pass

Parameters
[in,out]localsthe vector of local contributions
[in]multipolesthe vector of multipole contributions
[in]toindex of the destination cluster

this function comutes M2L and L2L interactions to the "to" cluster, and calls itself or each child of the "to" cluster recursively

Definition at line 238 of file fmm_matrix.hpp.

◆ get_cut_ratio()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
double NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::get_cut_ratio ( ) const
inline

return the cut ratio

Returns
the cut ratio

the cut ratio is the number of clusters on the cut level divided by the number of threads

Definition at line 156 of file fmm_matrix.hpp.

◆ get_dfs_cut_level()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
size_t NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::get_dfs_cut_level ( ) const
inline

determine cut level between bfs and dfs traverse sections

Returns
the cut level

Definition at line 163 of file fmm_matrix.hpp.

◆ get_diagonal()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
Eigen::Matrix<scalar_t, Eigen::Dynamic, 1> NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::get_diagonal ( ) const
inline

return the diagonal of the matrix ins a single column vector

Returns
the diagonal

Definition at line 588 of file fmm_matrix.hpp.

◆ operator*()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
template<class ExcType >
response_t NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::operator* ( ExcType const &  rhs)
inline

matrix vector multiplication

Parameters
[in]rhsthe excitation vector
Returns
the result of matrix_vector multiplication

Definition at line 404 of file fmm_matrix.hpp.

◆ reorder_excitation()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
template<class RhsDerived >
void NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::reorder_excitation ( Eigen::MatrixBase< RhsDerived > const &  rhs)
inline

cluster-continuous reordering of the excitation data

after reordering, the data associated with a specific cluster can be reached as a continuous block (segment) of the internally stored excitation vector

Parameters
[in]rhsthe right hand side vector

Definition at line 201 of file fmm_matrix.hpp.

◆ reorder_response()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
template<class Derived >
void NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::reorder_response ( Eigen::MatrixBase< Derived > &  lhs) const
inline

cluster-continuous inverse-reordering of the response data

after reordering, the response data contains the response in the same order as defined by the excitation

Parameters
[out]lhsthe response vector

Definition at line 386 of file fmm_matrix.hpp.

◆ rows()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
size_t NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::rows ( ) const
inline

return number of rows of the matrix

Returns
number of rows

Definition at line 184 of file fmm_matrix.hpp.

◆ set_cut_ratio()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
void NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::set_cut_ratio ( double  cut_ratio)
inline

set the cut ratio

Parameters
cut_ratiothe cut ratio to be set

The cut ratio is the number of clusters on the cut level divided by the number of threads

Definition at line 147 of file fmm_matrix.hpp.

◆ upward_pass_dfs()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
void NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::upward_pass_dfs ( std::vector< multipole_t > &  multipoles)
inline

depth first search upward pass

Parameters
[in,out]multipolesthe vector of multipole contributions

Definition at line 256 of file fmm_matrix.hpp.

◆ upward_pass_dfs_rec()

template<class P2P , class P2M , class P2L , class M2P , class L2P , class M2M , class L2L , class M2L >
void NiHu::fmm::fmm_matrix< P2P, P2M, P2L, M2P, L2P, M2M, L2L, M2L >::upward_pass_dfs_rec ( std::vector< multipole_t > &  multipoles,
size_t  root 
)
inline

recursive depth first search single thread upward pass

Parameters
[in,out]multipolesthe vector of multipole contributions
[in]rootindex of the root cluster

this upward pass computes the multipole contribution in the root cluster by recursively evaluating M2M interactions

Definition at line 220 of file fmm_matrix.hpp.


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