!****************************************************************************************************************!
! TITLE: CFVR4065 - Bending + Axial force design according to GB50010-2010
! SUBTITLE: Design a reinforced concrete beam subjected to Bending + Axial force according to GB50010-2010
!
! DESCRIPTION: A fixed beam which has a box reinforced concrete section is subjected to
! DESCRIPTION: a bending moment of 1490kN*m and a compression axial force of 100kN.
! DESCRIPTION:
! DESCRIPTION: The aim of the example is to obtain the design criterion according to GB50010-2010.
!
! ELEMENT TYPE: BEAM3
! MODULES:
! UNITS: User
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Code Checking/Design
! KEYWORD4: Reinforced Concrete
! KEYWORD5: GB50010-2010
!
!*****************************************************************************************************************!
   FINISH
  ~CFCLEAR,,1
   NomFile='CFVR4065'
 /TITLE,%NomFile%, BENDING + AXIAL FORCE DESIGN ACCORDING TO GB50010-2010

! -------------------------------------------------------------------------------------
! Initial data
! -------------------------------------------------------------------------------------
! CivilFEM SETUP
 ~UNITS,,LENG,M
 ~UNITS,,TIME,S
 ~UNITS,,FORC,KN
 ~CODESEL,EC3-92,GB50010N,,,EC8-94

! Preprocessor
  /PREP7

! Material Definition
 ~CFMP,1,LIB,CONCRETE,GB50010,C30
 ~CFMP,2,LIB,REINF,GB50010,HPB300

! Element Type Definition
  ET,1,Beam3                            ! Element Type 1: 2D Beam

! Cross-section definition
 ~CSECDMS,1,BOX,1,0.85,1.2,0.2,0.15
! Reinforcement definition
 ~RNFDEF,1,1,2,4,0,0.05,1E-3      
! Beam & Shell property
 ~BMSHPRO,1,BEAM,1,1,,,3,1,0,,Beam property

! Model Construction
  N,1                                   ! Nodes input
  N,5,5
  FILL,1,5
  E,1,2                                 ! Elements input
  EGEN,4,1,1,1
  D,1,ALL                               ! Boundary conditions

/SOLU
  M=1490              ! 1490 kN*m vertical lumped force
  H=-100              ! 100 kN compression axial force
  F,5,FX,H
  F,5,MZ,M
  SOLVE               ! Calculation

/POST1

! Postprocessor
  ~CFSET,,1,1       ! Read first load step

! Bending + Axial design for box sections according to GB50010-2010
  ~DIMCON,2DB,,,1,10 

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp = 2
  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) = 'CRT_TOT'
  LABEL(2,1) = 'REINFACT'

! Correct values
  VALUE(1,1)=1.0
  VALUE(2,1)=7.4

! Comparison
 ~PLLSCON,CRT_TOT
 *GET,VALUE(1,2),ELEM,4,ETAB,CFETAB_I
 ~PLLSCON,REINFACT
 *GET,VALUE(2,2),ELEM,4,ETAB,CFETAB_J

! Warning and error tolerances
  TOLER( 1, 1)= 1E-2 $ TOLER( 1, 2)= 1E-2
  TOLER( 2, 1)= 1E-2 $ TOLER( 2, 2)= 1E-2

!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC
