Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mesh Generation for Computational Science in Python

I have a need for a Python module/package that provides a mesh on which I can do computational science? I am not doing graphics, so I don't think the blender package is what I want.

Does anyone know of a good package?

like image 481
jlconlin Avatar asked Nov 02 '11 03:11

jlconlin


People also ask

How is mesh generation used for computational domains?

Mesh generation is the practice of creating a mesh, a subdivision of a continuous geometric space into discrete geometric and topological cells. Often these cells form a simplicial complex. Usually the cells partition the geometric input domain. Mesh cells are used as discrete local approximations of the larger domain.

What is a computational mesh?

A computational mesh topology has a hierarchical system whereby higher topology assumes the existence of the topologies beneath it (Fig. 4.1). For example, the creation of a volume cell automatically inherits the lower topologies (i.e. a volume cell contains face, line and vertex structures).

What is mesh algorithm?

A meshing algorithm can ideally define the shape and distribution of the elements. A vital step of the finite element method for numerical computation is mesh generation algorithms. A given domain is to be partitioned into simpler 'elements.


2 Answers

The most useful packages out there are perhaps

  • mshr,
  • pygalmesh,
  • dmsh,
  • pygmsh, and
  • MeshPy,
  • meshzoo.

In addition, there is optimesh for improving the quality of any mesh.

(Disclaimer: I'm the author of pygmsh, pygalmesh, dmsh, meshzoo, and optimesh.)

like image 103
Nico Schlömer Avatar answered Sep 23 '22 05:09

Nico Schlömer


If you're trying to solve FE or CFD style equations on a mesh you can use MeshPy in 2 and 3 dimensions. Meshpy is a nice wrapper around the existing tools tetgen and triangle.

If you're looking for more typical graphics style meshes, there was an interesting talk at PyCon 2011 "Algorithmic Generation of OpenGL Geometry", which described a pragmatic approach to procedural mesh generation. The code from the presentation is available online

If you're interested in reconstruction of surfaces from data, you can't go past the Standford 3D Scanning Repository, home of the Stanford Bunny

Edit:

A dependancy free alternative may be to use something like gmsh, which is platform independent, and uses similar tools to meshpy in its back-end.

like image 26
Andrew Walker Avatar answered Sep 25 '22 05:09

Andrew Walker