% Add a sink to the model.
%
% [opt, sn] = addSink(opt, name)
%
% Sinks are used for detecting fields.  They are end points
% for field propagation and sources of shot noise.
%
% A sink has 1 input and 1 output.
%
% Input:
% 1, in, fr = input
%
% Output:
% 1, out, fr = output

function [opt, sn] = addSink(opt, name)

  % transfer matrices  
  m = zeros(1, 1);
  d = zeros(1, 1);
  
  % basis transform matrix
  qm = repmat(nullOpHG, 1, 1);
  
  % add optic
  type = 'Sink';
  inNames = {{'in' 'fr'}};
  outNames = {{'out' 'fr'}};
  [opt, sn] = addOptic(opt, type, name, m, d, qm, inNames, outNames);
