function pclaw_ex_quartic
%PCLAW_EX_QUARTIC
%   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: Quartic flux function
%       f(u) = u^4/4
%   with smooth initial data.
%
%   Copyright (c) 2008 Benjamin Seibold and Yossi Farjoun
%   http://math.mit.edu/~seibold/research/particleclaw
%   http://arxiv.org/abs/0809.0726

%===============================================================================
parameters = struct(...
'name','Quartic flux function',... % name of example
'f',@f,'f1',@f1,'f2',@f2,...     % flux function and derivatives (below)
'ic',@ic,...                     % initial condition (below)
'xbox',[-3 3],...                % computational domain
'ubox',[-.5 1.1],...             % axis for function values (for plotting only)
'd',[0 1e-1 1.9*1e-1],...        % [d_min d_init d_max]
'tfinal',10,...                  % final time
'steps',250,...                  % number of output steps
'flag_sharpen',0,...             % 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.^4/4;
function y = f1(u), y = u.^3;
function y = f2(u), y = 3*u.^2;
function y = ic(x), y = exp(-x.^2).*cos(pi*x);

%===============================================================================
% 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.
%===============================================================================

