Aboria

PrevUpHomeNext

Function template create_sparse_operator

Aboria::create_sparse_operator — creates a sparse matrix-free linear operator for use with Eigen

Synopsis

// In header: </home/travis/build/martinjrobins/Aboria/src/Operators.h>


template<typename RowParticles, typename ColParticles, typename FRadius, 
         typename F, 
         typename Kernel = KernelSparse<RowParticles, ColParticles, FRadius, F>, 
         typename Operator = MatrixReplacement<1, 1, std::tuple<Kernel>>, 
         typename  = typename std::enable_if<!std::is_arithmetic<FRadius>::value>::type> 
  Operator create_sparse_operator(const RowParticles & row_particles, 
                                  const ColParticles & col_particles, 
                                  const FRadius & radius_function, 
                                  const F & function);

Description

This function returns a MatrixReplacement object that acts like a sparse linear operator (i.e. matrix) in Eigen, in that only particle pairs (i.e. a row/column pair) with a separation less that a given value are considered to be non-zero

Parameters:

col_particles

The columns of the linear operator index this first particle set

function

A function object that returns the value of the operator for a given particle pair

radius_function

A function object that takes a const_reference to a particle and returns a double value. It is assumed that function returns a zero value for all particle pairs with a separation greater than this value

row_particles

The rows of the linear operator index this first particle set

Template Parameters:

ColParticles

The type of the column particle set

F

The type of the function object

RowParticles

The type of the row particle set


PrevUpHomeNext