vertices-to-h5m

Converts mesh vertices and connectivity to h5m geometry files compatible with DAGMC simulations

https://github.com/fusion-energy/vertices_to_h5m

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary

Keywords

coordinates dagmc h5m mesh neutronics triangles vertices
Last synced: 6 months ago · JSON representation ·

Repository

Converts mesh vertices and connectivity to h5m geometry files compatible with DAGMC simulations

Basic Info
  • Host: GitHub
  • Owner: fusion-energy
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 411 KB
Statistics
  • Stars: 3
  • Watchers: 1
  • Forks: 2
  • Open Issues: 4
  • Releases: 10
Topics
coordinates dagmc h5m mesh neutronics triangles vertices
Created over 3 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License Citation

README.md

N|Python

CI with install

CI with examples

Upload Python Package anaconda-publish

conda-publish PyPI

This is a minimal Python package that provides a Python API interfaces for converting mesh vertices into a DAGMC h5m file ready for use in simulation.

Convert a set of vertices with their connectivity in to a DAGMC h5m file complete with material tags and ready for use neutronics simulations.

warning this approach does not imprint and merge the geometry and therefore requires that the mesh is well formed and does not overlap. Overlaps could lead to particles being lost during transport. If imprinting and merging is required consider using Paramak exportdagmch5m() method or cad-to-h5m to make the DAGMC geometry.

It is strongly advised to used the DAGMC overlap checker to check the resulting h5m file (see checking for overlaps section below).

Installation - Conda

This single line command should install the package and dependencies (including moab).

bash conda install -c fusion-energy -c conda-forge vertices_to_h5m

Installation - Pip + Conda

These two commands should install the package and dependencies. Moab requires a separate install as it is not available on pip

bash conda install -c conda-forge moab pip install vertices_to_h5m

Examples

These examples with volumes made from just four triangles to keep the examples minimal. The package can also convert larger meshes as shown in the picture below.

Usage - single volume

To convert a single volume mesh into a h5m file. This also tags the volume with the material tag mat1.

```python from verticestoh5m import verticestoh5m import numpy as np

these are the x,y,z coordinates of each vertex. Entries should be floats

vertices = np.array( [ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0], ] )

These are the triangle that connect individual vertices together to form a continious surface and also a closed volume. Entries should be ints

triangles = [ np.array([[0, 1, 2], [3, 1, 2], [0, 2, 3], [0, 1, 3]]), ]

This will produce a h5m file called one_volume.h5m ready for use with DAGMC enabled codes.

verticestoh5m( vertices=vertices, triangles=triangles, materialtags=["mat1"], h5mfilename="one_volume.h5m", ) ```

single_volume

Usage - multiple volumes

To convert multiple mesh volumes files into a h5m file. This also tags the relevant volumes with material tags called mat1 and mat2. This example also uses numpy arrays instead of lists, both are acceptable.

```python from verticestoh5m import verticestoh5m import numpy as np

These are the x,y,z coordinates of each vertex. Numpy array is set to type float to enforce floats

vertices = np.array( [[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1], [1, 1, 0]], dtype="float64" )

These are the two sets triangle that connect individual vertices together to form a continious surfaces and also two closed volume.

triangles = [ np.array([[0, 1, 2], [3, 1, 2], [0, 2, 3], [0, 1, 3]]), np.array([[4, 5, 1], [4, 5, 2], [4, 1, 2], [5, 1, 2]]), ]

This will produce a h5m file called twovolumetouching_edge.h5m ready for use with DAGMC enabled codes

verticestoh5m( vertices=vertices, triangles=triangles, materialtags=["mat1", "mat2"], h5mfilename="twovolumetouching_edge.h5m", )

``` two_volumes

Checking for overlaps

To check for overlaps in the resulting h5m file one can use the DAGMC overlap checker. -p is the number of points to check on each line

bash conda install -c conda-forge overlap_check dagmc.h5m -p 1000

Owner

  • Name: Fusion Energy
  • Login: fusion-energy
  • Kind: organization

A collection of software projects related to fusion energy

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Shimwell"
  given-names: "Jonathan"
  orcid: "https://orcid.org/0000-0001-6909-0946"
title: "Vertices_to_h5m - Converts mesh vertices and connectivity to h5m geometry files compatible with DAGMC simulations."
version: 0.1.0
date-released: 2022-8-4
url: "https://github.com/fusion-energy/vertices_to_h5m"

GitHub Events

Total
Last Year

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 53
  • Total Committers: 2
  • Avg Commits per committer: 26.5
  • Development Distribution Score (DDS): 0.132
Top Committers
Name Email Commits
Jonathan Shimwell m****l@j****m 46
shimwell s****l@u****m 7
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 4
  • Total pull requests: 14
  • Average time to close issues: about 12 hours
  • Average time to close pull requests: about 1 hour
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • shimwell (4)
Pull Request Authors
  • shimwell (10)
  • nschloe (4)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 349 last-month
  • Total dependent packages: 2
  • Total dependent repositories: 0
  • Total versions: 9
  • Total maintainers: 2
pypi.org: vertices-to-h5m

Converts mesh vertices and connectivity to h5m geometry files compatible with DAGMC simulations

  • Versions: 9
  • Dependent Packages: 2
  • Dependent Repositories: 0
  • Downloads: 349 Last month
  • Docker Downloads: 0
Rankings
Dependent packages count: 1.9%
Downloads: 11.4%
Average: 17.8%
Forks count: 19.6%
Stargazers count: 25.5%
Dependent repos count: 30.6%
Maintainers (2)
Last synced: 6 months ago

Dependencies

.github/workflows/anaconda-publish.yml actions
  • actions/checkout v2 composite
.github/workflows/black.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • stefanzweifel/git-auto-commit-action v4 composite
.github/workflows/ci_with_examples.yml actions
  • actions/checkout v2 composite
.github/workflows/ci_with_install.yml actions
  • actions/checkout v2 composite
.github/workflows/conda-build-test.yml actions
  • actions/checkout v2 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.devcontainer/Dockerfile docker
  • mcr.microsoft.com/vscode/devcontainers/miniconda 0-3 build
pyproject.toml pypi
setup.py pypi