!*************************************************************************************!
! TITLE: CFVR1603 - Active Pressure acting on 2D Beams
! SUBTITLE: Active Pressure of a terrain acting on a 2D Beams structure.
!
! DESCRIPTION: A terrain surrounds a structure made up of 2D beam elements. The purpose of this example
! DESCRIPTION: is to apply the equivalent loads of the terrain on the structural model.
! DESCRIPTION:
! DESCRIPTION: The structure is a half frame with inclined walls as shown in the figure, with a total height
! DESCRUPTION: of 2.0 m.
! DESCRIPTION:
! DESCRIPTION: The terrain is defined by a single soil material with the following parameters:
! DESCRIPTION:
! DESCRIPTION: - Friction angle between the ground and wall: 15º
! DESCRIPTION:
! DESCRIPTION: - Slope angle of the ground: 10º
! DESCRIPTION:
! DESCRIPTION: - Uniform surface load on the ground per unit of slope length: 0.1 Tn/m<sup>2</sup>
! DESCRIPTION:
! DESCRIPTION: - Ground level: 5.0 m measured from the bottom of the structure
! DESCRIPTION:
! DESCRIPTION: - Water table level: 3.0 m measured from the bottom of the structure
! DESCRIPTION:
! DESCRIPTION: - Porosity: 0.3
! DESCRIPTION:
! DESCRIPTION: - Dry specific weight 2.0 Tn/m<sup>3</sup>
! DESCRIPTION:
! DESCRIPTION: - Internal friction angle: 30º
! DESCRIPTION:
! DESCRIPTION: Active pressure is applied.
! DESCRIPTION:
!
! ELEMENT TYPE: Beam3
! MODULES: GETC
! UNITS: User
! KEYWORD1: Terrain
!*************************************************************************************!
  FINISH
  ~CFCLEAR,,1
  NomFile='CFVR1603'
  /TITLE, %NomFile%, Active Pressure acting on 2D Beams
  ~CFACTIV,GETC,Y ! Geotechnical module activation

! ---------------------------------------------------------------------------------
! Model definition
! ---------------------------------------------------------------------------------
! Civil Setup
~UNITS,,LENG,M
~UNITS,,TIME,S
~UNITS,,FORC,MP

/PREP7 ! Preprocessor
  ET,1,Beam3

  ~CFMP,2,LIB,CONCRETE,EC2,C25/30

  ~CSECDMS,1,REC,2,1,1
  ~BMSHPRO,1,BEAM,1,1,,,3,1,0

  N,1,0,0
  N,2,0,1
  N,3,0.5774,2
  E,1,2
  E,2,3
  EPLOT
  /IMAGE, SAVE, %NomFile%,BMP

  DELTA= 15        ! Friction angle between the ground and wall, in degrees
  BETA=  10        ! Slope angle of the ground, in degrees
  Q=      0.1      ! Uniform surface load on the ground per unit of slope length
  EAKCN=  0        ! Reference number of the coordinate system in which the ground is defined
  EAH=    5.0      ! Ground level next to the wall
  WKEY=   1        ! Code identifying the influence of the water
  WH=     3.0      ! Water Table
  ~CFMP,1,LIB,SOIL,,SW
  ~CFMP,1,SOIL    ,N       ,,0.3
  ~CFMP,1,SOIL    ,GAMD    ,,2.0
  ~CFMP,1,SOIL    ,PHIMCEFF,,30
  ~TERDEF,1,NEW,2,EAKCN,Y,EAH,BETA, Q, WKEY, WH, Terrain 1
  ~TERDEF,1,LAYER,1,1,1.0,0,CLMB,DELTA
  ~TERDEF,1,LAYER,2,1,2.0,0,CLMB,DELTA

  ~ETHSFE,1,ACT,1,1.0,1.0   ! Active Pressure

! ---------------------------------------------------------------------------------
! 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) ='Pn1'
  LABEL(2) ='Pt1'
  LABEL(3) ='Pn2'
  LABEL(4) ='Pt2'

! Correct Values
  VALUE( 1,1)=  5.653
  VALUE( 2,1)= -0.711
  VALUE( 3,1)=  6.107
  VALUE( 4,1)= -1.100

! Obtained values
  *GET,VALUE(1,2),ELEM,1,PRES,1
  *GET,VALUE(2,2),ELEM,1,PRES,2
  *GET,VALUE(3,2),ELEM,2,PRES,1
  *GET,VALUE(4,2),ELEM,2,PRES,2


! Warning and error tolerances
  *DO,I,1,NComp
    TOLER(I, 1)= 1E-2   $   TOLER(I, 2)= 1E-2
  *ENDDO

! ---------------------------------------------------------------------------------
! Results Comparison
! ---------------------------------------------------------------------------------
  COMPARA.MAC
