!*****************************************************************************************************!
! TITLE: CFVR7901 - CTE DB SE-A: Cross section classification
! SUBTITLE: Cross section classification according to CTE DB SE-A
!
! 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 a IPE 100 section,
! DESCRIPTION: the second one has a IPE 160 section, the third one a IPE 200
! DESCRIPTION: and the last one 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 classification
! DESCRIPTION: according to CTE DB SE-A.
!
! ELEMENT TYPE: BEAM3
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Steel
! KEYWORD4: Code Checking/Design
! KEYWORD5: CTE
!
!*************************************************************************************!
    FINISH
  ~CFCLEAR,,1
   NomFile='CFVR7901'
  /TITLE, %NomFile%, CTE DB SE-A test: Cross section classification

! ---------------------------------------------------------------------------------
! Model definition and solve
! ---------------------------------------------------------------------------------
! CivilFEM Setup: Code & Units
  ~UNITS,,LENG,M
  ~UNITS,,TIME,S
  ~UNITS,,FORC,KN
  ~CODESEL,CTESEA,EC2,,,EC8-94

/PREP7
! 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
! Restraints
  D, 1,ALL
! Apply Load
  F,5,FX,-1
! Solve
  SOLVE

/POST1
! Read results
  ~CFSET,,1,1       ! Read the first load step

! CTE DB SE-A Check in Compression
  ~CHKSTL,COMPRESS,-Z,PARTIAL

! Plot the class of the sections
  ~PLLSSTL,CLASS
/IMAGE,SAVE,%NomFile%,BMP

!--------------------------------------------------------------------------------------
! 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) = 'Class 1'
  LABEL(2,1) = 'Class 2'
  LABEL(3,1) = 'Class 3'
  LABEL(4,1) = 'Class 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
