!*****************************************************************************************************!
! TITLE: CFVR1001 - Eurocode 3 1992 test: Cross section classification.
! SUBTITLE: Cross section classification checking according Eurocode 3.
!
! 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 which is divided in four segments of 1.5 m.
! DESCRIPTION: The first segment of the beam has an IPE 100 section,
! DESCRIPTION: the second one has an IPE 160 section, the third one, an IPE 200
! DESCRIPTION: and the last one, an 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 classification
! DESCRIPTION: according to Eurocode 3 1992.
!
! ELEMENT TYPE: BEAM3
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Steel
! KEYWORD4: Code Checking/Design
! KEYWORD5: Eurocode 3
!
!*************************************************************************************!
  FINISH
  ~CFCLEAR,,1
  NomFile='CFVR1001'
  /TITLE, %NomFile%, Eurocode 3 1992 test: Cross section classification

! ---------------------------------------------------------------------------------
! Model definition and solve
! ---------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,,LENG,M
  ~UNITS,,TIME,S
  ~UNITS,,FORC,KN
  ~CODESEL,EC3-92

/PREP7
! Preprocessor
! --------------------------------------------------
! Materials
  ~CFMP,1,LIB,STEEL,UNE,S 460    !S 460 (UNE)
! Element Types
  ET,1,BEAM3  ! Type 1: 2D Beam
! Cross Sections
  ~SSECLIB,1,1,1,2   !IPE 100
  ~SSECLIB,2,1,1,5   !IPE 160
  ~SSECLIB,3,1,1,7   !IPE 200
  ~SSECLIB,4,1,1,9   !IPE 240

! 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,5 $ FILL, 1,5
! Elements
  REAL,1
  E,1,2
  EGEN,4,1,1,,,,,1
  EPLOT

/SOLU
! Solution
! --------------------------------------------------
! Displacements
  D, 1,ALL
! Apply Load
  F,5,FX,-1
! Solve
  SOLVE

/POST1
! Postprocessor
! --------------------------------------------------
! Read results
  ~CFSET,,1,1       !Read the first load step

! Check in Compression
  ~CHKSTL,COMPRESS,-Z,PARTIAL

! Plot the class of the sections
  ~PLLSSTL,CLASS

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp    =  4
  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) = 'Clase 1'
  LABEL(2,1) = 'Clase 2'
  LABEL(3,1) = 'Clase 3'
  LABEL(4,1) = 'Clase 4'

! Correct values
!--------------------------------------------------------------------------------------
  VALUE(1,1)=1
  VALUE(2,1)=2
  VALUE(3,1)=3
  VALUE(4,1)=4

! Obtained values
!--------------------------------------------------------------------------------------
  *GET,VALUE(1,2),ELEM,1,ETAB,CLASS_I
  *GET,VALUE(2,2),ELEM,2,ETAB,CLASS_I
  *GET,VALUE(3,2),ELEM,3,ETAB,CLASS_I
  *GET,VALUE(4,2),ELEM,4,ETAB,CLASS_I

! 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

!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC
