Skip to main content

The fc_meshtools package contains some simplicial meshes given by their vertices array and connectivity array

Project description

http://www.math.univ-paris13.fr/~cuvelier/software/codes/Python/fc-meshtools/pyfc-meshtools_400.png

The fc_meshtools Python package contains some simplicial meshes given by their vertices array q and connectivity array me. Theses meshes can be easily used in other Python codes for debugging or testing purpose.

Introduction:

A simplicial mesh is given by its vertices array q and its connectivity array me. For demonstration purpose, some simplicial meshes are given in this package and stored in the fc_meshtools/data directory. They can be load by using the functions getMesh2D, getMesh3D or getMesh3Ds of the fc_meshtools.simplicial module. Here are the kind of simplicial meshes present in this package:

  • a triangular mesh in dimension 2, made with 2-simplices (ie. triangles),
  • a tetrahedral mesh in dimension 3, made with 3-simplices (ie. tetrahedron),
  • a triangular mesh in dimension 3 (surface mesh), made with 2-simplices,
  • a line mesh in dimension 2 or 3 made with 1-simplices (ie. lines).

One can go to the dedicated web page fc-meshtools for more informations.

Installation:

The fc_meshtools Python package is available from the Python Package Index. so to install/upgrade simply type

pip install fc_meshtools

Examples

first example

import fc_meshtools
q,me,toG=fc_meshtools.simplicial.getMesh2D(2)
vols=fc_meshtools.simplicial.Volumes(q,me)
print(' q:%s, me:%s, vols:%s'%(str(q.shape),str(me.shape),str(vols.shape)))

The output of the print command is:

q:(2, 4499), me:(3, 8584), vols:(8584,)

second example

import fc_meshtools,numpy
q3,me3=fc_meshtools.simplicial.getMesh3D(3)[:2]
vols3=fc_meshtools.simplicial.Volumes(q3,me3)
G3=fc_meshtools.simplicial.GradBaCo(q3,me3)
print(' q3:%s, me3:%s, vols3:%s, G3:%s'%(str(q3.shape),str(me3.shape),str(vols3.shape),str(G3.shape)))
q2,me2,toG2=fc_meshtools.simplicial.getMesh3D(2)
vols2=fc_meshtools.simplicial.Volumes(q2,me2)
G2=fc_meshtools.simplicial.GradBaCo(q2,me2)
print(' q2:%s, me2:%s, vols2:%s, G2:%s'%(str(q2.shape),str(me2.shape),str(vols2.shape),str(G2.shape)))
E=numpy.max(numpy.abs(q2-q3[:,toG2]))
print('E=%g'%E)

The output is:

q3:(3, 5168), me3:(4, 22234), vols3:(22234,), G3:(22234, 3, 4)
q2:(3, 3133), me2:(3, 6274), vols2:(6274,), G2:(6274, 3, 3)
E=0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fc_meshtools-0.1.1.tar.gz (670.8 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page