!***********************************************************************!
! TITLE: CFVR3904 - Testing Fluxes 8 Node 3D Laplace Element
! SUBTITLE:
!
! DESCRIPTION: 	Test fluxed in nodes of a SOLID45 3D model.The model consist of
! DESCRIPTION:  three soil polyhedrons: tetrahedron, pentahedron, and a cube.
! DESCRIPTION: 	
! DESCRIPTION:  For this purpose it calculates and applies a ground pressure
! DESCRIPTION:  on the nodes of the model.
! DESCRIPTION:
! DESCRIPTION:  The example is launched with ANSYS and with CivilFEM separately.
!
! ELEMENT TYPE: SOLID45
! MODULES:
! UNITS: SI
! KEYWORD1: Material Models
! KEYWORD2: Materials
!
!***********************************************************************!
  FINISH
  ~CFCLEAR,,1
  Nomfile='CFVR3904'
  /Title, %Nomfile%, Testing Fluxes 8 Node 3D Laplace Element

~SEEPAGE,3D

/Prep7

~Cfmp,1,Lib,Soil,,Sc
~Cfmp,1,Soil,Kx,,10
~Cfmp,1,Soil,Ky,,20
~Cfmp,1,Soil,Kz,,10

N,10,10,10,10
N,20,20,10,10
N,30,20,20,10
N,40,10,20,10
N,50,10,10,20
N,60,20,10,20
N,70,20,20,20
N,80,10,20,20
E,10,20,30,40,50,60,70,80

N,100,50,10,10
N,110,60,10,10
N,15 ,60,20,10
N,120,50,10,20
N,130,60,10,20
N,25 ,60,20,20
E,100,110,15,15,120,130,25,25

N,200,10,80,10
N,210,20,80,10
N,35 ,20,90,10
N,45 ,10,80,20
E,200,210,35,35,45,45,45,45

/Solu

D,10,Head,100
D,20,Head,100
D,30,Head,100
D,40,Head,100
D,50,Head,10
D,60,Head,10
D,70,Head,10
D,80,Head,10
D,120,Head,10
D,100,Head,10
D,15 ,Head,100
D,25 ,Head,100
D,130,Head,10
D,110,Head,10
D,35 ,Head,100
D,45 ,Head,10
D,200,Head,10
D,210,Head,10

~LPSOLVE
/Post1
File,File,Seep
/Dscale,,Off
Set,1
Plnsol,Head

Etable,Fx1,smisc,1
Etable,Fx2,smisc,2
Etable,Fx3,smisc,3
Etable,Fx4,smisc,4
Etable,Fx5,smisc,5
Etable,Fx6,smisc,6

!--------------------------------------------------------------------------------------
! Data Check
!--------------------------------------------------------------------------------------
! Data Comparison Number
  Ncomp    =  18
  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) = 'e1F1'
  Label(2 ,1) = 'e1F2'
  Label(3 ,1) = 'e1F3'
  Label(4 ,1) = 'e1F4'
  Label(5 ,1) = 'e1F5'
  Label(6 ,1) = 'e1F6'
  Label(7 ,1) = 'e2F1'
  Label(8 ,1) = 'e2F2'
  Label(9 ,1) = 'e2F3'
  Label(10,1) = 'e2F4'
  Label(11,1) = 'e2F5'
  Label(12,1) = 'e2F6'
  Label(13,1) = 'e3F1'
  Label(14,1) = 'e3F2'
  Label(15,1) = 'e3F3'
  Label(16,1) = 'e3F4'
  Label(17,1) = 'e3F5'
  Label(18,1) = 'e3F6'

! Correct Values
  Value(1 ,1) = -9000.0
  Value(2 ,1) = 0.0
  Value(3 ,1) = 0.0
  Value(4 ,1) = 0.0
  Value(5 ,1) = 0.0
  Value(6 ,1) = 9000.0

  Value(7 ,1) = 0.0
  Value(8 ,1) = 18000
  Value(9 ,1) = 0.0
  Value(10,1) = 0.0
  Value(11,1) = -18000
  Value(12,1) = 0.0

  Value(13,1)= 0.0
  Value(14,1)= 9000.0
  Value(15,1)= 0.0
  Value(16,1)= 0.0
  Value(17,1)= -9000.0
  Value(18,1)= 0.0

! Obtained Values
  *Get,Value(1, 2),Element,1,Etable,Fx1
  *Get,Value(2, 2),Element,1,Etable,Fx2
  *Get,Value(3, 2),Element,1,Etable,Fx3
  *Get,Value(4, 2),Element,1,Etable,Fx4
  *Get,Value(5, 2),Element,1,Etable,Fx5
  *Get,Value(6, 2),Element,1,Etable,Fx6
  *Get,Value(7, 2),Element,2,Etable,Fx1
  *Get,Value(8, 2),Element,2,Etable,Fx2
  *Get,Value(9, 2),Element,2,Etable,Fx3
  *Get,Value(10,2),Element,2,Etable,Fx4
  *Get,Value(11,2),Element,2,Etable,Fx5
  *Get,Value(12,2),Element,2,Etable,Fx6
  *Get,Value(13,2),Element,3,Etable,Fx1
  *Get,Value(14,2),Element,3,Etable,Fx2
  *Get,Value(15,2),Element,3,Etable,Fx3
  *Get,Value(16,2),Element,3,Etable,Fx4
  *Get,Value(17,2),Element,3,Etable,Fx5
  *Get,Value(18,2),Element,3,Etable,Fx6

! Warning And Error Tolerances
  *Do,II,1,18
    Toler(II, 1)= 1E-6
    Toler(II, 2)= 1E-6
  *Enddo

!--------------------------------------------------------------------------------------
! Results Comparison
!--------------------------------------------------------------------------------------
  Compara.Mac
