Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
79fe568
3d shape opt
andrinr Oct 21, 2025
7abc3fd
replace pyvista sdf with pysdf
andrinr Oct 23, 2025
fb08587
pass triangular object as well
andrinr Oct 23, 2025
a6a73ec
adapt fem to 3D
andrinr Oct 23, 2025
84e273e
solver working but very slow
andrinr Oct 23, 2025
8147c8a
seems to be working
andrinr Oct 23, 2025
e91f0f8
seems to be working
andrinr Oct 23, 2025
fcd46e9
reduce tolerance
andrinr Oct 24, 2025
189b232
images
andrinr Oct 24, 2025
9ad6435
sizing field
andrinr Oct 29, 2025
c65d64c
mesh viz
andrinr Oct 29, 2025
f31860a
remove duplicates
andrinr Oct 29, 2025
8cc8d1f
test recursiv subdivision
andrinr Oct 29, 2025
d7a8fc5
reindexing
andrinr Oct 30, 2025
3a17083
fix masking
andrinr Oct 30, 2025
41d23e0
sizing field interpolation
andrinr Oct 30, 2025
b0c0043
fucked something up
andrinr Oct 30, 2025
a907ace
rec subdivision working
andrinr Oct 31, 2025
b70ffce
start meshing tesseract
andrinr Oct 31, 2025
565d158
interpolated gradients
andrinr Oct 31, 2025
c5ec97b
padding support / meshing for solver
andrinr Oct 31, 2025
e451cf1
compliance to zero with adaptive remesher
andrinr Oct 31, 2025
c56b0df
pyvista export to test the mesh
andrinr Oct 31, 2025
aa5adb0
bcs
andrinr Nov 2, 2025
fb3c038
recurisve subdivision masking working
andrinr Nov 2, 2025
26bc21b
compliance still eval to zero
andrinr Nov 2, 2025
c93a1f6
compliance 0, l2 res nan
andrinr Nov 2, 2025
1097ed7
possibly working
andrinr Nov 2, 2025
9fbc926
init ansys
andrinr Nov 5, 2025
d60ea2d
add back old shape opt
andrinr Nov 5, 2025
8de2ec0
rm pymadl
andrinr Nov 5, 2025
50333a2
rm spaceclaim
andrinr Nov 5, 2025
833d349
Merge branch 'ansys' of https://github.com/pasteurlabs/tesseract-jax …
OliverLittlewood Nov 5, 2025
bf4df94
feat: Init pymapdl fem tess from private repo (#101)
NolanBlack Nov 5, 2025
ba7a954
Added Spaceclaim tesserat(runtime) files
OliverLittlewood Nov 5, 2025
d9aa512
Merge branch 'ansys' of https://github.com/pasteurlabs/tesseract-jax …
OliverLittlewood Nov 5, 2025
d5bbb09
readme
andrinr Nov 5, 2025
05153db
Merge branch 'ansys' of https://github.com/pasteurlabs/tesseract-jax …
andrinr Nov 5, 2025
5b806b6
add deps
andrinr Nov 5, 2025
3663d28
add explicit inputs / output validation schemes
andrinr Nov 5, 2025
fa1fd51
todos
andrinr Nov 5, 2025
156cc11
tesseract reference
andrinr Nov 5, 2025
6e7dc9f
add test
andrinr Nov 5, 2025
e3a217b
use hot for geometry
andrinr Nov 5, 2025
72d0a10
fix vjp
andrinr Nov 5, 2025
faa22e5
fix plots etc
andrinr Nov 5, 2025
1fa61dc
fix plots etc
andrinr Nov 5, 2025
759cc6d
fix vjp endpoint
andrinr Nov 5, 2025
93d6a4e
increase mesher speed
andrinr Nov 5, 2025
e7c88a4
debugging jax-fem solver
andrinr Nov 5, 2025
e388269
fix point order for adapteive mesh faces
andrinr Nov 6, 2025
0413344
Modified spaceclaim_tess to replicate bars_3d_tess example
OliverLittlewood Nov 6, 2025
af687fd
formatting
OliverLittlewood Nov 6, 2025
624b97e
Merge branch 'ansys' of https://github.com/pasteurlabs/tesseract-jax …
OliverLittlewood Nov 6, 2025
30ad848
Moved .stl generation to temp dir
OliverLittlewood Nov 6, 2025
10a9a86
optim working
andrinr Nov 6, 2025
2255f80
Merge branch 'ansys' of https://github.com/pasteurlabs/tesseract-jax …
andrinr Nov 6, 2025
c101171
something is off
andrinr Nov 6, 2025
90aa624
found error in bc setup
andrinr Nov 6, 2025
60405cd
working
andrinr Nov 6, 2025
f63a862
change parametrization
andrinr Nov 7, 2025
cf23d2b
change parametrization
andrinr Nov 7, 2025
11b74b9
small spaceclaim tweaks
andrinr Nov 7, 2025
2eea14e
small spaceclaim tweaks
andrinr Nov 7, 2025
e183976
trying to improve mesher
andrinr Nov 7, 2025
20d3f5d
removed loops from hex mesher
andrinr Nov 8, 2025
a1d75f7
grid fin progress
andrinr Nov 8, 2025
3f44cf5
Changed spaceclaim_tess to work in batch mode
OliverLittlewood Nov 10, 2025
33164de
Updated readmme to reflect batch command
OliverLittlewood Nov 10, 2025
373f6cd
adapt input schema
andrinr Nov 11, 2025
30cb7ca
fox nested array
andrinr Nov 11, 2025
e1aa345
missing arg
andrinr Nov 11, 2025
c0644e7
the wheel spins
andrinr Nov 11, 2025
0f4ff79
normalization
andrinr Nov 12, 2025
de2336d
optim with normalization
andrinr Nov 12, 2025
dcbbd4f
storing grads working
andrinr Nov 12, 2025
336f982
graidient clipping, vtk exports
andrinr Nov 17, 2025
e01d226
mesher error
andrinr Nov 17, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,5 @@ dmypy.json
# Ignore UV dev environments
uv.lock
uv.lock.bak

tmp_img/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "examples/fem-shapeopt/jax-fem"]
path = examples/fem-shapeopt/jax-fem
url = https://github.com/andrinr/jax-fem.git
90 changes: 90 additions & 0 deletions examples/ansys/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# ANSYS Tesseract Integration

This directory contains an example Tesseract configuration and scripts demonstrating how to use Tesseract-JAX with ANSYS spaceclaim and PyMAPDL.

![Mesh over optimization](mesh_optim.gif)
![Rho over optimization](rho_optim_x.gif)

## Get Started

### PL internal instructions:

- Our open ports are: 443 and 50052.
- Make sure to be connected to the PL VPN.

### Prerequisites

For the windows machine:
1. ANSYS installed and an active license.
2. Python and a python environment (e.g., conda, venv).
3. Two open ports.

For the linux machine:
1. Docker installed and running.
2. Python and a python environment (e.g., conda, venv).

### SpaceClaim Tesseract

Create a new python env. Assuming you using windows powerhsell, install the required dependencies:

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

Clone this repository, navigate to the `examples/ansys/spaceclaim_tess` directory and start the Tesseract runtime server with:

```bash
tesseract-runtime serve --port <port_number_1> --host 0.0.0.0
```
Note that we dont build a Tesseract image for SpaceClaim in this example. This is because SpaceClaim cannot be installed in a containerized environment. You can test it using git bash and your specific Spaceclaim.exe Path:

```bash
curl -d '{"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], "string_parameters":["F:\\ANSYS Inc\\v242\\scdm\\SpaceClaim.exe", "geometry_generation.scscript"]}}' -H "Content-Type: application/json" http://0.0.0.0:443/apply
```


or the equivalent on powershell:

```powershell
Invoke-RestMethod -Uri "http://127.0.0.1:8000/apply" -Method Post -Body (
@{
inputs = @{
differentiable_bar_parameters = [[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]]
differentiable_plane_parameters = [200, 600]
non_differentiable_parameters = [800, 100]
string_parameters = ["F:\\Ansys installations\\ANSYS Inc\\v241\\scdm\\SpaceClaim.exe", "geometry_generation.scscript"]
}
} | ConvertTo-Json -Depth 10
) -ContentType "application/json"
```

### PyMAPDL Server

On a windows machine, make sure ansys is installed. Then run the following powershell command to start ansys with grpc server enabled:

```powershell
Start-Process -FilePath "F:\ANSYS Inc\v242\ansys\bin\winx64\ANSYS242.exe" -ArgumentList "-grpc", "-port", "<port_number_2>"
```

replace "v242" with your ansys version.

### Build tesseracts

1. Obtain the ip adress of the windows machine by running:

```powershell
(Get-NetIPAddress -AddressFamily IPv4 -InterfaceAlias "Wi-Fi","Ethernet" | Where-Object {$_.IPAddress -notlike "169.254.*" -and $_.IPAddress -ne $null}).IPAddress
```
2. On the linux machine, create a new python env and install tesseract-core with:

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

3. Build all relevant tesseracts:

```bash
tesseract build fem_tess
tesseract build pymapdl_tess
tesseract build meshing_tess
```
9 changes: 9 additions & 0 deletions examples/ansys/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from . import _version

__version__ = _version.get_versions()["version"]

# import public API of the package
# from . import <obj>

# add public API as strings here, for example __all__ = ["obj"]
__all__ = []
Loading
Loading