{"id":32639189,"url":"https://github.com/svalinn/dagmc_stats","last_synced_at":"2025-10-31T02:08:58.088Z","repository":{"id":37090406,"uuid":"193519789","full_name":"svalinn/dagmc_stats","owner":"svalinn","description":"Tool for calculating and reporting statistics about DAGMC models","archived":false,"fork":false,"pushed_at":"2022-06-17T12:30:49.000Z","size":7659,"stargazers_count":1,"open_issues_count":17,"forks_count":5,"subscribers_count":13,"default_branch":"main","last_synced_at":"2024-03-26T14:58:03.960Z","etag":null,"topics":["triangles","volume"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svalinn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-24T14:18:54.000Z","updated_at":"2024-03-26T14:58:03.960Z","dependencies_parsed_at":"2022-06-24T14:38:00.106Z","dependency_job_id":null,"html_url":"https://github.com/svalinn/dagmc_stats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/svalinn/dagmc_stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svalinn%2Fdagmc_stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svalinn%2Fdagmc_stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svalinn%2Fdagmc_stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svalinn%2Fdagmc_stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svalinn","download_url":"https://codeload.github.com/svalinn/dagmc_stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svalinn%2Fdagmc_stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281914569,"owners_count":26583084,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-31T02:00:07.401Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["triangles","volume"],"created_at":"2025-10-31T02:08:55.629Z","updated_at":"2025-10-31T02:08:58.083Z","avatar_url":"https://github.com/svalinn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dagmc_stats\nTool for calculating and reporting statistics about DAGMC models\n\nDependencies\n============\n\n[PyMOAB](https://press3.mcs.anl.gov/sigma/moab-library/)\n\n[NumPy](https://www.numpy.org/)\n\n[MatPlotLib](https://matplotlib.org/)\n\n[Argparse](https://docs.python.org/3/library/argparse.html)\n\nUsage\n=====\n\n`generate_stats.py` can be used to return statistics about certain parts of a mesh file, such as `.h5m` or `.vtk` files. Running `generate_stats.py` will print these statistics when it is run. There are a variety of options that can be implemented in order to individualize the statistics returned.\n\n  `python generate_stats.py [filename]`\n  \nThis base option will return all statistics that might be relevant to the file\n  \n  `python generate_stats.py [filename] -v`\n\nThe `-v` controls the verbosity of the output\n\n  `python generate_stats.py [filename] --nr --er --spv --tps --tpv --tar`\n  \nEach of the previous options controls whether a different statistical area is printed:\n  \n    `--nr` : Native Ranges\n  \n    `--er` : EntitySet Ranges\n\n    `--spv` : Surfaces per Volume\n\n    `--tps` : Triangles per Surface\n\n    `--tpv` : Triangles per Vertex\n\n    `--tar` : Triangle Aspect Ratio\n  \nThe default setting is that all statistics will be printed, so if one or more of these options are specified, the unspecified options will not be printed.\n  \n  `python generate_stats.py [filename] --tar_meshset TAR_MESHSET`\n\n`--tar_meshset` controls what meshset (or EntitySet) is used to compute the statistics for the Triangle Aspect Ratio. Default is the root set for the file. This can be a surface, volume, or the root_set.\n\n  `python generate_stats.py [filename] --spv_data, --tps_data`\n  \nThese two options control whether the actual data for Surfaces per Volume and Triangles per Surface is printed, with each entity being paired with its corrosponding value (see example below)\n\nExample Output from `generate_stats.py`\n=======================================\n\n#### `python generate_stats.py 3vols.h5m`\n  \n    Type 0 : 74130\n\n    Type 2 : 148248\n\n    Type 11 : 58\n\n    Nodes : 16\n\n    Curves : 24\n\n    Surfaces : 13\n\n    Volumes : 3\n\n    Triangles per Surface:\n\n    minimum : 2\n\n    maximum : 148224\n\n    median : 2.0\n\n    mean : 11403.692307692309\n\n    Surfaces per Volume:\n\n    minimum : 1\n\n    maximum : 6\n\n    median : 6.0\n\n    mean : 4.333333333333333\n\n    Triangles per Vertex:\n\n    minimum : 4\n\n    maximum : 386\n\n    median : 6.0\n\n    mean : 5.999514366653177\n\n    Triangle Aspect Ratio:\n\n    minimum : 1.205763046406058\n\n    maximum : 61.534011819479794\n\n    median : 1.2691552474001135\n\n    mean : 2.2629211298630483\n\n\n#### `python generate_stats.py 3vols.h5m --spv -v`\n\n    The minimum number of Surfaces per Volume in this model is 1.\n\n    The maximum number of Surfaces per Volume in this model is 6.\n\n    The median number of Surfaces per Volume in this model is 6.0.\n\n    The mean number of Surfaces per Volume in this model is 4.333333333333333.\n\n\n#### `python generate_stats.py 3vols.h5m --spv_data`\n\n    Volume                          Surfaces\n\n    12682136550675316791 (1)        6\n\n    12682136550675316792 (2)        6\n\n    12682136550675316793 (3)        1\n\n\n#### `python generate_stats.py 3vols.h5m --tar --tar_meshset 12682136550675316791`\n\n    Triangle Aspect Ratio:\n\n    minimum : 1.2071067811865475\n\n    maximum : 1.2071067811865477\n\n    median : 1.2071067811865475\n\n    mean : 1.2071067811865477\n\n  \nExplanation of Statistics Returned\n==================================\n## 1. Vertices (Type 0):\n\nVertices are mesh elements that connect triangles to one another. \n\nThe number of Vertices is returned\n\n\n## 2. Triangles (Type 2):\n\nTriangles are mesh elements that are bound by vertices. \n\nTriangles make up surfaces. \n\nThe number of Triangles is returned.\n\n\n## 3. EntitySets (Type 11):\n\nEntitySets are mesh entities that represent a geometric entity, such as a node, curve, surface, or volume. \n\nThe number of EntitySets is returned. \n\n\n## 4. Nodes:\n\nNodes are 0-D points, similar to vertices, but are geometric entities, rather than mesh. \n\nNodes bind Curves. \n\nThe number of Nodes is returned. \n\n\n## 5. Curves:\n\nCurves are 1-D geometric elements. \n\nCurves bind Surfaces and are bound by Nodes. \n\nThe number of Curves is returned. \n\n\n## 6. Surfaces:\n\nSurfaces are 2-D geometric entities that are made fundamentally up by triangles. \n\nSurfaces bind Volumes and are bound by Curves. \n\nThe number of Surfaces is returned. \n\n\n## 7. Volumes:\n\nVolumes are 3-D geometric entities. \n\nVolumes are bound by Surfaces. \n\nThe number of Volumes is returned. \n\n\n## 8. Surfaces per Volume:\n\nSurfaces per Volume is the number of surfaces each volume in the mesh contains.\n\nMinimum, Maximum, Median, and Mean (average) are returned for this statistic, as well as a distribution.\n\nThere is an option to return the EntityHandle of each Volume and its corrosponding number of Surfaces\n\n## 9. Triangles per Surface:\n\nTriangles per Surface is the number of triangles that represent each surface in a mesh.\n\nA triangle is a mesh entity, and make up larger surfaces within a mesh.\n\nMinimum, Maximum, Median, and Mean (average) are returned for this statistic, as well as a distribution.\n\nThere is an option to display the EntityHandle of each Surface and its corrosponding number of Triangles\n\n## 10. Triangles per Vertex:\n\nTriangles per Vertex is the number of triangles that connect each vertex.\n\nEach triangle connects to three vertices, but there can be many triangles on a given vertex.\n\nMinimum, Maximum, Median, and Mean (average) are returned for this statistic, as well as a distribution.\n\n\n## 11. Triangle Aspect Ratio:\n\nThis is a ratio that describes a certain triangle, and can be calculated using the equation:\n\n\u003cimg src=\"https://latex.codecogs.com/gif.latex?AR\u0026space;=\u0026space;\\frac{abc}{(s-a)(s-b)(s-c)}\" title=\"AR = \\frac{(abc)}{(s-a)(s-b)(s-c)} , s = .5(a+b+c)\" /\u003e\u003c/a\u003e \n\nwhere\n\n\u003cimg src=\"https://latex.codecogs.com/gif.latex?s\u0026space;=\u0026space;.5(a+b+c)\" /\u003e\u003c/a\u003e\n\nand a, b, and c are the side lengths of the triangle. \n\nMinimum, Maximum, Median, and Mean (average) are returned for this statistic, as well as a distribution.\n\nThere is an option for this statistic to specify a Surface or Volume to analyze.\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvalinn%2Fdagmc_stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvalinn%2Fdagmc_stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvalinn%2Fdagmc_stats/lists"}