#################
# Test goal: Test of corner output interpolation.
# Author: David Flanderka
# Source for reference: qualitative

flow123d_version: 3.1.0
problem: !Coupling_Sequential
  description: GMSH output of flow and transport in D1_value (corners) interpolation
  mesh:
    mesh_file: ../00_mesh/rectangle_0.2x1_frac.msh
    regions:
      - !Union
        name: .bottom
        regions:
          - .fracture_bottom
          - .rock_bottom
      - !Union
        name: .top
        regions:
          - .fracture_top
          - .rock_top
  flow_equation: !Flow_Darcy_MH
    nonlinear_solver:
      linear_solver: !Petsc
        a_tol: 1.0e-07
    input_fields:
      - region: rock
        conductivity: !FieldFormula
          value: 0.001*(y + 1.0)
        cross_section: 1
      - region: fracture
        conductivity: 1
        cross_section: 0.01
      - region: .bottom
        bc_type: dirichlet
        bc_pressure: 1
      - region: .top
        bc_type: dirichlet
        bc_pressure: 0
    output:
      fields:
        #- { field: pressure_p0, interpolation: D1_value }
        - { field: pressure_p0, interpolation: P0_value }
        - { field: piezo_head_p0, interpolation: P1_average }
        #- { field: pressure_p2_disc, interpolation: D1_value }
        - { field: velocity_p0, interpolation: D1_value }
    output_stream:
      file: flow.msh
      format: !gmsh
  solute_equation: !Coupling_OperatorSplitting
    balance:
      cumulative: true
    substances: A
    transport: !Solute_Advection_FV
      input_fields:
        - region: .bottom
          bc_conc: 1
        - region: rock
          porosity: 0.01
        - region: fracture
          porosity: 1
      output:
        fields:
          - { field: conc, interpolation: D1_value }
    output_stream:
      file: ./transport.msh
      format: !gmsh
      times:
        - step: 0.1
    time:
      end_time: 1
  heat_equation: !Heat_AdvectionDiffusion_DG
    balance:
      cumulative: true
    input_fields:
      - region: .bottom
        bc_type: dirichlet
        bc_temperature: 1
      - region: ALL
        fluid_density: 1000.0
        fluid_heat_capacity: 5
        fluid_heat_conductivity: 1
        solid_density: 3000.0
        solid_heat_capacity: 1
        solid_heat_conductivity: 3
      - region: rock
        porosity: 0.01
      - region: fracture
        porosity: 1
    output:
      fields:
        - temperature
    output_stream:
      file: ./heat.msh
      format: !gmsh
      times:
        - step: 5
    solver: !Petsc
      a_tol: 1.0e-07
    time:
      end_time: 20
