!*************************************************************************************!
! TITLE: CFVR7256 - Bending + Axial force checking and design according to ACI 349 06
! SUBTITLE: Check a reinforced concrete beam subjected to Bending + Axial force according to ACI 349 06
! SUBTITLE: Design as well the reinforcement in this beam according to ACI 349 06
!
! DESCRIPTION: A fixed beam which has a rectangular reinforced concrete section is subjected to
! DESCRIPTION: an axial traction force of 2926305 N and a bending moment of 2220170 N·m in the Z axis.
! DESCRIPTION:
! DESCRIPTION: The aim of the example is to obtain the check criterion according to ACI 349 06.
! DESCRIPTION: Besides, the reinforcement factor will be get from the design analysis, according to ACI 349 06.
! DESCRIPTION: Both when checking and design, the reinforcement will not be in spiral so "Other cases" option is selected
! DESCRIPTION:
! ELEMENT TYPE: BEAM3
! MODULES:
! UNITS: SI
! KEYWORD1: Beam
! KEYWORD2: Cross Section
! KEYWORD3: Code Checking/Design
! KEYWORD4: Reinforced Concrete
! KEYWORD5: ACI 349 06
!
!*************************************************************************************!
   FINISH
  ~CFCLEAR,,1
   NomFile='CFVR7256'
 /TITLE,%NomFile%, BENDING + AXIAL FORCE CHECKING ACCORDING TO ACI 349 06

! --------------------------------------------------------------------
! Initial data
! --------------------------------------------------------------------
! CivilFEM SETUP
 ~UNITS,SI    !m,s,Newton
~CODESEL,EC3-05,ACI34906,EC2-08,,EC8-04
mc=1e-6  ! Mechanical recover
as=0.01  ! Reinforcement
h=1      ! Height
b=0.5    ! Width

! Preprocessor
  /PREP7

! Material Definition
 ~CFMP,1,LIB,CONCRETE,ACI,fc_6000
 ~CFMP,2,LIB,REINF,ACI,fy_60000

! Element Type Definition
  ET,1,Beam3                            ! Element Type 1: 2D Beam

! Cross-section definition
 ~CSECDMS,1,REC,1,h,b
! Reinforcement definition
 ~RNFDEF,1,1,2,4,0,mc,as  	 ! Bot Reinf.: Total A.: 100 cm^2

! Beam & Shell property
 ~BMSHPRO,1,BEAM,1,1,,,3,1,,,Beam property

! Model Construction
  N,1,,,                                   ! Nodes input
  N,5,1
  FILL,1,5
  E,1,2                                 ! Elements input
  EGEN,4,1,1,1
  D,1,ALL                               ! Boundary conditions

/SOLU

  M=2220170           !  Bending moment
  H=2926305           !  Axial traction force
  F,5,FX,H            
  F,5,MZ,M
  SOLVE               ! Calculation

/POST1

! Postprocessor
  ~CFSET,,1,1       ! Read first load step

! Bending + Axial checking for rectangular sections according to ACI
~CHKCON,2DB, ,0,0,0,0             !Other cases
  
! Plot interaction diagram
  ~PL2DINT,BEAM,1,I,,,,,,MZ

! Design
FINISH  
/PREP7  
~RNFMDF,1,1,AST,100.000E-06 
FINISH  
/POST1  
~DIMCON,2DB, ,0,0,200,0,0,0       !Other cases

! Summary description of the both checking and design cases
!~CFSET,LIST 

~CFSET,2,   
!Results list
!~PRCON,DETAILED,I, ,

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp = 4
  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) = 'CRTC2D_I'
  LABEL(2,1) = 'CRTC2D_J'
  LABEL(3,1) = 'REINFACT_I'
  LABEL(4,1) = 'REINFACT_J'

! Correct values
  VALUE(1,1)=1.00
  VALUE(2,1)=1.00
  VALUE(3,1)=100
  VALUE(4,1)=100
  
! Comparison
~cfset,1 ! alt 1
 ~PLLSCON,CRT_TOT
 *GET,VALUE(1,2),ELEM,4,ETAB,CFETAB_I
 ~PLLSCON,CRT_TOT
 *GET,VALUE(2,2),ELEM,4,ETAB,CFETAB_J
 
 ~cfset,2 ! alt 2
  ~PLLSCON,REINFACT
 *GET,VALUE(3,2),ELEM,4,ETAB,CFETAB_I
  ~PLLSCON,REINFACT
 *GET,VALUE(4,2),ELEM,4,ETAB,CFETAB_J

! Warning and error tolerances
 TOLER(1,1)= 0.015*VALUE(1,1) $ TOLER(1,2)= 0.015*VALUE(1,1)
 TOLER(2,1)= 0.025*VALUE(2,1) $ TOLER(2,2)= 0.025*VALUE(2,1)
 TOLER(3,1)= 0.02*VALUE(3,1) $ TOLER(3,2)= 0.02*VALUE(3,1) 
 TOLER(4,1)= 0.02*VALUE(4,1) $ TOLER(4,2)= 0.02*VALUE(4,1)
  
!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC
