m_mesh.py
- class m_mesh.MeshModule
Bases:
object- create_mesh()
Creates a rectangular mesh with a bottom left point at \((x,y) = (0,0)\) and a top right point at \((x,y) = (\)
length,height\()\).
- define_boundaries()
Defines and numbers the top (1), bottom (2), left (3) and right (4) boundaries of the rectangular domain.
- m_mesh.count_nodes(bound_mesh)
Counts the nodes at the top boundary for
m_mesh.detect_oscillations().
- m_mesh.detect_oscillations(mesh, bound_mesh, diff_coef, x_div_top)
Goes through the top boundary nodes one by one from left to right monitoring the slope between individual nodes.
- Parameters:
mesh – mesh
bound_mesh – boundary mesh
diff_coef – the topography diffusion coefficient
x_div_top – number of nodes at the top boundary (including both corner poitns)
- Returns:
The diffusion coefficient function on the mesh.
Tip
For extensional simulation the smoothing is optional, but for compressional simulations it is strongly recommended.
Warning
In order to work properly, the nodes at the top boundary need to be equidistant (i.e., not refined or refined along the whole length).
- m_mesh.save_topography(bound_mesh, name, q_ice, q_water, step)
If applicable (i.e., the respective free surface boundary conditions are active), saves the coordinates of the top and bottom boundary nodes into
data_name/topography/. Other properties (heat flux, velocity) can be added.
- m_mesh.write_topography_file(file, all_topography_bot, j)
An auxilliary function for
m_mesh.save_topography().