Narrow-Band Topology Optimization on a Sparsely Populated Grid, ACM Transactions on Graphics (SIGGRAPH Asia 2018).
By Haixiang Liu (University of Wisconsin-Madison),
Eftychios Sifakis (University of Wisconsin-Madison).
- Install
taichi (legacy branch)first and put this in theprojectsfolder. - Build the FEM solver:
cd solver && make(Note: this needs Inteliccandmkl. Please install if you don't have it.) - Set the following environment variables according to your machine. For example,
export TC_MKL_PATH=/opt/intel/compilers_and_libraries_2018.0.128/linux/mkl/lib/intel64_lin/
export CUDA_ARCH=61 # or 0 if there is no CUDA
export TC_USE_DOUBLE=1 #
TC_MKL_PATH is for libmkl_rt.so.
ti buildin shell and wait for the build to finish.- Pick a script under the
scriptsfolder and run withpython3. Some scripts have extremely high resolution (see Table 2 in our paper). If you run out of memory, you may want to use a smallern.
res: resolution say(64, 64, 64)volume_fraction: default=0.1use_youngs: Use Young's modulus and Poisson's ratio for material descriptionE:1e6nu:0.3
penalty: SIMP penalty, default=3minimum_density: minimum_density in topology optimization, default=0minimum_stiffness: default=1e-9grid_update_start: default=5fraction_to_keep: default=1.0, keep only this fraction of SPGrid blocks during optimization. The blocks with highest density sum will be selected.wireframe: default=Falsewireframe_grid_size: default=32wireframe_thickness: default=4fix_cells_near_force: default=Falsefix_cells_at_dirichlet: default=Falseprogressive_vol_frac: default=0(Solver parameters:)cg_tolerance: default1e-4active_threshold: default1e-6cg_max_iterations: default=50defect_correction_iter: default=10verbose_snapshot: default=Falsedefect_correction_cg_iter: default=3boundary_smoothing_iters: default=3smoothing_iters: default=1(interior smoothing iterations)mg_bottom_size: default=64mg_level: default=adaptively choose a value s.t. the coarsest level has resolution <=mg_bottom_sizeexplicit_mg_level: default=1restart_iterations: default=0print_residuals: default=Falsejacobi_damping: default=0.4(not useful when using GS. Do we need a parameter to switch between GS and jacobi?)connectivity_filtering: default=Trueobjective_threshold: default=0.5exclude_fixed_cells: default=Truefixed_cell_density: default=1step_limit: default=0.2exclude_minimal_compliance: default=false
domain_type: a container used to populate the SPGrid.
- box: ...
- cylinder: ...
- sphere:
- inner_radius=0.4
- outer_radius=0.5
- upper_only=False
uniform_bc: Set Dirichlet on all nodes? A string of axis (e.g.'xy'). default =""
add_dirichlet_bc(center, radius=0.03, axis='xyz', value=(0, 0, 0))add_load(center, force)add_plane_load(force, axis_to_search=0/1/2, extreme=+1/-1, bound1=(-0.5, -0.5, -0.5), bound2=(0.5, 0.5, 0.5))add_plane_dirichlet_bc(axis_to_fix, axis_to_search, extreme)
- Solve a single
tcb(e.g.00002.tcb)
ti run fem_solve 00002.tcb
- Convert binary
tcbto human-readable formats (for inspecting boundary conditions, solver parameters e.t.c.)
# Without density field
ti run convert_fem_solve 00002.tcb
# With density field (can be huge)
ti run convert_fem_solve 00002.tcb --with-density
ti vd [mode] [file/folder name]
mode can be fem (default, contains BCs, solver parameters and density field only) or snapshots (basically everything).
vd stands for visualize_density.
This can be called directly at the output folder (say, bridge_v6_r1024), or the fem, or snapshots folder (bridge_v6_r1024/snapshots), or a single tcb file (bridge_v6_r1024/fem/00001.tcb).
Use H and L to switch between frames.
Use J and K to change threshold in voxel rendering.
Transparent volume rendering is also supported, press T (for a while, like 1 second) and R to switch.
From snapshots (generated with verbose_snapshot=True), press C to switch channels between density, sensitivity, smoothed_sensitivity, and displacement.
For symmetric domain, press 1, 2, 3 to mirror x, y, z axes.
Please cite our paper if you use this code for your research:
@article{liu2018narrow,
title={Narrow-Band Topology Optimization on a Sparsely Populated Grid},
author={Liu, Haixiang and Hu, Yuanming and Zhu, Bo and Matusik, Wojciech and Sifakis, Eftychios},
journal={ACM Transactions on Graphics (TOG)},
volume={37},
number={6},
year={2018},
publisher={ACM}
}


