function Ppairs = liup_doublet(varargin)
% Return default parameters  for liu inputs as {'Name', Value} format for multiple domain case. 
% Overload eventual extra parameters
%
% [+MEQ MatlabEQuilibrium Toolbox+] Swiss Plasma Center EPFL Lausanne 2022. All rights reserved.

P = struct();
P.nelem = 12; % #FE for initialization in liut
P.iters = 0;
P.zup = NaN;
P.zlp = NaN;
P.rop = NaN;
P.rip = NaN;
P.ndom = 3; % Maximum number of domains allowed. 
P.bfct = @bfabmex;
P.bfp =  [0 1];
% Warning! size(P.wag) = [ng*nD]. Needs to provide consistent bfp, bfct, ndom, wag
P.wag = [0;0;Inf]; % Exact constraint in ag for 0 current in the mantle. 
P.debug = 0;
P.idoublet =  1;
P.fetype =  'bil';
P.idml = 0;
P.izgrid= true;
P.argout = {'Opy'};
P.Ipmin= 1e4;
P.Iperr =  50;
P.Iaerr =  400;
P.Iuerr =  2000;
P.stabz = 0; % dz stabilization not needed with Newton


%% Overwrite defaults with inputs
for k = 1:2:numel(varargin)
 P.(varargin{k}) = varargin{k+1};
end

%% Convert struct to pairs {'Name',Value} to be passed as inputs to liu
Ppairs=[fieldnames(P).'; struct2cell(P).'];
Ppairs=Ppairs(:).';

end

