Solvers and evaluators

In MATLAB, there is a guru solver (solver) routine, and an evaluator routine (eval_fields).

The solvers, and evaluators can also be accessed using <pde>.solver or <pde>.<bc>.solver, and <pde>.eval or <pde>.<bc>.eval respectively. For example, for the Helmholtz Dirichlet solver, you can use solver or helm3d.solver or helm3d.dirichlet.solver. Similarly, for the Laplace Neumann post-processor, you can use eval_fields or lap3d.eval or lap3d.neumann.solver.

  • <pde>: partial differential equation being solved

    • lap3d: Laplace solvers

    • helm3d: Helmholtz solvers

    • stok3d: Stokes solvers

    • em3d: Maxwell solvers

  • <bc>: boundary condition

    • dirichlet: Dirichlet boundary conditions (available with lap3d, and helm3d)

    • neumann: Neumann boundary conditions (available with lap3d, and helm3d)

    • impedance: Impedance boundary conditions (available with helm3d)

    • transmission: Transmission boundary conditions (available with helm3d)

    • velocity: Velocity boundary conditions (available with stok3d)

    • pec: Perfect electric condudctor boundary conditions (available with em3d)

solver

The following boundary value problems can be solved using the solver function:

function [densities, varargout] = solver(S, pde, bc, rhs, eps, varargin)
%SOLVER  Solve elliptic PDE using boundary integral equations.
%
%  densities = solver(S, pde, bc, rhs, eps, opts). Currently supported
%  combination solvers for pde and bc are
%
%      pde                               bc
%      ---                               --
%      
%      'laplace' ('lap', 'l')            'dir', 'neu'
%      'helmholtz' ('helm', 'h')         'dir', 'neu', 'imp', 'trans'
%      'stokes' ('stok', 's')            'vel'
%      'maxwell' ('em', 'm')             'pec'
%
%  The boundary conditions may also be written in longer form, e.g.
%    'dirichlet', 'neumann', 'impedance', 'velocity',
%    'perfect electric conductor'
%  
%  Different solvers require different parameters to be specified. 
%  Such parameters should be passed as trailing arguments.
%  For example, the Laplace Dirichlet, and Stokes velocity boundary
%  value problems require a double array of size 2 which determines
%  the strength of the single and double layer potentials in the
%  representation. 
%
%  Similarly, the helmholtz, and maxwell representations, require
%  a complex array, which includes the wavenumber as the first
%  parameter, and other parameters specific to the representation.
%  
%  The right hand side (rhs) for the solver is also dependent on
%  the pde being solved. For Laplace problems, the right hand side
%  must be a double array of size (S.npts,1) 
%
%  For Stokes boundary value problems, the data must be (3, S.npts)
%  i.e. the cartesian components of the velocity on the boundary
%
%  For Helmholtz Dirichlet, Neumann, and Impedance problems, the
%  data must be a complex array of size (S.npts,1)
%
%  For the Helmholtz tranmssion problem, the data must be a
%  complex array of size (2, S.npts), the first component
%  corresponds to the Dirichlet data, and the second
%  component corresponds to the Neumann data.
%
%  And finally, for Maxwell boundary value problems, the data
%  must be a complex array of size (6, S.npts), where
%  (1:3, :) are the cartesian components of the incident electric
%  field, and (4:6, :) are the cartesian components of the incident
%  magnetic fields
%
%  The output densities is an array of size (nd, S.npts) 
%  which correspond to the densities on surface if nd > 1, and
%  of size (S.npts,1) if nd == 1.
%
%  SEE ALSO: lap3d.solver, helm3d.solver, stok3d.solver, and em3d.solver
%

eval_fields

The following integral representations can be evaluated using the eval_fields function:

function [varargout] = eval_fields(S, pde, bc, densities, targinfo, eps, varargin)
%
%EVALUATE_FIELDS: Evaluate the fields for solution from integral equation 
%  
%  Syntax
%    p = eval_fields(S, pde, bc, densities, targinfo, eps, varargin) 
%    [E, H] = eval_fields(S, pde, bc, densities, targinfo, eps, varargin) 
%
%  Currently supported
%  combination solvers for pde and bc are
%
%      pde                               bc
%      ---                               --
%      
%      'laplace' ('lap', 'l')            'dir', 'neu'
%      'helmholtz' ('helm', 'h')         'dir', 'neu', 'imp'
%      'stokes' ('stok', 's')            'vel'
%      'maxwell' ('em', 'm')             'pec'
%
%  The boundary conditions may also be written in longer form, e.g.
%    'dirichlet', 'neumann', 'impedance', 'velocity',
%    'perfect electric conductor'. 
%  
%  Different solvers require different parameters to be specified. 
%  Such parameters should be passed as trailing arguments.
%  For example, the Laplace Dirichlet, and Stokes velocity boundary
%  value problems require a double array of size 2 which determines
%  the strength of the single and double layer potentials in the
%  representation. 
%
%  Similarly, the helmholtz, and maxwell representations, require
%  a complex array, which includes the wavenumber as the first
%  parameter, and other parameters specific to the representation.
%  
%  The size of densities for the solver is also dependent on
%  the pde, bc, and representation being used. It should be 
%  an array of size (nd, S.npts) 
%  which correspond to the densities on surface if nd > 1, and
%  of size (S.npts,1) if nd == 1.
%
%  And finally, for Maxwell boundary value problems, the data
%  must be a complex array of size (6, S.npts), where
%  (1:3, :) are the cartesian components of the incident electric
%  field, and (4:6, :) are the cartesian components of the incident
%  magnetic fields.
%
%  Input arguments:
%    * S: surfer object, see README.md in matlab for details
%    * pde, bc: strings for determining pde being solved and representation
%               being used
%    * densities: layer potential densities, of size (ndim, npts)
%    * eps: tolerance requested
%    * targinfo: target info (optional)
%       targinfo.r = (3,nt) target locations
%       targinfo.patch_id (nt,) patch id of target, = -1, if target
%          is off-surface (optional)
%       targinfo.uvs_targ (2,nt) local uv ccordinates of target on
%          patch if on-surface (optional)
%
%  SEE ALSO: lap3d.eval, helm3d.eval, stok3d.eval, and em3d.eval 
%