Skip to main content

Lattice unitcell geometry and analysis framework

Project description

UnitcellEngine

[!WARNING] This is alpha software that is in active development and is likely to experience breaking changes.

UnitcellEngine is part of the UnitcellHub software ecosystem, providing functionality to generate and simulate lattice unitcell geometries. Written fully in Python, it brings together state-of-the-art technology like implicit geometry representation, meshless finite element analysis, and homogenization theory, to provide an automated yet robust pipeline.

Installation

UnitcellEngine only supports Python 3. If running on a Windows machine, you may sometimes need to first install Microsoft Visual C++ for some of the dependencies to install correctly (such as number and scikit-learn). See https://visualstudio.microsoft.com/visual-cpp-build-tools/ for details on how to install the Windows C++ Build Tools; additionally, due to performance limitations of the openblas-based installation of numpy via pip, it is recommended that conda be used to setup the base numpy/scipy environment.

For the current stable release

pip install unitcellengine

Examples

UnitcellEngine has a range of built-in lattice geometry forms, including graph-style (such as beam and plate) and thin walled Triply Periodic Minimal Surface (TPMS) lattices. The general workflow is to define the unitcell, generate the geometry, generate the mesh, and solve the relevant homogenization problems. Each step of the process calculates relevant quantities and stores them in output files that feed into subsequent calculations (for example, a mesh file is required before a homogenization can be run).

from unitcellengine.design import UnitcellDesign, UnitcellDesigns
import numpy as np

# Set numpy precision to allow for better printout of homogenized matrices
np.set_printoptions(precision=4)

# Define unitcell
design = UnitcellDesign('Octet', 1, 1, 1, thickness=0.1)

# The default behavior is to reuse existing date. Set to False to force regeneration.
reuse = True

# Generate geometry (which calculated propertes like relative denstiy and relative surface area)
design.generateGeometry(reuse=reuse)

# Generate mesh
design.generateMesh(reuse=reuse)

# Calculate homogenized elastic properties
design.homogenizationElastic.run(reuse)

# Post process homogenization results
design.homogenizationElastic.process()

# Calculate homogenized conductance properties
design.homogenizationConductance.run(reuse)

# Post process conductance results
design.homogenizationConductance.process()

# Print the homogenizated stiffness matrix
print(design.homogenizationElastic)
print(design.homogenizationConductance)

The results are by default stored in the folder structure "Database///<LX_XXX_WY_YYY_HZ_ZZZ_TU_UUU>", where is either "graph" or "walledtpms", "unicell type" is the unitcell type, and "<LX_XXX_WY_YYY_HZ_ZZZ_TU_UUU>" is a folder with the Length, Width, Height, and Thickness properties of the lattice. For example, in the case above, it will store the results in "Database/graph/Octet/L1_000_W1_000_H1_000_T0_100".

For more usage examples, see examples/examples.ipynb.

High Performance Computing and remote Linux servers

When running on remote systems, there are a few features that don't work straight out of the box. If geometry rendering is required (which relies on VTK), additional utitilies will likely need to be installed.

CENTOS and RH systems without root privileges

Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb frame buffer using virtual memory. Install xvfb following the steps defined here: https://stackoverflow.com/questions/36651091/how-to-install-packages-in-linux-centos-without-root-user-with-automatic-depen. Note, on most HPC systems, these files should be installed on a high performance file system rather than a network drive.

In addition to xvfb, you will need to install the OpenGL libraries "mesa-libGL" and "mesa-libGL-devel" using the same steps as for xvfb. In some cases, you might still get an "GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES" error. In this case, add the following environmental variable

export MESA_GL_VERSION_OVERRIDE=3.2

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

unitcellengine-0.0.9.tar.gz (91.3 MB view details)

Uploaded Source

Built Distribution

unitcellengine-0.0.9-py3-none-any.whl (121.2 kB view details)

Uploaded Python 3

File details

Details for the file unitcellengine-0.0.9.tar.gz.

File metadata

  • Download URL: unitcellengine-0.0.9.tar.gz
  • Upload date:
  • Size: 91.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.4.27

File hashes

Hashes for unitcellengine-0.0.9.tar.gz
Algorithm Hash digest
SHA256 ee558915e45c270533d61a62c237b63323764096696d5e37f798ca691dc5db3b
MD5 d2d66aeb510f93e8371c5b80e018e111
BLAKE2b-256 0079dd61edf2af8092a2ba90d3e4ca700a818aa8a4e4ce5b201d743e16c12285

See more details on using hashes here.

File details

Details for the file unitcellengine-0.0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for unitcellengine-0.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 c19b91d308a91fd478988dac6d5be23342d8538885d9e6e9ba3888fe5bbac250
MD5 ab18c289bccb05d425580cffebb12148
BLAKE2b-256 4750d4d5d449e885773360ad9a4792837cb2fec876b9d52b618dd45199306529

See more details on using hashes here.

Supported by

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