%--------------------------------------------------------------------------
% PURPOSE
% Non linear analysis - Schlangen first beam - Mazars' model - IMPLEX
%--------------------------------------------------------------------------
% REFERENCES
% Benjamin RICHARD
% 05-12-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
warning off all
%% Declaration de variables global
global options ME TP;
%% Definition des options
options.mode = 'PLANE_STRESS';
%% Loading of the input datafile
FILE = '51.mail';
ME = INPUT.ACQU(FILE,'MAIL');
%% Definition of the model
MO1 = MODEL('SBETON','MECHANICS','ELASTICITY','ISOTROPIC','DAMAGE','MAZARS');
MO2 = MODEL('SP1','MECHANICS','ELASTICITY','ISOTROPIC');
MO3 = MODEL('SP2','MECHANICS','ELASTICITY','ISOTROPIC');
MO4 = MODEL('SP3','MECHANICS','ELASTICITY','ISOTROPIC');
MO5 = MODEL('SP4','MECHANICS','ELASTICITY','ISOTROPIC');
MO6 = MODEL('SCHE','MECHANICS','ELASTICITY','ISOTROPIC');
MOT = [MO1 MO2 MO3 MO4 MO5 MO6];
%% Topology
TP = TOPOLOGY(MOT);
%% Definition of the material
MA1 = CHAMELEM.MATE(MO1,'youn',35e9,'nu',0.2,'rho',2200,'k0',2.8e6/35e9,'bt',5000);
MA2 = CHAMELEM.MATE(MO2,'youn',210e13,'nu',0.2,'rho',2200);
MA3 = CHAMELEM.MATE(MO3,'youn',210e13,'nu',0.2,'rho',2200);
MA4 = CHAMELEM.MATE(MO4,'youn',210e13,'nu',0.2,'rho',2200);
MA5 = CHAMELEM.MATE(MO5,'youn',210e13,'nu',0.2,'rho',2200);
MA6 = CHAMELEM.MATE(MO6,'youn',210e13,'nu',0.2,'rho',2200);
MAT = [MA1 [MA2 [MA3 [MA4 [MA5 MA6]]]]];
%% Boundary conditions
% Line L1 fixed
CL1 = MATRICE('DIRI','P18',2);
CL2 = MATRICE('DIRI','P21',1,2);
CL3 = MATRICE('DIRI','P31',2);
CLT = [CL1 [CL2 CL3]];
% Definition of a prescribed displacement
FO1 = CHPOINT.DEPI(CL3,1);
%% Loading
EV1 = EVOL([0 1],[0 1.0e-4],'Time','Displacement (m)');
CHT = TIMELOAD(FO1,EV1,'DIRI');
%% Static analysis
PB1 = PROBLEM('model',MOT,'mater',MAT,'diric',CLT,'loadt',CHT,'comp_time',0:0.01:0.5,...
'solve_type','IMPLEX');
SOL = SOLVE(PB1);
%% Post-treatment
% Reaction curve
EV_OUT = EVOL.REAC(SOL,CL3,EV1,2);
plot(EV_OUT);
close all
%% Non regression test
if abs(EV_OUT.ordo(end) - 1.082935186624722e+05)/1.082935186624722e+05 > 1.0e-2
error('TEST IS NOT SUCCESSFUL')
else
disp('---------------------------------')
disp('051_INCR_NLINE_2D_TRI3_MAZARS_IMPLEX_SEN')
disp('TEST IS SUCCESSFUL')
disp('---------------------------------')
end