!*****************************************************************************************************!
! TITLE: CFVR1075 -   Eurocode 3 2005 test: Bending and Compression Buckling.
! SUBTITLE: Bending and compression buckling checking according to Eurocode 3 2005.
!
! DESCRIPTION: A fixed steel beam subjected to a Fx load of -10000000 N, applied on one end of the beam.
! DESCRIPTION:
! DESCRIPTION: The beam has a length of 1m.
! DESCRIPTION:
! DESCRIPTION: The cross section is a Steel T.
! DESCRIPTION:
! DESCRIPTION: The beam is made of Fe 430 steel which has a fy of 275E3 kN/m<sup>2</sup>.
! DESCRIPTION:
! DESCRIPTION:
! DESCRIPTION: The aim of the example is to verify a class 3 in regard to the elastic critical moment
! DESCRIPTION: buckling criterion according to Eurocode 3 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='CFVR1075'
  /TITLE, %NomFile%, Eurocode 3 2005 test: Compression Buckling

! ---------------------------------------------------------------------------------
! Model definition and solve
! ---------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,SI 
  ~CODESEL,EC3-05
/PREP7
! Preprocessor
! --------------------------------------------------
! Materials
  ~CFMP,1,LIB,STEEL,EC3,Fe 430 !Fe 430
! Element Types
  ET,1,BEAM4 ! Type 1: 3D Beam

  !Cross section
~SSECDMS,1,T,1,0.5,2.5e-02,0.3,2.5e-02,0

! Member properties
~MEMBPRO,1,EC3,ALL,1.000,1.000,1.000,1.000,0.000,1.000,1.000,1.000,1.000,,0,1.000,1.000,0   
~MEMBPRO,1,NLMOD,ALL,0  
~MEMBPRO,1,NAME,Member Property 1  

! Beam properties
~BMSHPRO,1,BEAM,1,1,,, 4,1,0,,Beam 1

! Nodes
K,1,0,0,0,  
K,2,1,0,0,  
L,       1,       2 

!Mesh
LMESH,       1  

/SOLU
! Solution

!BC Loads
DK,1, , , ,0,ALL, , , , , ,  
FK,2,FX,-1e7

! Solve
  SOLVE
/POST1
! Postprocessor
! --------------------------------------------------
! Read results
  ~CFSET,,1,1       ! Read the first load step
  
! Check Compression Buckling 
~CHKSTL,BUCK_BCM,-Z,PARTIAL 

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp =1
  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) = 'Mcr' ! MCR
  
! Correct values
!--------------------------------------------------------------------------------------
  VALUE( 1,1)=  45958862.92

! Obtained values
!--------------------------------------------------------------------------------------
 ~CFGET,VALUE( 1,2),ELEMENT,1,RESULT,Mcr,I

 ! Warning and error tolerances
 !--------------------------------------------------------------------------------------
 TOLER( 1,1)= 0.02*VALUE(1,1) $ TOLER( 1,2)= 0.02*VALUE(1,1)

!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC
