!****************************************************************************************************
! TITLE: CFVR7911 - CTE DB SB-A test: Compression and flexural Buckling
! SUBTITLE: Compression and flexural Buckling checking according to CTE DB SE-A
!
! DESCRIPTION: A fixed steel beam subjected to a Fy load of -250 kN, a bending
! DESCRIPTION: moment Mz of 50 m*kN and a bending moment Mx of -30 m*kN
! DESCRIPTION: applied on the end of the beam.
! DESCRIPTION:
! DESCRIPTION: The beam has a length of 1 meter.
! DESCRIPTION:
! DESCRIPTION: The cross section is a IPE A 550 .
! DESCRIPTION:
! DESCRIPTION: The beam is made of Fe 460 steel which has a fy of 460000 kN/m<sup>2</sup>.
! DESCRIPTION:
! DESCRIPTION: The aim of the example is to obtain the cross section classification and compression
! DESCRIPTION: and flexion buckling criterion according to CTE DB SE-A.
!
! ELEMENT TYPE: BEAM4
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Steel
! KEYWORD4: Code Checking/Design
! KEYWORD5: CTE
!
!*************************************************************************************!
   FINISH
  ~CFCLEAR,,1
   NomFile='CFVR7911'
  /TITLE, %NomFile%, CTE DB SE-A test: Compression and flexion Buckling

! ---------------------------------------------------------------------------------
! Model definition and solve
! ---------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,,LENG,M
  ~UNITS,,TIME,S
  ~UNITS,,FORC,KN
  ~CODESEL,CTESEA,
/PREP7
! Preprocessor
! --------------------------------------------------
! Materials
 ~CFMP,1,LIB,STEEL,UNE,S 460

! Element Types
  ET,1,BEAM4 ! Type 1: 3D Beam

! Cross Sections
 ~SSECLIB,1,1,2,17   !IPE A 550

! Member properties
  ~MEMBPRO,1,CTESEA,ALL,10,1.0,1.0,1.88,1,1,1,1,0.8,1,1.0,1.0,0

! Beam properties
  ~BMSHPRO,1,BEAM,1,,,,4,1,0,,

! Nodes
  N,1,0.,0.
  N,2,0,10.
! Elements
  E,1,2
  EPLOT
/SOLU
! Solution
! --------------------------------------------------
! Displacements
  D,1,ux
  D,1,UY
  D,1,UZ
  D,2,UX
  D,2,UZ
  D,ALL,ROTY

! Apply Load
  F,2,FY,-250
  F,1,MZ,50
  F,1,MX,-30

  SOLVE
/POST1
! Postprocessor
! --------------------------------------------------
! Read results
  ~CFSET,,1,1       ! Read the first load step

! Eurocode No.3 Check Buckling flexion and Compression buckling
  ~CHKSTL,BUCK_BCM,-Z,PARTIAL

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp = 16
  NComp_ch =  0

! Matrix dim.
  *DIM,LABEL,CHAR,Ncomp,1
  *DIM,LABEL_CH,CHAR,Ncomp_ch,1
  *DIM,VALUE,,Ncomp,3
  *DIM,VALUE_CH,CHAR,Ncomp_ch,3
  *DIM,TOLER,,Ncomp,2

! Labels
!--------------------------------------------------------------------------------------
  LABEL( 1,1) = 'CLASS'
  LABEL( 2,1) = 'NBRD1'
  LABEL( 3,1) = 'MYRD1'
  LABEL( 4,1) = 'MZRD1'
  LABEL( 5,1) = 'CRIT_N1'
  LABEL( 6,1) = 'CRT_MY1'
  LABEL( 7,1) = 'CRT_MZ1'
  LABEL( 8,1) = 'CRT_1'
  LABEL( 9,1) = 'NBRD2'
  LABEL(10,1) = 'MYRD2'
  LABEL(11,1) = 'MZRD2'
  LABEL(12,1) = 'CRIT_N2'
  LABEL(13,1) = 'CRT_MY2'
  LABEL(14,1) = 'CRT_MZ2'
  LABEL(15,1) = 'CRT_2'
  LABEL(16,1) = 'CRT_TOT'

 ! Correct values I section
