# neatmesh
Mesh Quality Inspector
[![build](https://github.com/eigemx/neatmesh/actions/workflows/build.yml/badge.svg)](https://github.com/eigemx/neatmesh/actions/workflows/build.yml)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
neatmesh is a 2D/3D finite volume mesh quality inspector and a python library that computes cells volumes, face areas, centers, normals and many more. neatmesh works with all formats supported by [meshio](https://github.com/nschloe/meshio).
neatmesh is in early active development stage, and all sort of contributions are welcome (specially if you're new to open source contribution! ☺️)
<p align="center">
<img alt="neatmesh" src="https://media.githubusercontent.com/media/eigemx/neatmesh/main/screenshots/cli.png" width="90%">
</p>
## Installation
Install with:
pip install neatmesh
## Usage
Using neatmesh is simple:
neatmesh my_awesome_mesh.su2
or
import neatmesh as nm
mesh = nm.read('my_awesome_mesh.su2')
# mesh.face_areas, mesh.face_centers, mesh.owner_neighbor,
# mesh.n_points, mesh.n_edges, mesh.n_faces, .....
## What does neatmesh report?
neatmesh will report file size, mesh bounding box, mesh dimensionality, points count, duplicate points count, face counts and types, cell counts and types, and the following quality statistics
1. **Face Area**: face area in mesh units.
2. **Face Aspect Ratio**: ratio between max. and min. length of face bounding rectangle.
3. **Cell Volume**: volume of 3D cell, current supported cell types: hexahedron, tetrahedron, wedge and pyramid.
4. **Non-Orthogonality**: angle in degrees between (a) vector connecting two elements centers NP and (b) normal vector to the shared face or edge between the elements
![Non-ortho example](https://media.githubusercontent.com/media/eigemx/neatmesh/main/screenshots/nonortho.png)
Source: [Introduction to Computational Fluid Dynamics: Governing Equations, Turbulence Modeling Introduction and Finite Volume Discretization Basics. - Joel Guerrero](https://www.researchgate.net/publication/280385280_Introduction_to_Computational_Fluid_Dynamics_Governing_Equations_Turbulence_Modeling_Introduction_and_Finite_Volume_Discretization_Basics)
5. **Neighbor Element Volume/Area Ratio**: ratio between the volume (for 3D mesh) or area (for 2D mesh) of all neighboring cells, defined as `max_vol / min_vol` or `max_area / min_area`, so it's always greater than or equal 1.
### Quality Rules
neatmesh will look for a quality rule file in current working directory, `neatmesh.toml` or `quality.toml` or `my_awesome_mesh.toml`. A quality rule file sets maximum values for quality metrics calculated by neatmesh, for example this is the content of a typical `neatmesh.toml` file:
max_non_orhto = 50
max_face_aspect_ratio = 10
max_neighbor_volume_ratio = 3
max_neighbor_area_ratio = 3
In case no quality rules file was present, neatmesh will use default max. values:
max_non_orhto = 60
max_face_aspect_ratio = 20
max_neighbor_volume_ratio = 15
max_neighbor_area_ratio = 15
Raw data
{
"_id": null,
"home_page": "https://github.com/eigemx/neatmesh",
"name": "neatmesh",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "",
"keywords": "mesh,scientific,engineering,fvm,fem,finite volume,finite element",
"author": "Mohamed Emara",
"author_email": "mae.emara@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/b9/de/b81434a8d554c64e9e2c3bc7dbe55557f4c7de5443a608c31945ea3941dc/neatmesh-0.0.8.tar.gz",
"platform": null,
"description": "# neatmesh\r\nMesh Quality Inspector\r\n\r\n[![build](https://github.com/eigemx/neatmesh/actions/workflows/build.yml/badge.svg)](https://github.com/eigemx/neatmesh/actions/workflows/build.yml)[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\r\n\r\n\r\nneatmesh is a 2D/3D finite volume mesh quality inspector and a python library that computes cells volumes, face areas, centers, normals and many more. neatmesh works with all formats supported by [meshio](https://github.com/nschloe/meshio).\r\n\r\nneatmesh is in early active development stage, and all sort of contributions are welcome (specially if you're new to open source contribution! \u263a\ufe0f)\r\n\r\n<p align=\"center\">\r\n <img alt=\"neatmesh\" src=\"https://media.githubusercontent.com/media/eigemx/neatmesh/main/screenshots/cli.png\" width=\"90%\">\r\n</p>\r\n\r\n\r\n## Installation\r\nInstall with:\r\n\r\n pip install neatmesh\r\n\r\n## Usage\r\nUsing neatmesh is simple:\r\n\r\n neatmesh my_awesome_mesh.su2\r\n\r\nor\r\n\r\n import neatmesh as nm\r\n \r\n mesh = nm.read('my_awesome_mesh.su2')\r\n # mesh.face_areas, mesh.face_centers, mesh.owner_neighbor,\r\n # mesh.n_points, mesh.n_edges, mesh.n_faces, ..... \r\n \r\n## What does neatmesh report?\r\nneatmesh will report file size, mesh bounding box, mesh dimensionality, points count, duplicate points count, face counts and types, cell counts and types, and the following quality statistics\r\n1. **Face Area**: face area in mesh units.\r\n2. **Face Aspect Ratio**: ratio between max. and min. length of face bounding rectangle.\r\n3. **Cell Volume**: volume of 3D cell, current supported cell types: hexahedron, tetrahedron, wedge and pyramid.\r\n4. **Non-Orthogonality**: angle in degrees between (a) vector connecting two elements centers NP and (b) normal vector to the shared face or edge between the elements \r\n\r\n![Non-ortho example](https://media.githubusercontent.com/media/eigemx/neatmesh/main/screenshots/nonortho.png)\r\n\r\nSource: [Introduction to Computational Fluid Dynamics: Governing Equations, Turbulence Modeling Introduction and Finite Volume Discretization Basics. - Joel Guerrero](https://www.researchgate.net/publication/280385280_Introduction_to_Computational_Fluid_Dynamics_Governing_Equations_Turbulence_Modeling_Introduction_and_Finite_Volume_Discretization_Basics)\r\n\r\n5. **Neighbor Element Volume/Area Ratio**: ratio between the volume (for 3D mesh) or area (for 2D mesh) of all neighboring cells, defined as `max_vol / min_vol` or `max_area / min_area`, so it's always greater than or equal 1.\r\n\r\n### Quality Rules\r\nneatmesh will look for a quality rule file in current working directory, `neatmesh.toml` or `quality.toml` or `my_awesome_mesh.toml`. A quality rule file sets maximum values for quality metrics calculated by neatmesh, for example this is the content of a typical `neatmesh.toml` file:\r\n\r\n max_non_orhto = 50\r\n max_face_aspect_ratio = 10\r\n max_neighbor_volume_ratio = 3\r\n max_neighbor_area_ratio = 3\r\n\r\nIn case no quality rules file was present, neatmesh will use default max. values:\r\n\r\n max_non_orhto = 60\r\n max_face_aspect_ratio = 20\r\n max_neighbor_volume_ratio = 15\r\n max_neighbor_area_ratio = 15\r\n\r\n",
"bugtrack_url": null,
"license": "",
"summary": "Finite Volume Mesh Quality Inspector",
"version": "0.0.8",
"split_keywords": [
"mesh",
"scientific",
"engineering",
"fvm",
"fem",
"finite volume",
"finite element"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "c9194e51e6e79bafa69cdc39db18d417da3dc72fe463f32475da8884eb2c3ea2",
"md5": "8168004ac24ba0ec19a68c4ddb2bb5cb",
"sha256": "8a170d4ce89848dd0dcef1ec6b1841c91d41598c7596e67cf3396b4ee88c12e7"
},
"downloads": -1,
"filename": "neatmesh-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8168004ac24ba0ec19a68c4ddb2bb5cb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 17390,
"upload_time": "2023-04-23T01:19:31",
"upload_time_iso_8601": "2023-04-23T01:19:31.477000Z",
"url": "https://files.pythonhosted.org/packages/c9/19/4e51e6e79bafa69cdc39db18d417da3dc72fe463f32475da8884eb2c3ea2/neatmesh-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b9deb81434a8d554c64e9e2c3bc7dbe55557f4c7de5443a608c31945ea3941dc",
"md5": "5fb406b80dd99d7cba958f41febcfe61",
"sha256": "938d92debf1f584b940f1703e6bd18204028938e11d777a861e61c9d925ff1bc"
},
"downloads": -1,
"filename": "neatmesh-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "5fb406b80dd99d7cba958f41febcfe61",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 18314,
"upload_time": "2023-04-23T01:19:34",
"upload_time_iso_8601": "2023-04-23T01:19:34.523470Z",
"url": "https://files.pythonhosted.org/packages/b9/de/b81434a8d554c64e9e2c3bc7dbe55557f4c7de5443a608c31945ea3941dc/neatmesh-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-04-23 01:19:34",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "eigemx",
"github_project": "neatmesh",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "neatmesh"
}