Skip to main content

A convenience interface for examining,

Project description

PyDAGMC

CI

codecov

PyDAGMC is a Python interface for interacting with DAGMC .h5m files through the embedded topological relationships and metadata contained within. These interactions occur through a set of Python classes corresponding to DAGMC’s metadata Group (a grouping of volumes or surfaces), Volume, and Surface groupings in the mesh database. This interface is intended to provide a simple interface for obtaining information about DAGMC models, replacing significant boilerplate code required to perform the same queries with PyMOAB, the Python interface for MOAB itself.

PyDAGMC classes provide the ability to perform basic queries as properties of the class instances. These queries include:

  • number of entities contained within a group
  • volume and surface relationships
  • number of triangles contained underneath any class instance
  • triangle connectivity and coordinates underneath any class instance
  • movement of volumes or surfaces into and out of groups
  • VTK file generation for all triangles contained under any class instance

Example

Code:

import pydagmc

model = pydagmc.DAGModel('dagmc.h5m')

group_dict = model.groups_by_name
print(group_dict)

fuel_group = groups['mat:fuel']

v1 = fuel_group.volumes_by_id[1]

print(v1)

new_group = pydagmc.Group.create(model, name="my_new_group", group_id=10)
print(new_group)

Output:

{'picked': Group 1, Name: picked
, 'mat:fuel': Group 2, Name: mat:fuel
Volume IDs:
[1 2]
, 'mat:Graveyard': Group 0, Name: mat:Graveyard
Volume IDs:
[6]
, 'mat:41': Group 0, Name: mat:41
Volume IDs:
[3]
, 'temp:300': Group 0, Name: temp:300
Volume IDs:
[1 2 3]
}

Volume 1, 4092 triangles

Group 10, Name: my_new_group

Code:

# move volume 1 from the fuel group to the group "mat:41"
group_dict['mat:fuel'].remove_set(v1)
group_dict['mat:41'].add_set(v1)

print(group_dict['mat:fuel'])
print(group_dict['mat:41'])

Output:

Group 2, Name: mat:fuel
Volume IDs:
[2]

Group 0, Name: mat:41
Volume IDs:
[1 3]

Project details


Download files

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

Source Distribution

pydagmc-0.0.1.tar.gz (153.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pydagmc-0.0.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file pydagmc-0.0.1.tar.gz.

File metadata

  • Download URL: pydagmc-0.0.1.tar.gz
  • Upload date:
  • Size: 153.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for pydagmc-0.0.1.tar.gz
Algorithm Hash digest
SHA256 82490af1fd804a83aaf7b67252c4948ad9cc12be4c37f95ecf9f6540ddbec326
MD5 d053afb5b73dbf18e9f17f1b41c03bba
BLAKE2b-256 2efff31f634ab1133ef0ae373aa03762f3be58d5b2d3751cb7179b7c2e81f919

See more details on using hashes here.

File details

Details for the file pydagmc-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pydagmc-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for pydagmc-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c1d48d32ceecb25fb9923e0847af341966e4fdae19e610f938ad406659a839e
MD5 8af6c78331c0f3810d6858383c9f3c96
BLAKE2b-256 9e6e8b59143650c42b2234e3052b32689b2d0cd62f7560326937508441f3ebc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page