Skip to main content

A library for material discovery

Project description

MatEngine

MatEngine is a Python library designed for the engineering and scientific community focused on materials science. When fully developed, it will facilitate material discovery through micro to macrostructural generation and characterisation through simulation.

Features:

  • Material Generation: Tools to generate material structures at various scales
    • random field generation
    • plurigaussian simulation
    • plotting functionality

NB: MatEngine is currently in development, and as such, the feature list will continue to be updated

Quick Start

Below is an example of how to generate a discrete two-phase structure with plurigaussian simulation

from matengine.generation.generators import random_field, create_covariance_model
from matengine.generation.decisiontree import decision_tree, ellipse
from matengine.generation.plurigaussian import plurigaussian_simulation
from matengine.utils.plotting import array_to_vtk

dim = [50,50]
ls=5
var=1
kernel = 'gau'
seed1 = 123
seed2 = 1234
mdl = create_covariance_model(kernel, dim, var, ls)
z1 = random_field(mdl, dim, seed=seed1)
z2 = random_field(mdl, dim, seed=seed2)
fields = [z1, z2]

Config = {
    'root': {
        'type': 'decision',
        'func': ellipse,
        'args': {
            'key1': 'Z1',
            'key2': 'Z2',
            'cx': 0,
            'cy': 0,
            'sx': 2.6,
            'sy': 0.3
        },
        'yes_branch': 'phase1',
        'no_branch': 'phase0'
    },
    'phase0': {
        'type': 'leaf',
        'action': 0
    },
    'phase1': {
        'type': 'leaf',
        'action': 1
    },
}

tree_config = Config

tree = decision_tree()
tree.build_tree(tree_config)

L, P = plurigaussian_simulation(dim, tree, fields, ldim=500)

array_to_vtk(L, 'L')
array_to_vtk(P, 'P')

Documentation

Click here

License

MatEngine is made available under the MIT License, allowing for liberal reuse and modification for both academic and commercial purposes.

Contact

For support, feedback, or inquiries, please contact via email: rickettse1@cardiff.ac.uk

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

matengine-0.0.8.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

matengine-0.0.8-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file matengine-0.0.8.tar.gz.

File metadata

  • Download URL: matengine-0.0.8.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for matengine-0.0.8.tar.gz
Algorithm Hash digest
SHA256 58932980d6f36fe30da7a9519c6b367a5315e7c4a9d2e273a9de3745b2b46801
MD5 a4073d5d4237fe56dc0903ea9a836cf7
BLAKE2b-256 e3c7f64b17c2812e7d16da2c6b8a3e31b1b442dabb82deedfa6fe03ab0811361

See more details on using hashes here.

File details

Details for the file matengine-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: matengine-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for matengine-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 8e1a1fafd109f7ed0299f0e6e6abf141d7b1e392e6ec2123e318f90e0b270b5f
MD5 699d9adc467c1166a9f4e3f953b26381
BLAKE2b-256 a0a52e60b8f300b09e9728c611105691bc5c2763155f3b4323b9ef246abfe207

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