function pclaw_ex_burgers
%PCLAW_EX_BURGERS
%   Example for PARTICLECLAW, a numerical scheme for scalar
%   conservation and balance laws
%       u_t+(f(u))_x = g(x,u)
%   in one space dimension.
%   
%   Example: Burgers' equations
%       f(u) = u^2/2
%   with Riemann initial data (u_L = 1 and u_R = -0.1).
%
%   Copyright (c) 2008 Benjamin Seibold and Yossi Farjoun
%   http://math.mit.edu/~seibold/research/particleclaw
%   http://arxiv.org/abs/0809.0726

%===============================================================================
parameters = struct(...
'name','Burgers equation',...    % name of example
'f',@f,'f1',@f1,'f2',@f2,...     % flux function and derivatives (below)
'ic',@ic,...                     % initial condition (below)
'xbox',[-.1 2.1],...             % computational domain
'ubox',[-.2 1.1],...             % axis for function values (for plotting only)
'd',[0 7.3e-2 1.5*7.3e-2],...    % [d_min d_init d_max]
'tfinal',3,...                   % final time
'steps',250,...                  % number of output steps
'flag_sharpen',1,...             % if yes, shocks get sharpened upon output
'flag_plot',1,...                % if yes, animation gets plotted in figure
'flag_save',0      );            % if yes, solution gets stored in data files
%===============================================================================
particleclaw(parameters)
%===============================================================================
function y = f(u),  y = u.^2/2;
function y = f1(u), y = u;
function y = f2(u), y = u*0+1;
function y = ic(x), y = -.1+(x<0)*1.1;

%===============================================================================
% Copyright (c) 2008 Benjamin Seibold and Yossi Farjoun
% 
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction for non-commercial purposes, including
% without limitation the rights to use, copy, modify, merge, publish, and/or
% distribute copies of the Software, and to permit persons to whom the
% Software is furnished to do so, subject to the following conditions:
% 
% The above copyright notice and this permission notice shall be included in
% all copies or substantial portions of the Software, and credit has to be
% given to the authors in publications that are in any form based on this
% Software.
% 
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
% THE SOFTWARE.
%===============================================================================

