!*************************************************************************************!
! TITLE: CFVR9177 - Bending + Axial force checking according to ACI 318 19
! SUBTITLE: Check this equivalent reinforced concrete beam, subjected to Bending + Axial force 
! SUBTITLE: according to ACI 318 19, simulating a 1x1 m2 shell.
!
! DESCRIPTION: A fixed beam which has a rectangular reinforced concrete section is subjected to
! DESCRIPTION: a list of axial forces and beding moments, in Z axis, from the CFVR9177.FM file
! DESCRIPTION:
! DESCRIPTION: The aim of the example is to obtain the check criterion according to ACI 318 19.
! DESCRIPTION: A spiral reinforcement will be disposed
! DESCRIPTION:
! DESCRIPTION: CFVR9177.FM file is needed to run this test case.
! ELEMENT TYPE: BEAM3
! MODULES:
! UNITS: SI
! KEYWORD1: Equivalent Beam
! KEYWORD2: Spiral reinforcement
! KEYWORD3: Code Checking
! KEYWORD4: Reinforced Concrete
! KEYWORD5: ACI 318 19
! KEYWORD5: Interaction diagram
!*************************************************************************************!
   FINISH
  ~CFCLEAR,,1
   NomFile='CFVR9177'
 /TITLE,%NomFile%, BENDING + AXIAL FORCE CHECKING ACCORDING TO ACI 318 19

! --------------------------------------------------------------------
! Initial data
! --------------------------------------------------------------------
! CivilFEM SETUP
 ~UNITS,SI    !m,s,Newton
 ~CODESEL,EC3-05,ACI_19

h=1.0      ! Height
b=1.0    ! Width

NELEM=30    !Number of elements the beam will be divided into

! 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,1.000E-06,10.000E-03, , , , , ,        	 ! 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,NELEM+1,1
  FILL,1,NELEM+1
  E,1,2                                 ! Elements input
  EGEN,NELEM,1,1,1
  D,1,ALL                               ! Boundary conditions

/SOLU

  SOLVE               ! Calculation

/POST1

! Postprocessor
  ~CFSET,,1,1       ! Read first load step
  
  ~FMREAD,CFVR9177,FM   !File from which diagram points will be taken

! Bending + Axial checking for rectangular sections according to ACI
~CHKCON,2DB, ,0,0,0,1      !Spiral reinforcement

*DO,JJ,1,NELEM
! Plot interaction diagram
  ! /wait,2
  ! ~PL2DINT,BEAM,JJ,I,,,,,,MZ

  ! ~PL2DINT,BEAM,JJ,J,,,,,,MZ
*ENDDO

!--------------------------------------------------------------------------------------
! DATA CHECK
!--------------------------------------------------------------------------------------
! Data comparison number
  NComp = NELEM
  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
*DO,JJ,1,NELEM
  LABEL(JJ,1) = 'CRTC2D_I'
*ENDDO
 
! Correct values
*DO,JJ,1,NELEM
  VALUE(JJ,1)=1.00
*ENDDO

! Comparison
 ~CFSET,1 ! ALT 1
*DO,JJ,1,NELEM
 ~CFGET,VALUE(JJ,2), ELEMENT, JJ ,RESULT , CRT_TOT, I 
*ENDDO

! Warning and error tolerances
*DO,JJ,1,NELEM
 TOLER(JJ,1)= 0.01*VALUE(JJ,1) $ TOLER(JJ,2)= 0.01*VALUE(JJ,1)
*ENDDO

  
!--------------------------------------------------------------------------------------
! Results comparison
!--------------------------------------------------------------------------------------
  COMPARA.MAC
