Skip to main content

mesh2vec

Project description

Mesh2Vec

Quickstart

mesh2vec

Turn CAE mesh data into aggregated element feature vectors for ML

Latest Documentation

🚀 Introduction

Mesh2vec is a tool that facilitates the import of Computer-Aided Engineering (CAE) mesh data from LS-DYNA. It utilizes various quality metrics of elements and their surrounding neighborhood to aggregate feature vectors for each element. These feature vectors are of equal length and can be effectively utilized as inputs for machine learning methods. This represents a simpler and more efficient alternative to traditional mesh and graph-based approaches for automatic mesh quality analysis.

⏱️ Quickstart

Installation

  1. Create and activate a virtual environment.
  2. Use the following command to install mesh2vec into your environment:
pip install mesh2vec
  1. Please make sure you have an environment variable ANSA_EXECUTABLE set pointing to your ANSA executable to use ANSA depended features like shell and feature import.
  2. You may temporarily need to set an environment variable SKLEARN_ALLOW_DEPRECATED_SKLEARN_PACKAGE_INSTALL=True.

Load Mesh

from pathlib import Path
from mesh2vec.mesh2vec_cae import Mesh2VecCae
m2v = Mesh2VecCae.from_ansa_shell(4,
    Path("data/hat/Hatprofile.k"),
    json_mesh_file=Path("data/hat/cached_hat_key.json"))

Add element features

m2v.add_features_from_ansa(
    ["aspect", "warpage"],
    Path("data/hat/Hatprofile.k"),
    json_mesh_file=Path("data/hat/cached_hat_key.json"))

Aggregate

import numpy as np
m2v.aggregate("aspect", [0,2,3], np.nanmean)

Extract Feature Vectors

m2v.to_dataframe()

data frame with feature vectors

Optional: Visualize a single aggregated feature on mesh

m2v.get_visualization_plotly("aspect-nanmean-2")

3d mesh plot of agggredated

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.

mesh2vec-1.3.1-py3-none-any.whl (24.4 kB view details)

Uploaded Python 3

File details

Details for the file mesh2vec-1.3.1-py3-none-any.whl.

File metadata

  • Download URL: mesh2vec-1.3.1-py3-none-any.whl
  • Upload date:
  • Size: 24.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mesh2vec-1.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 da2ab5134bd333ad0fdda73422b27e7f30334be861cb67038b7db730b4ec96da
MD5 7880702c32ad58d25494907f070e3a68
BLAKE2b-256 80dba48396ec44574741b0216ddfbc72bcdefb5bd757b41c2d6d438f0fd2d00f

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