Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demo/_showcase/ansys-qoi/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# QoI-Based Surrogate Modeling Workflow
# QoI-based Workflows with Ansys Fluent and Terreract

This showcase demonstrates an end-to-end workflow for building QoI-based surrogate models from Ansys simulation data using Tesseract.
This showcase demonstrates an end-to-end workflow for building QoI-based surrogate models from Ansys simulation data using Tesseract. The overall workflow is illustrated below and demonstrated within our [QoI-based surrogacy showcase](https://si-tesseract.discourse.group/t/qoi-based-workflows-with-ansys-fluent-and-terreract/110).

## Overview

Expand Down
16 changes: 8 additions & 8 deletions demo/_showcase/ansys-shapeopt/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Ansys Tesseract Integration
# Parametric Shape Optimization of Rocket Fins with Ansys SpaceClaim and PyAnsys

This directory contains an example Tesseract configuration and scripts demonstrating how to use Tesseract-JAX with Ansys spaceclaim and PyMAPDL. The overall workflow is illustrated below:
This directory contains an example Tesseract configuration and scripts demonstrating how to use Tesseract-JAX with Ansys SpaceClaim and PyMAPDL. The overall workflow is illustrated below and demonstrated within our [rocket fin optimization showcase](https://si-tesseract.discourse.group/t/parametric-shape-optimization-of-rocket-fins-with-ansys-spaceclaim-and-pyansys/109):

![Workflow](imgs/workflow_1.png)

Expand Down Expand Up @@ -36,13 +36,13 @@ A machine B, ideally running linux, with:
In Windows Powershell, install the the required dependencies by running:

```bash
pip install tesseract-core[runtime] trimesh
$ pip install tesseract-core[runtime] trimesh
```

Clone this repository, navigate to `demo/_showcase/ansys-shapeopt/spaceclaim` and start the Tesseract runtime server with:

```bash
tesseract-runtime serve --port <port_number_1> --host 0.0.0.0
$ tesseract-runtime serve --port <port_number_1> --host 0.0.0.0
```
Note that we do not build a Tesseract Docker image for SpaceClaim in this example. Instead, we use an existing SpaceClaim installation directly from the host machine. More details about this Tesseract can be found [here](https://docs.pasteurlabs.ai/projects/tesseract-core/latest/content/examples/ansys_integration/spaceclaim_tess.html).

Expand All @@ -61,15 +61,15 @@ replace "v242" with your Ansys version and ensure the path is correct. More deta
On machine B, navigate to `demo/_showcase/ansys-shapeopt/` and run

```bash
pip install -r requirements.txt
$ pip install -r requirements.txt
```

and build the needed tesseracts using

```bash
tesseract build spaceclaim
tesseract build pymapdl
tesseract build sdf_fd
$ tesseract build spaceclaim
$ tesseract build pymapdl
$ tesseract build sdf_fd
```

### Run the notebook
Expand Down
8 changes: 7 additions & 1 deletion docs/content/examples/ansys_integration/pymapdl_tess.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ The Tesseract computes structural compliance using finite element analysis and p

```{seealso}
The full code for this Tesseract can be found under `demo/_showcase/ansys-shapeopt/pymapdl` in the [Tesseract Core repository](https://github.com/pasteurlabs/tesseract-core/tree/main/demo/_showcase/ansys-shapeopt/pymapdl).

The Tesseract can be seen in action within our [rocket fin optimization showcase](https://si-tesseract.discourse.group/t/parametric-shape-optimization-of-rocket-fins-with-ansys-spaceclaim-and-pyansys/109).
```

## Prerequisites

This example requires a running ANSYS MAPDL server accessible via gRPC, e.g. via:
This example requires a running Ansys MAPDL server accessible via gRPC, e.g. via:

```bash
# Linux
Expand Down Expand Up @@ -94,6 +96,10 @@ The `abstract_eval` function computes output shapes based on input shapes withou

## Demo script

```{seealso}
The full code for this demo can be found in `demo/_showcase/ansys-shapeopt/pymapdl/demo.py` in the [Tesseract Core repository](https://github.com/pasteurlabs/tesseract-core/blob/main/demo/_showcase/ansys-shapeopt/pymapdl/demo.py).
```

This demo shows a complete workflow for a cantilever beam problem. It requires you set environment variables pointing to the MAPDL server:

```bash
Expand Down
19 changes: 13 additions & 6 deletions docs/content/examples/ansys_integration/spaceclaim_tess.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This guide outlines how to wrap Ansys SpaceClaim as a Tesseract. For this, we wi

```{seealso}
The full code for this Tesseract can be found under `demo/_showcase/ansys-shapeopt/spaceclaim` in the [Tesseract Core repository](https://github.com/pasteurlabs/tesseract-core/tree/main/demo/_showcase/ansys-shapeopt/spaceclaim).

The Tesseract can be seen in action within our [rocket fin optimization showcase](https://si-tesseract.discourse.group/t/parametric-shape-optimization-of-rocket-fins-with-ansys-spaceclaim-and-pyansys/109).
```

## Why SpaceClaim as a Tesseract?
Expand All @@ -12,6 +14,11 @@ Complex CAD models imported from parametric CAD software often require pre-proce

SpaceClaim is commonly used to generate parametric geometries and perform pre-processing actions on them. In this example we demonstrate the use of SpaceClaim as a geometry engine within Tesseract-driven processing pipelines. This unlocks powerful applications operating on real-world CAD geometries.

```{figure} ../../../img/spaceclaim_tesseract_workflow.png

Architecture of the SpaceClaim Tesseract implemented here.
```

## Core concepts

### Folder structure
Expand Down Expand Up @@ -93,8 +100,8 @@ $ pip install -r tesseract_requirements.txt

When using SpaceClaim as a geometry engine, the goal is typically to map design parameters in the parametric CAD model to a surface mesh. Here, we are creating a SpaceClaim Tesseract that operates on a grid fin geometry with a number of parameters representing the position of bars and their thickness.

```{seealso}
The explanation and intuation behind the inputs is explained further in the [demo](https://si-tesseract.discourse.group/c/showcase/11).
```{note}
This particular choice of inputs and outputs is motivated in our [rocket fin optimization showcase](https://si-tesseract.discourse.group/t/parametric-shape-optimization-of-rocket-fins-with-ansys-spaceclaim-and-pyansys/109).
```

#### Input schema
Expand Down Expand Up @@ -131,14 +138,14 @@ The `apply` function that we are invoking with the above command builds each of
:pyobject: apply
```

To build the geometries we first prepare the SpaceClaim `.scscript` by replacing placeholder values with the user inputs via string substituation. SpaceClaim is then run, outputting `.stl` meshes that are read with `trimesh`.
To build the geometries we first prepare the SpaceClaim `.scscript` by replacing placeholder values with the user inputs via string substitution. SpaceClaim is then run, outputting `.stl` meshes that are read with `trimesh`.

```{literalinclude} ../../../../demo/_showcase/ansys-shapeopt/spaceclaim/tesseract_api.py
:language: python
:pyobject: build_geometries
```

The `.scscript` preperation is unique to this grid fin example, with the user input values being processed into dictionaries that are then used within the string substituation. For a different geometry one would have to create their own `.scscript` and dictionaries with all the neccessary inputs required.
The `.scscript` preperation is unique to this grid fin example, with the user input values being processed into dictionaries that are then used within the string substitution. For a different geometry one would have to create their own `.scscript` and dictionaries with all the neccessary inputs required.

```{literalinclude} ../../../../demo/_showcase/ansys-shapeopt/spaceclaim/tesseract_api.py
:language: python
Expand Down Expand Up @@ -204,7 +211,7 @@ curl -Method POST `
-Body '{"inputs":{"differentiable_parameters":[[200,600,0,3.14,0.39,3.53,0.79,3.93,1.18,4.32,1.57,4.71,1.96,5.11,2.36,5.50,2.75,5.89],[400,400,0,3.14,0.39,3.53,0.79,3.93,1.18,4.32,1.57,4.71,1.96,5.11,2.36,5.50,2.75,5.89]],"non_differentiable_parameters":[[800,100],[800,100]],"string_parameters":["F:\\Ansys installations\\ANSYS Inc\\v241\\scdm\\SpaceClaim.exe","geometry_generation.scscript"]}}'
```

After about (~15 seconds) the mesh output is returned and displayed in text form in your terminal. The point coordinates and cells correspond to a grid fin like below (shown with randomised cross beam locations).
After about ~15 seconds the mesh output is returned and displayed in text form in your terminal. The point coordinates and cells correspond to a grid fin like below (shown with randomised cross beam locations).

```{figure} ../../../img/grid_fin_stl.png

Expand All @@ -215,4 +222,4 @@ Grid fin geometry shown with randomised beam locations.

Invoking SpaceClaim via HTTP is only the start of the Tesseract journey.

For example, by using finite difference approximations under the hood, we can make the resulting geometry [differentiable](../../introduction/differentiable-programming.md) with respect to the design parameters. For a concrete demonstration of end-to-end shape optimization in action, please have a look at our [grid fin optimization showcase](https://si-tesseract.discourse.group/c/showcase/11).
For example, by using finite difference approximations under the hood, we can make the resulting geometry [differentiable](../../introduction/differentiable-programming.md) with respect to the design parameters. For a concrete demonstration of end-to-end shape optimization in action, please have a look at our [rocket fin optimization showcase](https://si-tesseract.discourse.group/t/parametric-shape-optimization-of-rocket-fins-with-ansys-spaceclaim-and-pyansys/109).
Binary file added docs/img/spaceclaim_tesseract_workflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading