#################
# Test goal: Test different types of field descriptors
# Author: David Flanderka
# Source for reference: qualitative

flow123d_version: 4.0.0a01
problem: !Coupling_Sequential
  description: Test correct reading of input field descriptors
  mesh:
    mesh_file: ../00_mesh/square_0.2x0.2.msh
  # steady velocity field, with velocity v:0.1
  flow_equation: !Flow_Darcy_LMH
    nonlinear_solver:
      linear_solver: !Petsc
        a_tol: 1.0e-12
        r_tol: 1.0e-12
    input_fields:
      - region: bulk
        conductivity: 1
        cross_section: !FieldFE
          mesh_data_file: ./03_field_descriptors-000000.vtu
          field_name: cross_section
        sigma: !FieldFE
          mesh_data_file: ./03_field_descriptors-000000.vtu
          field_name: sigma
          input_discretization: native_data
      - region: .left
        bc_type: dirichlet
        bc_pressure: !FieldFE
          mesh_data_file: ../00_mesh/square_0.2x0.2.msh
          field_name: bc_pressure
          is_boundary: true
      - region: .right
        bc_type: dirichlet
        bc_pressure: !FieldFormula
          value: 0.1*X[1]
    output:
      fields:
        - pressure_p0
        #- pressure_p2_disc
        - velocity_p0
        - field: cross_section
          interpolation: Native
        - field: sigma
          interpolation: Native
    output_stream:
      file: ./test14.pvd
      format: !vtk
        variant: ascii
  solute_equation: !Coupling_OperatorSplitting
    transport: !Solute_Advection_FV
      input_fields:
        - region: ALL
          porosity: !FieldFE
            mesh_data_file: ./03_field_descriptors-000000.vtu
            field_name: porosity
          sources_sigma: !FieldFE
            mesh_data_file: ./test-descriptors.pvd
            field_name: sources_sigma
        - region: bulk
          init_conc: 0
        - region: .right
          bc_conc: !FieldTimeFunction
            time_function:
              -   - 0.0
                  - 0
              -   - 0.5
                  - 20
      output:
        fields:
          - conc
          - porosity
          - sources_sigma
    substances:
      - A
    time:
      # test forcing smaller time step then output,
      # but still larger then 0.01 necessary for capture input
      min_dt: 0.1
      max_dt: 0.1
      end_time: 1.0
    output_stream:
      file: ./transport.pvd
      format: !vtk
        variant: ascii
      times:
        - step: 0.1
      precision: 14  
    balance:
      cumulative: true
