Hermes2D: Example 01 (12/01/2009)

226 days ago by skregmi

The following text box contains the main code which you can easily modify and evaluate. First click on "Edit this" link on the upper left corner and wait for the browser response. Then click on the input text box to see an "Evaluate" link appear at its bottom. Click on this "Evaluate" link to have the code sent to our computer and interpreted. Have fun and let us know at femhub@googlegroups.com with any problems or questions.

The Code:

# Hermes2D: Example 01 (mesh) # This example shows how to create a mesh. from hermes2d import Mesh, MeshView mesh = Mesh() # Creates a mesh from a list of nodes, elements, boundary and nurbs. mesh.create([ [0, -1], [1, -1], [-1, 0], [0, 0], [1, 0], [-1, 1], [0, 1], [0.707106781, 0.707106781] ], [ [0, 1, 4, 3, 0], [3, 4, 7, 0], [3, 7, 6, 0], [2, 3, 6, 5, 0] ], [ [0, 1, 1], [1, 4, 2], [3, 0, 4], [4, 7, 2], [7, 6, 2], [2, 3, 4], [6, 5, 2], [5, 2, 3] ], [ [4, 7, 45], [7, 6, 45] ]) # Display the Mesh mview = MeshView() mview.show(mesh, lib="mpl", method="orders", notebook=True) mview.wait()