function plotmrpt
%
% Function: plotmrpt.m
% 
% Usage: plotmrpt
% 
% Description: Creates a color gradient plot of the MRPT
%    damage indicator
%

% Version SWD970916
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This matlab source code was originally     %
% developed as part of "DIAMOND" at          %
% Los Alamos National Laboratory. It may     %
% be copied, modified, and distributed in    %
% any form, provided:                        %
%  a) This notice accompanies the files and  %
%     appears near the top of all source     %
%     code files.                            %
%  b) No payment or commercial services are  %
%     received in exchange for the code.     %
%                                            %
% Original copyright is reserved by the      %
% Regents of the University of California,   %
% in addition to Scott W. Doebling, Phillip  %
% J. Cornwell, Erik G. Straser, and Charles  %
% R. Farrar.                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global HANDLES MODELCOR GEOM

axes(MODELCOR.haxes)
cla

%  Create the DIvec from the perturbation matrix DI

DIvec = -1 * diag(MODELCOR.DI);

inodal = 1; % Damage Indicator is Nodal quantity

colormap cool

if isfield(GEOM,'Bars'),
   if ~isempty(GEOM.Bars),
      ngrad = 30; % Number of increments for color gradient shading
      ptdambar(GEOM.Nodes,GEOM.Bars,DIvec,MODELCOR.haxes,inodal,ngrad);
   end
end

if isfield(GEOM,'Shells')
   if ~isempty(GEOM.Shells),
      ngrad = 4;  % Number of divisions in each direction for shell elements
      ptdamshl(GEOM.Nodes,GEOM.Shells,DIvec,MODELCOR.haxes,inodal,ngrad);
   end
end

%  Plot undeformed geometry

hold on

updtgeom(MODELCOR.haxes,GEOM.Nodes)

hold off

damscale(MODELCOR.hlegax,DIvec);

axes(MODELCOR.haxes)
rotate3d on

title(['Nodal Damage Indicator - MRPT Method',])


return