# Test goal: 3D linear elastic simple loading problem.
# Author: Pavel Exner
# Source for reference:
#
# prescribing initial stress acts as body load equal to div(initial_stress):
#
# (symmetric) initial_stress:
#    ( x  2(x+y)  3(x+y) )    ( 1 + 2 + 3 )   (  6 )
# div|      4y    5(y+z) |  = | 2 + 4 + 5 | = | 11 |
#    (             6z    )    ( 3 + 5 + 6 )   ( 14 )
#
# reference is the solution of problem with body load: [6, 11, 14]
# (note that we must add the initial stress to the reference stress to get equality)
# (checked in paraview - diff up to 1e-14)

flow123d_version: 3.1.0
problem: !Coupling_Sequential
  description: 3D linear elastic simple loading problem.
  mesh:
    mesh_file: ../00_mesh/cube_2x2x2.msh
  flow_equation: !Coupling_Iterative
    input_fields:
      - region: BULK
        biot_alpha: 0
        fluid_density: 1
        gravity: 0
    time:
      end_time: 1
    a_tol: 1e-15
    r_tol: 1e-12

    flow_equation: !Flow_Darcy_LMH
        gravity: [0,0,0]
        input_fields:
          - region: BULK
            conductivity: 1
            init_pressure: 0
          - region: [.BOUNDARY ]
            bc_type: dirichlet
            bc_pressure: 0
        output:
          fields: []

    mechanics_equation:
        output_stream:
          file: mechanics.pvd
          format: !vtk
        output:
          fields:
            - displacement
            - stress
            - displacement_divergence
            - initial_stress
        solver: !Petsc
          a_tol: 1e-20
          r_tol: 1e-15
        input_fields:
          - region: BULK
            young_modulus: 80
            poisson_ratio: 0.2

            initial_stress: !FieldFormula
              value: [[x, 2*(x+y), 3*(x+z)], [2*(x+y), 4*y, 5*(y+z)], [3*(x+z), 5*(y+z), 6*z]]
            # replace initial_stress with corresponding load for reference
            #load: [6, 11, 14]

          - region: [.left_x, .right_x, .front_y, .back_y]
            bc_type: displacement_n
            bc_displacement: 0

          - region: [.bottom_z]
            bc_type: displacement
            bc_displacement: 0

          - region: .top_z
            bc_type: traction
            bc_traction: [0,0,-10]