!--------------------------------------------------------------------------------------
  VALUE( 1,1)=   4
  VALUE( 2,1)=   4496
  VALUE( 3,1)=   957.43
  VALUE( 4,1)=   101.4567
  VALUE( 5,1)=   0.0556
  VALUE( 6,1)=   0.05359
  VALUE( 7,1)=   0.3921
  VALUE( 8,1)=   0.5013
  VALUE( 9,1)=   460
  VALUE(10,1)=   957.43
  VALUE(11,1)=   101.4567
  VALUE(12,1)=   0.5435
  VALUE(13,1)=   0.04285
  VALUE(14,1)=   0.3921
  VALUE(15,1)=   0.9785
  VALUE(16,1)=   0.9785

! Obtained values
!--------------------------------------------------------------------------------------
 ~CFGET,VALUE( 1,2),ELEMENT,1,RESULT,CLASS,I
 ~CFGET,VALUE( 2,2),ELEMENT,1,RESULT,NBRD1,I
 ~CFGET,VALUE( 3,2),ELEMENT,1,RESULT,MYRD1,I
 ~CFGET,VALUE( 4,2),ELEMENT,1,RESULT,MZRD1,I
 ~CFGET,VALUE( 5,2),ELEMENT,1,RESULT,CRT_N1,I
 ~CFGET,VALUE( 6,2),ELEMENT,1,RESULT,CRT_MY1,I
 ~CFGET,VALUE( 7,2),ELEMENT,1,RESULT,CRT_MZ1,I
 ~CFGET,VALUE( 8,2),ELEMENT,1,RESULT,CRT_1,I
 ~CFGET,VALUE( 9,2),ELEMENT,1,RESULT,NBRD2,I
 ~CFGET,VALUE(10,2),ELEMENT,1,RESULT,MYRD2,I
 ~CFGET,VALUE(11,2),ELEMENT,1,RESULT,MZRD2,I
 ~CFGET,VALUE(12,2),ELEMENT,1,RESULT,CRT_N2,I
 ~CFGET,VALUE(13,2),ELEMENT,1,RESULT,CRT_MY2,I
 ~CFGET,VALUE(14,2),ELEMENT,1,RESULT,CRT_MZ2,I
 ~CFGET,VALUE(15,2),ELEMENT,1,RESULT,CRT_2,I
 ~CFGET,VALUE(16,2),ELEMENT,1,RESULT,CRT_TOT,I


 ! Warning and error tolerances
  TOLER(  1,1) = 1E-02   $  TOLER(  1,2) = 1E-02 
  TOLER(  2,1) = 1E+01   $  TOLER(  2,2) = 1E+01 
  TOLER(  3,1) = 1E+01   $  TOLER(  3,2) = 1E+01
  TOLER(  4,1) = 1E-02   $  TOLER(  4,2) = 1E-02 
  TOLER(  5,1) = 1E-02   $  TOLER(  5,2) = 1E-02 
  TOLER(  6,1) = 1E-02   $  TOLER(  6,2) = 1E-02 
  TOLER(  7,1) = 1E-02   $  TOLER(  7,2) = 1E-02 
  TOLER(  8,1) = 1E-02   $  TOLER(  8,2) = 1E-02 
  TOLER(  9,1) = 1E+01   $  TOLER(  9,2) = 1E+01 
  TOLER( 10,1) = 1E+01   $  TOLER( 10,2) = 1E+01 
  TOLER( 11,1) = 1E+01   $  TOLER( 11,2) = 1E+01 
  TOLER( 12,1) = 1E-02   $  TOLER( 12,2) = 1E-02 
  TOLER( 13,1) = 1E-03   $  TOLER( 13,2) = 1E-03 
  TOLER( 14,1) = 1E-02   $  TOLER( 14,2) = 1E-02 
  TOLER( 15,1) = 1E-02   $  TOLER( 15,2) = 1E-02 
  TOLER( 16,1) = 1E-02   $  TOLER( 16,2) = 1E-02 


!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC
