%--------------------------------------------------------------------------
% PURPOSE
% FLIG - incremental solving - linear solving - 1 element L = 1.53m -
% Bitar
%
%--------------------------------------------------------------------------
% REFERENCES
% Chaymaa LEJOUAD
% 31-01-2018
%--------------------------------------------------------------------------
% 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
%% Global variables
global ME TP
%% Definition of the beam
FILE = '89.mail';
ME = INPUT.ACQU(FILE,'MAIL');
%% Definition of the model - beam scale
MOB1 = MODEL('L1','MECHANICS','ELASTICITY','ISOTROPIC','FLIG');
MOBT = MOB1;
%% Topology
TP = TOPOLOGY(MOBT);
%% Definition of the material - beam scale
MAB1 = CHAMELEM.MATE(MOB1,'youn',210e9,'nu',0.3,'sect',0.0625,'inrz',0.000325521, 'rho',25e2);
MABT = MAB1;
%% Stiffness and mass matrix
STI = MATRICE('STIFF',MOBT,MABT);
%% Boundary conditions
CL1 = MATRICE('DIRI','P1',1,2,6);
CL2 = MATRICE('DIRI','P2',2);
CLT = [CL1 CL2];
%% Loading
FO1 = CHPOINT.DEPI(CL2,0.1);
EV1 = EVOL([0 1],[0 1],'Time','Displacement (m)');
CHT = TIMELOAD(FO1,EV1,'DIRI');
%% Incremental
PB1 = PROBLEM('model',MOBT,'mater',MABT,'diric',CLT,'loadt',CHT,'comp_time',0:0.01:1,...
'solve_type','QUASI_NEWTON');
SOL = SOLVE(PB1);
%% Reaction curve
% Results from CastLab
EV_OUT = EVOL.REAC(SOL,CL2,EV1,2,'P2');
plot(EV_OUT);
close all
%% Non regression test
if abs(EV_OUT.ordo(end) - 7428.3*10^3)/(7428.3*10^3) > 1.0e-3
error('TEST IS NOT SUCCESSFUL')
else
disp('---------------------------------')
disp('089_INCRE_FLI_G')
disp('TEST IS SUCCESSFUL')
disp('---------------------------------')
end
%% Static analysis
PB2 = PROBLEM('model',MOBT,'mater',MABT,'diric',CL1,'solve_type','MODAL');
SOL2 = SOLVE(PB2);
%% Non regression test
if ((abs(SOL2.eigenfrequency(1) - 153.0197)/(153.0197) > 1.0e-3) || (abs(SOL2.eigenfrequency(2) - 1651.3)/(1651.3) > 1.0e-3))
error('TEST IS NOT SUCCESSFUL')
else
disp('---------------------------------')
disp('089_MODAL_FLI_G')
disp('TEST IS SUCCESSFUL')
disp('---------------------------------')
end