Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
D
dorie
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 31
    • Issues 31
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • dorie
  • dorie
  • Issues
  • #86

Closed
Open
Opened Aug 06, 2018 by Lukas Riedel@lriedelOwner

Implement new parameterization data input

Description

With the new data structures almost ready, a new data input scheme can be established. The new scheme aims at being more customizable while always ensuring that grid intersections coincide with parameterization singularities ("compatible mesh"). The latter is achieved by the data structure itself.

For the new parameter input, we generally have to discern two use cases. For both, we want to end up with a data structure that maps an entity (or its index) to the soil medium it belongs to.

  1. A (unstructured) grid is created from a GMSH file.

    GMSH supports the definition of multiple "physical" entities on a mesh. When reading the mesh file, the grid entities can be mapped to the ID of the physical entity they belong to by their index (using a Dune::Mapper).

  2. A regular (but possibly unstructured) grid is created with the GridFactory.

    In this case, we require additional input in the form of a data file. When building a grid with x \times y \times z cells, a dataset with equal dimensions and extensions is required. For each cell, it states an medium index: id = data[z][y][x]. H5 is a suitable format, and we can re-use Dorie::H5File.

Both use cases can/should encompass the usage of Python scripts: With pygmsh, one can easily write a .geo GMSH input file with Python and afterwards compile it to a mesh (this requires the GMSH CLI to be installed). Also, it's really easy to write a multi-dimensional H5 file with h5py and numpy.

For the input of the parameters themselves, we use a new file in YAML format. It specifies the name of the soil layer, its id, the parameterization type, and the parameters themselves. The hierarchical layout of YAML makes it easy to hand over sub-nodes to the respective data structures for readout.

In the first implementation, we drop Miller scaling.

Proposal

  • Remove the Parameter Field Generator

    • Install pygmsh and h5py into virtualenv
    • Recommend installing the GMSH CLI
    • Give example files and instructions on how to generate input files
  • Rework H5File to also read datasets of H5_NATIVE_INT values

  • Rework RichardsSimulation to build grid itself

    • Two modes: gmsh and regular: Read GMSH file or build grid with GridFactory
    • Create mapping from cell ids to soil medium id
    • Leave option for building RichardsSimulation with a grid instance
  • Read param.yml

    • Create RichardsParameterization instances from input file
    • Build parameter map from mapping between cells ids and medium ids
  • Adapt CLI

Use case flow chart

param.yml layout

---
sand_1: # name
  type: MvG # Mualem–van Genuchten
  index: 1 # layer index for reference
  parameters:
    alpha: -10.0
    K_0: 1E-5
    n: 
    tau:
    theta_r:
    theta_s:

my_layer:
   type: # ...
# ...

How to test the implementation?

  • tests work with new exemplary/default input files

Add test executables for

  • Reading arbitrary H5 files.
  • Correct grid cell - medium id mapping for 2D and 3D test cases, respectively.

Related issues

See #63 (closed)

Edited Aug 06, 2018 by Lukas Riedel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
v2.0 Release
Milestone
v2.0 Release
Assign milestone
Time tracking
None
Due date
None
Reference: dorie/dorie#86