!*****************************************************************************************************!
! TITLE: CFVR2860 - IS 800-07 test: Bending and Compression Buckling.
! SUBTITLE: Bending and Compression Buckling check according to IS 800-07
!
!
! 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: checking criterion according to IS 800-07.
!
! ELEMENT TYPE: BEAM4
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Steel
! KEYWORD4: Code Checking/Design
! KEYWORD5: IS800
!
!*************************************************************************************!
   FINISH
  ~CFCLEAR,,1
   NomFile='CFVR2860'
  /TITLE, %NomFile%, IS800 test: Bending and Compression Buckling check.

! ---------------------------------------------------------------------------------
! Model definition and solve
! ---------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,SI 
  ~CODESEL,IS800-07
/PREP7
! Preprocessor
! --------------------------------------------------
! Materials
  ~CFMP,1,LIB,STEEL,EC3,Fe 430 !Fe 430
  ~CFMP,1,USER
  ~CFMP,1,Steel   ,ExLn    ,,2.1e+11  
! 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,IS800,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,BND_AXCB,-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
