Multiscale Universal Interface  2.0
A Concurrent Framework for Coupling Heterogeneous Solvers
mui::sampler_rbf< CONFIG, O_TP, I_TP > Class Template Reference

#include <sampler_rbf.h>

Collaboration diagram for mui::sampler_rbf< CONFIG, O_TP, I_TP >:

Public Types

using OTYPE = O_TP
 
using ITYPE = I_TP
 
using REAL = typename CONFIG::REAL
 
using INT = typename CONFIG::INT
 
using point_type = typename CONFIG::point_type
 
using EXCEPTION = typename CONFIG::EXCEPTION
 

Public Member Functions

 sampler_rbf (REAL r, const std::vector< point_type > &pts, INT basisFunc=0, bool conservative=false, bool smoothFunc=false, bool generateMatrix=true, const std::string &writeFileAddress=std::string(), REAL cutOff=1e-9, REAL cgSolveTol=1e-6, INT cgMaxIter=0, INT pouSize=50, INT precond=1, MPI_Comm local_comm=MPI_COMM_NULL)
 
template<template< typename, typename > class CONTAINER>
OTYPE filter (point_type focus, const CONTAINER< ITYPE, CONFIG > &data_points) const
 
geometry::any_shape< CONFIG > support (point_type focus, REAL domain_mag) const
 
void preSetFetchPoints (std::vector< point_type > &pts)
 
void preSetFetchPointsExtend (std::vector< point_type > &pts)
 
void addFetchPoint (point_type pt)
 
void addFetchPointExtend (point_type pt)
 
void addFetchPointGhost (point_type pt)
 
void readRBFMatrix (const std::string &readFileAddress) const
 
std::pair< point_type, point_typelocalBoundingBox (const std::vector< point_type > pt) const
 
std::pair< point_type, point_typelocalExtendBoundingBox (std::pair< point_type, point_type > lbb, REAL r) const
 
std::pair< std::vector< std::pair< INT, INT > >, std::vector< std::pair< INT, std::vector< point_type > > > > getGhostPointsToSend (std::pair< point_type, point_type > lbbExtend, MPI_Comm local_world, int local_rank, int local_size) const
 
std::vector< point_typedistributeGhostPoints (std::vector< std::pair< INT, INT >> ghostPointsCountToSend, std::vector< std::pair< INT, std::vector< point_type >>> ghostPointsToSend, MPI_Comm local_world, int local_rank) const
 
void facilitateGhostPoints () const
 

Static Public Attributes

static const bool QUIET = CONFIG::QUIET
 
static const bool DEBUG = CONFIG::DEBUG
 

Protected Attributes

REAL r_
 
const std::vector< point_typepts_
 
const INT basisFunc_
 
const bool conservative_
 
const bool consistent_
 
const bool smoothFunc_
 
const bool generateMatrix_
 
const std::string writeFileAddress_
 
INT precond_
 
bool initialised_
 
MPI_Comm local_mpi_comm_world_
 
INT CABrow_
 
INT CABcol_
 
INT Hrow_
 
INT Hcol_
 
bool pouEnabled_
 
REAL cgSolveTol_
 
INT cgMaxIter_
 
size_t N_sp_
 
size_t M_ap_
 
int local_rank_
 
int local_size_
 
REAL twor_
 
REAL s_
 
INT CAArow_
 
INT CAAcol_
 
INT remote_pts_num_
 
INT remote_pts_dim_
 
std::vector< point_typeptsGhost_
 
std::vector< point_typeptsExtend_
 
std::vector< std::vector< INT > > connectivityAB_
 
std::vector< std::vector< INT > > connectivityAA_
 
linalg::sparse_matrix< INT, REALH_
 
linalg::sparse_matrix< INT, REALH_toSmooth_
 
std::vector< point_typeremote_pts_
 

Member Typedef Documentation

◆ EXCEPTION

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
using mui::sampler_rbf< CONFIG, O_TP, I_TP >::EXCEPTION = typename CONFIG::EXCEPTION

◆ INT

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
using mui::sampler_rbf< CONFIG, O_TP, I_TP >::INT = typename CONFIG::INT

◆ ITYPE

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
using mui::sampler_rbf< CONFIG, O_TP, I_TP >::ITYPE = I_TP

◆ OTYPE

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
using mui::sampler_rbf< CONFIG, O_TP, I_TP >::OTYPE = O_TP

◆ point_type

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
using mui::sampler_rbf< CONFIG, O_TP, I_TP >::point_type = typename CONFIG::point_type

◆ REAL

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
using mui::sampler_rbf< CONFIG, O_TP, I_TP >::REAL = typename CONFIG::REAL

Constructor & Destructor Documentation

◆ sampler_rbf()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
mui::sampler_rbf< CONFIG, O_TP, I_TP >::sampler_rbf ( REAL  r,
const std::vector< point_type > &  pts,
INT  basisFunc = 0,
bool  conservative = false,
bool  smoothFunc = false,
bool  generateMatrix = true,
const std::string &  writeFileAddress = std::string(),
REAL  cutOff = 1e-9,
REAL  cgSolveTol = 1e-6,
INT  cgMaxIter = 0,
INT  pouSize = 50,
INT  precond = 1,
MPI_Comm  local_comm = MPI_COMM_NULL 
)
inline

Input parameters:

  1. REAL r: The search radius used to construct each RBF
  2. std::vector<point_type>& pts: Vector of points that pre-set for RBF interpolation
  3. INT basisFunc: Parameter for basis function selection. Implemented functions are as follows: Gaussian(default): basisFunc_=0 Wendland's C0: basisFunc_=1 Wendland's C2: basisFunc_=2 Wendland's C4: basisFunc_=3 Wendland's C6: basisFunc_=4
  4. bool conservative: Switch for the mode of RBF interpolation: consistent mode(default): conservative=false conservative mode: conservative=true
  5. bool smoothFunc: Switch for the smoothing function of the transformation matrix: without smoothing function(default): smoothFunc=false with smoothing function: smoothFunc=true
  6. bool generateMatrix: Switch for whether to generate the transformation matrix: Don't generate the matrix (readRBFMatrix() should be used): generateMatrix=false Generate the matrix: generateMatrix=true
  7. const std::string& writeFileAddress: The address that the transformation matrix I/O uses. The default value of is an empty string - empty means no files will be written. The directory will be created on object construction if it doesn't already exist.
  8. REAL cutOff: Parameter to set the cut-off of the Gaussian basis function (only valid for basisFunc_=0). The default value of cutoff is 1e-9
  9. REAL cgSolveTol: The tolerance used to determine convergence for the ConjugateGradient solver The default value of cgSolveTol is 1e-6
  10. INT cgMaxIter: The maximum number of iterations each Eigen ConjugateGradient solve can take The default value of cgMaxIter is 0, which means the solver decides
  11. INT pouSize: The size of each partition used within the RBF-POU approach The default value of pouSize is 50, setting to 0 disables the partitioned approach
  12. INT precond: The Preconditioner of the Conjugate Gradient solver. Implemented as follows: No Preconditioner: precond_=0 Diagonal Preconditioner (default): precond_=1
  13. MPI_Comm local_comm: The MPI communicator from the local application. Used for ghost cell construction. The default value of local_comm is MPI_COMM_NULL, i.e. no MPI communicator.

Member Function Documentation

◆ addFetchPoint()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::addFetchPoint ( point_type  pt)
inline

◆ addFetchPointExtend()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::addFetchPointExtend ( point_type  pt)
inline

◆ addFetchPointGhost()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::addFetchPointGhost ( point_type  pt)
inline

◆ distributeGhostPoints()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::vector<point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::distributeGhostPoints ( std::vector< std::pair< INT, INT >>  ghostPointsCountToSend,
std::vector< std::pair< INT, std::vector< point_type >>>  ghostPointsToSend,
MPI_Comm  local_world,
int  local_rank 
) const
inline

◆ facilitateGhostPoints()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::facilitateGhostPoints ( ) const
inline

◆ filter()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
template<template< typename, typename > class CONTAINER>
OTYPE mui::sampler_rbf< CONFIG, O_TP, I_TP >::filter ( point_type  focus,
const CONTAINER< ITYPE, CONFIG > &  data_points 
) const
inline

Check whether the order of the remote points coincides with the order when generating the coupling matrix [H] and fix it if not. This check and fix is essential in the parallel condition as the order of the remote point will randomly mixed at the partition boundary and the result will show an randomly oscillating behaviour. The below code will ensure a correct match between the remote point and corresponding coupling matrix element.

◆ getGhostPointsToSend()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::pair<std::vector<std::pair<INT, INT> >, std::vector<std::pair<INT, std::vector<point_type> > > > mui::sampler_rbf< CONFIG, O_TP, I_TP >::getGhostPointsToSend ( std::pair< point_type, point_type lbbExtend,
MPI_Comm  local_world,
int  local_rank,
int  local_size 
) const
inline

◆ localBoundingBox()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::pair<point_type, point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::localBoundingBox ( const std::vector< point_type pt) const
inline

◆ localExtendBoundingBox()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::pair<point_type, point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::localExtendBoundingBox ( std::pair< point_type, point_type lbb,
REAL  r 
) const
inline

◆ preSetFetchPoints()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::preSetFetchPoints ( std::vector< point_type > &  pts)
inline

◆ preSetFetchPointsExtend()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::preSetFetchPointsExtend ( std::vector< point_type > &  pts)
inline

◆ readRBFMatrix()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
void mui::sampler_rbf< CONFIG, O_TP, I_TP >::readRBFMatrix ( const std::string &  readFileAddress) const
inline

◆ support()

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
geometry::any_shape<CONFIG> mui::sampler_rbf< CONFIG, O_TP, I_TP >::support ( point_type  focus,
REAL  domain_mag 
) const
inline

Member Data Documentation

◆ basisFunc_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::basisFunc_
protected

◆ CAAcol_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::CAAcol_
mutableprotected

◆ CAArow_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::CAArow_
mutableprotected

◆ CABcol_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::CABcol_
mutableprotected

◆ CABrow_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::CABrow_
mutableprotected

◆ cgMaxIter_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::cgMaxIter_
protected

◆ cgSolveTol_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
REAL mui::sampler_rbf< CONFIG, O_TP, I_TP >::cgSolveTol_
protected

◆ connectivityAA_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::vector<std::vector<INT> > mui::sampler_rbf< CONFIG, O_TP, I_TP >::connectivityAA_
mutableprotected

◆ connectivityAB_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::vector<std::vector<INT> > mui::sampler_rbf< CONFIG, O_TP, I_TP >::connectivityAB_
mutableprotected

◆ conservative_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::conservative_
protected

◆ consistent_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::consistent_
protected

◆ DEBUG

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::DEBUG = CONFIG::DEBUG
static

◆ generateMatrix_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::generateMatrix_
protected

◆ H_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
linalg::sparse_matrix<INT, REAL> mui::sampler_rbf< CONFIG, O_TP, I_TP >::H_
mutableprotected

◆ H_toSmooth_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
linalg::sparse_matrix<INT, REAL> mui::sampler_rbf< CONFIG, O_TP, I_TP >::H_toSmooth_
mutableprotected

◆ Hcol_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::Hcol_
mutableprotected

◆ Hrow_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::Hrow_
mutableprotected

◆ initialised_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::initialised_
mutableprotected

◆ local_mpi_comm_world_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
MPI_Comm mui::sampler_rbf< CONFIG, O_TP, I_TP >::local_mpi_comm_world_
protected

◆ local_rank_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
int mui::sampler_rbf< CONFIG, O_TP, I_TP >::local_rank_
protected

◆ local_size_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
int mui::sampler_rbf< CONFIG, O_TP, I_TP >::local_size_
protected

◆ M_ap_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
size_t mui::sampler_rbf< CONFIG, O_TP, I_TP >::M_ap_
mutableprotected

◆ N_sp_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
size_t mui::sampler_rbf< CONFIG, O_TP, I_TP >::N_sp_
mutableprotected

◆ pouEnabled_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::pouEnabled_
protected

◆ precond_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::precond_
protected

◆ pts_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const std::vector<point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::pts_
protected

◆ ptsExtend_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::vector<point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::ptsExtend_
mutableprotected

◆ ptsGhost_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::vector<point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::ptsGhost_
mutableprotected

◆ QUIET

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::QUIET = CONFIG::QUIET
static

◆ r_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
REAL mui::sampler_rbf< CONFIG, O_TP, I_TP >::r_
protected

◆ remote_pts_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
std::vector<point_type> mui::sampler_rbf< CONFIG, O_TP, I_TP >::remote_pts_
mutableprotected

◆ remote_pts_dim_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::remote_pts_dim_
mutableprotected

◆ remote_pts_num_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
INT mui::sampler_rbf< CONFIG, O_TP, I_TP >::remote_pts_num_
mutableprotected

◆ s_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
REAL mui::sampler_rbf< CONFIG, O_TP, I_TP >::s_
protected

◆ smoothFunc_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const bool mui::sampler_rbf< CONFIG, O_TP, I_TP >::smoothFunc_
protected

◆ twor_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
REAL mui::sampler_rbf< CONFIG, O_TP, I_TP >::twor_
protected

◆ writeFileAddress_

template<typename CONFIG = default_config, typename O_TP = typename CONFIG::REAL, typename I_TP = O_TP>
const std::string mui::sampler_rbf< CONFIG, O_TP, I_TP >::writeFileAddress_
protected

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