The Kernel Class

The kernel class provides a convenient way to specify integral operators in classical potential theory. The kernel object has several attributes including parameters required to define the kernel, the type of singularity for determining the quadrature to be used, function handles for evaluating the kernel, and fast multipole method (FMM) acceleration routines if available.

The constructor for the kernel objects take the form

kernel('PDE name', 'kernel name', varargin)

The kernel class documentation lists the information that can be stored in the object


%KERNEL class which describes an integral kernel, usually
% related to the solution of a partial differential equation (PDE).
%
%   K = KERNEL(NAME, TYPE) constructs a kernel of the specified name and
%   type. The currently supported kernels names and types are:
%
%      NAME                                         TYPE
%      ----                                         ----
%      'laplace'    ('lap', 'l')                    's', 'd', 'sp', 'c'
%      'helmholtz'  ('helm', 'h')                   's', 'd', 'sp', 'dp', 'c'
%                                                   'cp'
%      'helmholtz difference' ('helmdiff', 'hdiff') 's', 'd', 'sp', 'dp'
%      'elasticity' ('elast', 'e')                  's', 'strac', 'd', 'dalt'
%      'stokes'     ('stok', 's')                   'svel', 'spres', 'strac',
%                                                   'dvel', 'dpres', 'dtrac'
%      'zeros'       ('zero','z') 
%      'axis sym helmholtz'                         's' 'd' 'sp' 'c'
%         ('axissymh', 'axissymhelm')
%      'axis sym helmholtz difference'              's' 'd' 'sp' 'dp'
%         ('axissymhdiff', 'axissymhelmdiff') 
%   The types may also be written in longer form, e.g. 'single', 'double',
%   'sprime', 'combined', 'svelocity', 'spressure', 'straction',
%   'dvelocity', 'dpressure', 'dtraction'.
%
%   Some kernels may require extra parameters to be specified, e.g. the
%   Helmholtz wavenumber, combined field parameter, or material parameters.
%   Such parameters should be passed as trailing arguments. For instance,
%   the Helmholtz single-layer kernel with wavenumber ZK can be constructed
%   as KERNEL('helmholtz', 's', ZK).
%
%   The kernel class includes an evaluator, K.eval(s,t), which evaluates
%   the kernel K between sources s and targets t specified in the ptinfo
%   format, i.e. a struct with entries s.r, s.d, s.d2, s.n corresponding to
%   the positions, first and second derivatives, and normals (the latter
%   three being only defined for points on a parameterized curve).
%
%   The kernel class can also be used to store other useful methods and
%   data for working with the kernel in a standardized format. For example,
%   for a kernel K:
%
%      - K.opdims: a 2-vector [m n] specifying the dimensions of the
%        kernel values. K.eval(s,t) is an m x n matrix if s and t are a
%        single source and target, respectively. For scalar kernels,
%        opdims = [1 1].
%
%      - K.fmm: A function handle which calls the FMM for the corresponding
%        kernel. K.fmm(eps, s, t, sigma) evaluates the kernel with density
%        sigma from sources s to targets t with accuracy eps.
%
%      - K.splitinfo, which provides the quantities needed to evaluate
%        integrals using the Helsing-Ojala kernel-split quadrature
%        technique.

The ptinfo format

Built-in Kernels

Chunkie includes built-in kernels that arise in the solution of the following PDEs.

Some common notation used below is that \(x=(x_1,x_2)\) will refer to a “target” location and \(y=(y_1,y_2)\) will refer to a “source location. Likewise, \(n(x)\) refers to the curve normal at the target and \(n(y)\) refers to the normal at the source. The notation \(|x-y|\) denotes the distance between the source and target, i.e.

\[|x-y| = \sqrt{ (x_1-y_1)^2 + (x_2-y_2)^2 } \; .\]

Laplace kernels

The free-space Green’s function for Laplace’s equation in two dimensions, denoted by \(G_{0}(x, y)\), is given by

\[G_{0}(x,y) = -\frac{1}{2\pi} \log |x-y| \,,\]

where \(x=(x_{1},x_{2})\), and \(y=(y_{1},y_{2})\).

The kernel \(S(x,y)=G_0(x,y)\) is the integral kernel for the single layer potential. The double layer kernel is then \(D(x,y) = n(y)\\cdot \\nabla_y G_0(x,y)\). All Laplace integral kernels are derived from these two.

For each of the single layer, double layer, and combined layer (a linear combination of single and double layer), there are also kernels for the normal derivative (with the name “prime”), tangential derivative (with the name “tau”), and the gradient (with the name “grad”) taken at the target location. For a kernel \(K(x,y)\), these are the kernels \(n(x)\\cdot \\nabla_xK(x,y)\), \(\\tau(x)\\cdot \\nabla_x K(x,y)\), and \(\\nabla_x K(x,y)\), respectively.

The PDE name for using Laplace kernels can be ‘Laplace’ or ‘l’. These kernel types can be obtained with either calling sequence below

kern = kernel('l',type)
kern = kernel.lap2d(type)

The documentation of the kernel.lap2d function has details on any expected additional arguments and default values:

%KERNEL.LAP2D   Construct the Laplace kernel.
%   KERNEL.LAP2D('s') or KERNEL.LAP2D('single') constructs the single-layer
%   Laplace kernel.
%
%   KERNEL.LAP2D('d') or KERNEL.LAP2D('double') constructs the double-layer
%   Laplace kernel.
%
%   KERNEL.LAP2D('sp') or KERNEL.LAP2D('sprime') constructs the
%   normal derivative of the single-layer Laplace kernel.
%
%   KERNEL.LAP2D('sg') or KERNEL.LAP2D('sgrad') constructs the
%   gradient of the single-layer Laplace kernel.
%
%   KERNEL.LAP2D('dp') or KERNEL.LAP2D('dprime') constructs the normal
%   derivative of the double-layer Laplace kernel.
%
%   KERNEL.LAP2D('dg') or KERNEL.LAP2D('dgrad') constructs the gradient
%   of the double-layer Laplace kernel.
%
%   KERNEL.LAP2D('c', coefs) or KERNEL.LAP2D('combined', coefs) constructs
%   the combined-layer Laplace kernel with parameter coefs, i.e.,
%   coefs(1)*KERNEL.LAP2D('d') + coefs(2)*KERNEL.LAP2D('s'). If no
%   value of coefs is specified the default is coefs = [1 1]  
%
% See also CHNK.LAP2D.KERN.

Helmholtz kernels

Stokes kernels

Linear elasticity kernels

Defining your own kernel class object

Combining kernel objects

Defining a matrix of kernel objects

Adding and scaling kernel objects