I am trying to adapt the code from the "Toy flow-line model" tutorial for my own glacier of interest. I have surface and bed profile that I'd like to use to generate a 2-D mesh. Using the .geo file from "Toy flow-line model" tutorial as template and an edited version of the "Makegeo.py" file from the "Tête Rousse" tutorial, I can successfully create a 2-D mesh. I am able to recreate the results of "Toy flow-line model" tutorial with my mesh generation producer, so I at least know I am on the right track. I have attached a zipped folder with a minimum working example (MWE) using the "Toy flow-line model" data.

Now, when I try to adapt this code for my own surface and bed profile, I get get multiple warnings/errors raised. Mainly "ERROR:: ElementMetric: Degenerate Elements." I have also attached a zipped folder of a MWE for this input data. Here is a sample of the stdout from the model run:

Code: Select all

```
StructuredMeshMapper: Active coordinate mapping time: 1.0729999999999906E-003
FlowdepthSolver: Memory allocation done.
FlowdepthSolver: Gradient of -0.1000E+01 applied
FlowdepthSolver: Free surface variable will be calculated
ERROR:: ElementMetric: Degenerate 2D element: 3653
ElementMetric: Body Id: 1 DetG: 0.000E+00
ElementMetric: Node: 1 Coord: 3.594E+02 1.841E+03 0.000E+00
ElementMetric: Node: 2 Coord: 3.438E+02 1.838E+03 0.000E+00
ElementMetric: Node: 3 Coord: 3.438E+02 1.838E+03 0.000E+00
ElementMetric: Node: 4 Coord: 3.594E+02 1.841E+03 0.000E+00
ElementMetric: Node: 2 dCoord: -1.563E+01 -2.380E+00 0.000E+00
ElementMetric: Node: 3 dCoord: -1.563E+01 -2.380E+00 0.000E+00
ElementMetric: Node: 4 dCoord: 0.000E+00 0.000E+00 0.000E+00
ERROR:: ElementMetric: Degenerate 2D element: 3653
ElementMetric: Body Id: 1 DetG: 0.000E+00
ElementMetric: Node: 1 Coord: 3.594E+02 1.841E+03 0.000E+00
ElementMetric: Node: 2 Coord: 3.438E+02 1.838E+03 0.000E+00
ElementMetric: Node: 3 Coord: 3.438E+02 1.838E+03 0.000E+00
ElementMetric: Node: 4 Coord: 3.594E+02 1.841E+03 0.000E+00
ElementMetric: Node: 2 dCoord: -1.563E+01 -2.380E+00 0.000E+00
ElementMetric: Node: 3 dCoord: -1.563E+01 -2.380E+00 0.000E+00
ElementMetric: Node: 4 dCoord: 0.000E+00 0.000E+00 0.000E+00
```

The full .log file of the stdout is too large to attach (>5MB), but if you get it by running the MWE. Why is it that this approach works for the "Toy flow-line model" data but errors are raised for my input data? I've tried smoothing my input data so there are no sharp changes in the bed, but still run into the same problem.

Also, why is the mesh in the "Toy flow-line model" in the X-Y plane? Should it not be X-Z?

Thanks for the help,

Andrew