!*****************************************************************************************************!
! TITLE: CFVR1019 - EC3-05 test: Compression Buckling
! SUBTITLE: Compression Buckling checking according to EN 1993-1-1:2005
!
! DESCRIPTION: A fixed steel beam subjected to a Fy load of -250 KN.
! DESCRIPTION:
! DESCRIPTION: The beam has a length of 1 m.
! DESCRIPTION:
! DESCRIPTION: The cross section is a L 100 x 100 x 12.
! DESCRIPTION:
! DESCRIPTION: The beam is made of Fe 430 steel which has a fy of 275000 kN/m<sup>2</sup>.
! DESCRIPTION:
! DESCRIPTION: The aim of the example is to obtain the cross section classification and compression
! DESCRIPTION: buckling criterion according to EN 1993-1-1:2005.
!
! ELEMENT TYPE: BEAM4
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Steel
! KEYWORD4: Code Checking/Design
! KEYWORD5: Eurocode 3
!
!*************************************************************************************!
   FINISH
  ~CFCLEAR,,1
   NomFile='CFVR1019'
  /TITLE, %NomFile%, EC3-05 test: Compression Buckling

! ---------------------------------------------------------------------------------
! Model definition and solve
! ---------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,,LENG,M
  ~UNITS,,TIME,S
  ~UNITS,,FORC,KN
  ~CODESEL,EC3-05,EC2-08,,,EC8-94
/PREP7
! Preprocessor
! --------------------------------------------------
! Materials
  ~CFMP,1,LIB,STEEL,EC3,Fe 430   ! Fe 430 (EC3)
! Element Types
  ET,1,BEAM4 ! Type 1: 3D Beam

! Cross Sections
 ~SSECLIB,1,1,23,6   ! L 100 x 100 x 12  

! ~MEMBPRO,1,EC3,ALL, L,    K,   KW,   C1,   C2,   C3,  CMY,  CMZ, CMLT,PSIVEC,LATB,CFBXY,CFBXZ,CHKAX  
  ~MEMBPRO,1,EC3,ALL,10,1.000,1.000,1.000,  1.0,  1.0,  1.0,  1.0,  1.0,   0.5,   1,  1.0,  1.0,    0,   

! Beam properties
  ~BMSHPRO,1,BEAM,1,,,,4,1,0,,

! Nodes
  N, 1
  N,25,,10
  E,1,25
  EPLOT
/SOLU
! Solution
! --------------------------------------------------
! Displacements
  D, 1,UX
  D, 1,UY
  D, 1,UZ
  D,25,UX
  D,25,UZ
  D,ALL,ROTY
! Apply Load
  F,25,FY,-250
! Solve
  SOLVE
/POST1
! Postprocessor
! --------------------------------------------------
! Read results
  ~CFSET,,1,1       ! Read the first load step

! Eurocode No.3 Check Buckling Compression
  ~CHKSTL,BUCK_CMP,-Z,PARTIAL

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp = 13
  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) = 'ALP_Z'
  LABEL( 3,1) = 'AREA'
  LABEL( 4,1) = 'LAM_V'
  LABEL( 5,1) = 'PHI_V'
  LABEL( 6,1) = 'CHI_V'
  LABEL( 7,1) = 'NCR_V'
  LABEL( 8,1) = 'NBRD'
  LABEL( 9,1) = 'CRT_TOT'  

! Correct values
!--------------------------------------------------------------------------------------
  VALUE( 1,1)=   3
  VALUE( 2,1)=   0.34
  VALUE( 3,1)=   2.271E-3
  VALUE( 4,1)=   5.937
  VALUE( 5,1)=   19.1  
  VALUE( 6,1)=   0.0268
  VALUE( 7,1)=   17.704
  VALUE( 8,1)=   15.234
  VALUE( 9,1)=   16.41 

! Obtained values
!--------------------------------------------------------------------------------------
 ~PLLSSTL,CLASS
 *GET,VALUE( 1,2),ELEM,1,ETAB,CLASS_J
 ~PLLSSTL,ALP_Z
 *GET,VALUE( 2,2),ELEM,1,ETAB,CFETAB_J
 ~PLLSSTL,AREA
 *GET,VALUE( 3,2),ELEM,1,ETAB,CFETAB_J
 ~PLLSSTL,LAM_V
 *GET,VALUE( 4,2),ELEM,1,ETAB,CFETAB_J
 ~PLLSSTL,PHI_V
 *GET,VALUE( 5,2),ELEM,1,ETAB,CFETAB_J
  ~PLLSSTL,CHI_V 
 *GET,VALUE( 6,2),ELEM,1,ETAB,CFETAB_J 
 ~PLLSSTL,NCR_V
 *GET,VALUE( 7,2),ELEM,1,ETAB,CFETAB_J 
 ~PLLSSTL,NBRD
 *GET,VALUE( 8,2),ELEM,1,ETAB,CFETAB_J
 ~PLLSSTL,CRT_TOT
 *GET,VALUE( 9,2),ELEM,1,ETAB,CFETAB_J

! Warning and error tolerances
  TOLER( 1,1)= 1E-2 $ TOLER( 1,2)= 1E-2
  TOLER( 2,1)= 1E-2 $ TOLER( 2,2)= 1E-2
  TOLER( 3,1)= 1E-4 $ TOLER( 3,2)= 1E-4
  TOLER( 4,1)= 1E-2 $ TOLER( 4,2)= 1E-2
  TOLER( 5,1)= 1E-1 $ TOLER( 5,2)= 1E-1
  TOLER( 6,1)= 1E-0 $ TOLER( 6,2)= 1E-0		! ROUNDING ERROR ACCEPTED
  TOLER( 7,1)= 1E-0 $ TOLER( 7,2)= 1E-0		! ROUNDING ERROR ACCEPTED
  TOLER( 8,1)= 1E-2 $ TOLER( 8,2)= 1E-2
  TOLER( 9,1)= 1E-2 $ TOLER( 9,2)= 1E-2

!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC