The fc_meshtools package contains some simplicial meshes given by their vertices array and connectivity array
Project description
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, 9116), me:(3, 17638), vols:(17638,)
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, 14120), me3:(4, 67653), vols3:(67653,), G3:(67653, 3, 4) q2:(3, 6471), me2:(3, 12950), vols2:(12950,), G2:(12950, 3, 3) E=0.000000e+00
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file fc_meshtools-0.2.1.tar.gz
.
File metadata
- Download URL: fc_meshtools-0.2.1.tar.gz
- Upload date:
- Size: 20.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aac28be2b8d375ed20bcc50e1aae30bd0904e9a0c119df5c56b22daed34f54fb |
|
MD5 | f873e5b4fb542eff1df6f2193726e2c7 |
|
BLAKE2b-256 | 492906dbade9435db8ab9d1fdf343d5197b9594666737db48fa1e55c5aff3ca0 |