%--------------------------------------------------------------------------
% PURPOSE
% Test for ACCRO type kinematics relations between a TRUSS and QUA4s
% The TRUSS is placed at the interface between several QUA4 (limit case)
%--------------------------------------------------------------------------
% 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_STRESS';
%% Loading of the input datafile
FILE = '30.mail';
ME = INPUT.ACQU(FILE,'MAIL');
%% Definition of the model
MO1 = MODEL('ST','MECHANICS','ELASTICITY','ISOTROPIC');
MO2 = MODEL('LB','MECHANICS','ELASTICITY','ISOTROPIC','TRUSS');
MOT = [MO1 MO2];
%% Topology
TP = TOPOLOGY(MOT);
%% Definition of the material
MA1 = CHAMELEM.MATE(MO1,'youn',1,'nu',0.2,'rho',2200);
MA2 = CHAMELEM.MATE(MO2,'youn',1,'nu',0.2,'rho',7800,'sect',1);
MAT = [MA1 MA2];
%% Boundary conditions
% Line L1 fixed
CL1 = MATRICE('DIRI','P1',2);
CL2 = MATRICE('DIRI','L4',1);
CL3 = MATRICE('DIRI','L2',1);
CL4 = MATRICE('CONF_RELA','LB','ST');
CLT = [CL1 [CL2 [CL3 CL4]]];
% Definition of a prescribed displacement
FO1 = CHPOINT.DEPI(CL3,1);
%% Static analysis
PB1 = PROBLEM('model',MOT,'mater',MAT,'diric',CLT,'load',FO1,'solve_type','RESO');
USOL = SOLVE(PB1);
%% Post-treatment
% Displacement at points B1 and B2 in X and Y directions
UB1 = EXTR(USOL.displacement,'B1',[1 2]);
UB2 = EXTR(USOL.displacement,'B2',[1 2]);
%% Non regression test
if abs(UB1(1) - 0.336697036958553) > 1.0e-4 || abs(UB2(1) - 0.663302961133693) > 1.0e-4
error('TEST IS NOT SUCCESSFUL')
else
disp('---------------------------------')
disp('030_LINE_2D_QUA4_RELA_ACCRO_LIMIT')
disp('TEST IS SUCCESSFUL')
disp('---------------------------------')
end