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.11.tar.gz (91.3 MB view details)

Uploaded Source

Built Distribution

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

unitcellengine-0.0.11-py3-none-any.whl (122.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: unitcellengine-0.0.11.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.11.tar.gz
Algorithm Hash digest
SHA256 b8336417f41db27eda72ebe3d36fad735ab63eb2570eff7c1b88b97d4eea9e16
MD5 d900446477369f79846e6da813c1864e
BLAKE2b-256 70b7db771e2c55a2328aad53255ffff3f4baa372ce79469875ea0306f7cd3189

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for unitcellengine-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 08f60870d74ac451483ac9081633f8285ac5f0aafa4832a470d75bb4d8b80f1c
MD5 a88bb6eaf8f5dbd0e6ff9447f6895cdb
BLAKE2b-256 ec7e6b0f39deb16d0be541a698bfc3eb29441e4b03553f528c3ab73285ab7a5a

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