#################
# Test goal: Native output of DG transport concentration
# Author: Pavel Exner
# Source for reference: qualitative
#   - 2D DG transport on square with 4 regions with highly different conductivity
#   - concentration transport governed only by advection and boundary condition
#   - see the test 42_square4x_DG_native_write.yaml
#   - first half period  (of test 43) is not considered
#   - the output of first half period of test 43 is read as initial condition
#   - the results must then be EXACTLY the same as the second half period of test 43
#
#   note: [PE 13.7.]
#     - setting `init_projection: false` gives exactly the same results (ndiff=0)
#     - setting `init_projection: true` gives nearly the same results (ndiff=1e-13)

flow123d_version: 3.1.0
problem: !Coupling_Sequential
  description: Benchmark - 2D DG transport on square with 4 regions with highly different conductivity
  mesh:
    mesh_file: ../00_mesh/square_4x_1x1_1080.msh
    #mesh_file: ../00_mesh/square_4x_1x1_2784.msh
    regions:
      - !Union
        name: .bc_west
        regions:
          - .bc_west1
          - .bc_west2
      - !Union
        name: .bc_east
        regions:
          - .bc_east1
          - .bc_east2

  flow_equation: !Flow_Darcy_MH
    nonlinear_solver:
      linear_solver: !Petsc
        a_tol: 1.0e-12
        r_tol: 1.0e-12
    input_fields:
      - region: [square_sw, square_ne]
        conductivity: 1
      - region: [square_nw, square_se]
        conductivity: 1e-6
      - region: .bc_west
        bc_type: dirichlet
        bc_pressure: 1
      - region: .bc_east
        bc_type: dirichlet
        bc_pressure: 0
    output:
      fields:
        - pressure_p0
        - velocity_p0
    output_stream:
      file: ./flow.pvd
      format: !vtk
        variant: ascii

  solute_equation: !Coupling_OperatorSplitting
    transport: !Solute_AdvectionDiffusion_DG
      input_fields:
        - region: BULK
          init_conc: !FieldFE
            mesh_data_file: ./ref_out/42_square4x_DG_native_write/solute/solute-000005.vtu
            field_name: A_conc
            input_discretization: native_data
          porosity: 1
        #- region: .bc_west
          #bc_type: dirichlet
          #bc_conc: 1
          #time: 0
        - region: .bc_west
          bc_type: dirichlet
          bc_conc: 0
          time: 1000000
      init_projection: false
      solver: !Petsc
        a_tol: 1.0e-12
        r_tol: 1.0e-12
    output_stream:
      file: ./solute.pvd
      format: !vtk
        variant: ascii
      times:
        - step: 200000
    substances:
      - A
    time:
      start_time: 1000000
      end_time: 2000000
    balance:
      cumulative: true
