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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

unitcellengine-0.0.12-py3-none-any.whl (5.3 MB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for unitcellengine-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 cd07fe76bba679cc870e353efcffaa8b1942c7bafb0a762cf1d89e7b292baef3
MD5 42d8e8b42639e6abc944bff128d1f17b
BLAKE2b-256 55d6ac138c32edf53cd6f49b8abd88a8609f88533ff76f9b23e362c45f4463a0

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