function acceleratedtriaelem = acceleratedtriaelem(varargin)
%ACCELERATEDTRIAELEM - constructor for acceleratedtriaelem object
%
%   Usage:
%      acceleratedtriaelem = acceleratedtriaelem(varargin)

switch nargin
case 0
	% if no input arguments, create a default object
	acceleratedtriaelem.type='acceleratedtriaelem';
	acceleratedtriaelem.x=NaN;
	acceleratedtriaelem.y=NaN;
	acceleratedtriaelem.index=NaN;
	acceleratedtriaelem.thickness=NaN;
	acceleratedtriaelem.thickness_el=NaN;
	acceleratedtriaelem.bed=NaN;
	acceleratedtriaelem.surface=NaN;
	acceleratedtriaelem.nods=NaN;
	acceleratedtriaelem.nel=NaN;
	acceleratedtriaelem.B_bar=NaN;
	acceleratedtriaelem.glen_coeff=NaN;
	acceleratedtriaelem.friction_type=NaN;
	acceleratedtriaelem.drag=NaN;
	acceleratedtriaelem.p=NaN;
	acceleratedtriaelem.q=NaN;
	acceleratedtriaelem.matid=NaN;
	acceleratedtriaelem.meanvel=NaN;
	acceleratedtriaelem.epsvel=NaN;
	acceleratedtriaelem.index_icefront=NaN;
	acceleratedtriaelem.gridoniceshelf=NaN;
	acceleratedtriaelem.elementonicesheet=NaN;
    
	acceleratedtriaelem=class(acceleratedtriaelem,'acceleratedtriaelem');
				
case 1
	%If single argument of class acceleratedtriaelem, we have a copy constructor. 
	if (isa(varargin{1},'acceleratedtriaelem'))
		acceleratedtriaelem = varargin{1};
	else
		error('acceleratedtriaelem constructor error message: copy constructor called on a non ''acceleratedtriaelem'' class object');
	end 
otherwise
	error('acceleratedtriaelem constructor error message: 0 of 1 argument only in input.');
end
