!*****************************************************************************************************!
! TITLE: CFVR2601 - BS5950 2001: Cross section classification.
! SUBTITLE: Cross section classification according to BS5950 2001.
!
! DESCRIPTION: A cantilever steel beam which has different sections
! DESCRIPTION: is subjected to an axial compression force of -1 kN.
! DESCRIPTION: The beam has a length of 5 m. The first segment of the beam has a IPE 100 section.
! DESCRIPTION: The second one has a I section with the following dimensions:
! DESCRIPTION:
! DESCRIPTION: - h = 16 cm
! DESCRIPTION:
! DESCRIPTION: - tw = 0.55 cm
! DESCRIPTION:
! DESCRIPTION: - b = 15 cm
! DESCRIPTION:
! DESCRIPTION: - tf = 0.9 cm
! DESCRIPTION:
! DESCRIPTION: The third segment has a I section with the following dimensions:
! DESCRIPTION:
! DESCRIPTION: - h = 172.4 cm
! DESCRIPTION:
! DESCRIPTION: - tw = 1.2 cm
! DESCRIPTION:
! DESCRIPTION: - b = 25.2 cm
! DESCRIPTION:
! DESCRIPTION: - tf = 0.7 cm
! DESCRIPTION:
! DESCRIPTION: And the last one has a IPE 240.
! DESCRIPTION:
! DESCRIPTION: The beam is made of S 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 clasification
! DESCRIPTION: according to BS5950 2001.
!
! ELEMENT TYPE: BEAM3
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Steel
! KEYWORD4: Code Checking/Design
! KEYWORD5: BS 5950-01
!
!*************************************************************************************!
    FINISH
  ~CFCLEAR,,1

   NomFile='CFVR2601'
  /TITLE, %NomFile%, BS5950 2001: Section Classification
!--------------------------------------------------------------------------------------
! Model definition and solve
!--------------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,,LENG,CM
  ~UNITS,,TIME,S
  ~UNITS,,FORC,KN
  ~CODESEL,BS595001,EC2,,,EC8-94

/PREP7
! Preprocessor
! --------------------------------------------------
! Materials
  ~CFMP,1,LIB,STEEL,BS5950,S275N   ! material S275N
! Element Types
  ET,1,BEAM3  ! Type 1: 2D Beam
! Cross Sections
  ~SSECLIB,1,1,1,2   ! IPE 100
  ~SSECDMS,2,I,1,16,0.55,15,0.9,0  ! Shape defined by dimensions
  ~SSECLIB,3,1,1,9   ! IPE 240
  ~SSECDMS,4,I,1,172.4,1.2,25.2,0.7,0.5
! Beam & Shell properties
  ~BMSHPRO,1,BEAM,1,1,,,3,1,0,
  ~BMSHPRO,2,BEAM,2,2,,,3,1,0,
  ~BMSHPRO,3,BEAM,3,3,,,3,1,0,
  ~BMSHPRO,4,BEAM,4,4,,,3,1,0,

! Nodes
  N, 1
  N,5,500
  FILL, 1,5
! Elements
  REAL,1
  E,1,2
  EGEN,4,1,1,,,,,1
  EPLOT
/ SOLU
! Solution
! --------------------------------------------------
! Displacements
  D, 1,ALL
! Apply Load
  F,4,FY,-100
  F,5,FX,-1
! Solve
  SOLVE

/POST1
! Postprocessor
! --------------------------------------------------
! Read results
  ~CFSET,,1,1       ! Load first load step

! BS 5950 -2001  Check for Bending
  ~CHKSTL,BENDING,-Z

! Plot the class of the sections
   ~PLLSSTL,CLASS
 !--------------------------------------------------------------------------------------
 ! DATA CHECK
 !--------------------------------------------------------------------------------------
 ! Data comparison number
   NComp    =  8
   NComp_ch =  0

 ! Marix 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 1'
   LABEL(2,1) = 'Class 2'
   LABEL(3,1) = 'Class 3'
   LABEL(4,1) = 'Class 4'
   LABEL(5,1) = 'WebClass 1'
   LABEL(6,1) = 'WebClass 1'
   LABEL(7,1) = 'WebClass 1'
   LABEL(8,1) = 'WebClass 2'

 ! Correct values
   VALUE(1,1)=1
   VALUE(2,1)=2
   VALUE(3,1)=3
   VALUE(4,1)=4
   VALUE(5,1)=1
   VALUE(6,1)=1
   VALUE(7,1)=1
   VALUE(8,1)=2

 ! Obtained values
   *GET,VALUE(1,2),ELEM,1,ETAB,CLASS_J
   *GET,VALUE(2,2),ELEM,2,ETAB,CLASS_J
   *GET,VALUE(3,2),ELEM,3,ETAB,CLASS_J
   *GET,VALUE(4,2),ELEM,4,ETAB,CLASS_J

   ~PLLSSTL,WEBCLASS
   *GET,VALUE(5,2),ELEM,1,ETAB,CLASS_J
   *GET,VALUE(6,2),ELEM,2,ETAB,CLASS_J
   *GET,VALUE(7,2),ELEM,3,ETAB,CLASS_J
   *GET,VALUE(8,2),ELEM,4,ETAB,CLASS_J

 ! Warning and error tolerances
   TOLER( 1, 1)= 1E-9  $ TOLER( 1, 2)= 1E-9
   TOLER( 2, 1)= 1E-9  $ TOLER( 2, 2)= 1E-9
   TOLER( 3, 1)= 1E-9  $ TOLER( 3, 2)= 1E-9
   TOLER( 4, 1)= 1E-9  $ TOLER( 4, 2)= 1E-9
   TOLER( 5, 1)= 1E-9  $ TOLER( 5, 2)= 1E-9
   TOLER( 6, 1)= 1E-9  $ TOLER( 6, 2)= 1E-9
   TOLER( 7, 1)= 1E-9  $ TOLER( 7, 2)= 1E-9
   TOLER( 8, 1)= 1E-9  $ TOLER( 8, 2)= 1E-9

 !--------------------------------------------------------------------------------------
 ! Results comparison
 !--------------------------------------------------------------------------------------
   COMPARA.MAC
