%--------------------------------------------------------------------------
% PURPOSE
% Linear analysis of a 2D structure meshed with TRI3 FEs
%--------------------------------------------------------------------------
% REFERENCES
% Benjamin RICHARD
% 21-02-2016
%--------------------------------------------------------------------------
% COMMENTS
%
%
%
%--------------------------------------------------------------------------
% MIT License
%
% Copyright (c) 2018 Benjamin Richard
%
% 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, including without
% limitation the rights to use, copy, modify, merge, publish, distribute,
% sublicense, and/or sell 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.
%
% 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.
%--------------------------------------------------------------------------
%% Clearing off
fclose all;
clear
close all
%% Declaration de variables global
global options ME TP;
%% Definition des options
options.mode = 'PLANE_STRAIN';
%% Loading of the input datafile
disp('Inputing the mesh...')
tic
FILE = '34.mail';
ME = INPUT.ACQU(FILE,'MAIL');
toc
%% Definition of the model
MO1 = MODEL('ST','MECHANICS','ELASTICITY','ISOTROPIC');
%% Topology
disp('Topology...')
tic
TP = TOPOLOGY(MO1);
toc
%% Definition of the material
MA1 = CHAMELEM.MATE(MO1,'youn',12e9,'nu',0.2,'rho',50e3);
%% Boundary conditions
disp('Boundary conditions...')
tic
% Line L1 fixed
CL1 = MATRICE('DIRI','L1',1,2);
CLT = CL1;
toc
% Definition of a prescribed displacement
FO1 = CHPOINT('LABEL','P3',1,-5e5);
%% Loading
EV1 = EVOL([0 1],[0 1],'Time','Displacement (m)');
CH1 = TIMELOAD(FO1,EV1,'MECA');
CHT = CH1;
%% Static analysis
PB1 = PROBLEM('model',MO1,'mater',MA1,'diric',CLT,'loadt',CHT,'comp_time',0:0.1:1);
SOL = SOLVE(PB1);
%% Post-treatment
% Displacement at point P4 X and Y
USOL = SOL.displacement(end);
UP4 = EXTR(USOL,'P4',[1 2]);
%% Non regression test
if abs(UP4(1) + 2.3604e-004) > 1.0e-4 || ...
abs(UP4(2) + 1.0236e-004) > 1.0e-4
error('TEST IS NOT SUCCESSFUL')
else
disp('---------------------------------')
disp('034_INCR_2D_TRI3 ')
disp('TEST IS SUCCESSFUL')
disp('---------------------------------')
end