You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

4.7 KiB

Thermo-elastic/Mechanical Topology Optimization/Simuation

Screenshot from 2023-07-02 13-57-29.png (Optional) temperature limits, optimization of voxel mesh.

This is the implementation of the paper Thermo-elastic topology optimization with stress and temperature constraints. By the way, this procedure realized the thermo-elastic TO(topology optimization)(Thermo-elastic topology optimization with stress and temperature constraints., mechanical TO(top3d.pdf) and corresponding simulations.

Files

  • 3rd/: third-party library
  • assets/: user-defined assets
  • examples/: several teaching examples
    • defined_model_writer: User defined voxel mesh/model as TO/simulation input.
    • clamped_model_writer: Clamped to 0 or 1 of the optimized density.
    • sim_mechanical: Mechanical simulation.
    • sim_thermoelastic: Thermo-elastic simulation.
    • top_mechanical: Mechanical TO.
    • top_thermoelastic: Thermoelastic TO.
  • output/: output directory
  • ref/: reference material
  • src/: source code
  • cmake/: CMake files

Dependencies

Inside libraries:

  • mma: constrained optimization algorithm
  • Eigen: linear algebra
  • libigl: basic geometry functions
  • AMGCL: Linear solver. Optional.

The following dependencies require user installation:

  • json: parsing input JSON scenes
  • spdlog: logging information
  • OpenMP: CPU parallel processing.
sudo apt install libomp-dev
  • SuiteSparse: Linear solver. Optional, NOTE: Use of the Intel MKL BLAS is strongly recommended.
  • CUDA Toolkit: CUDA support. Optional (Suggested).

Select a Linear solver

If your matrix has less than 50w of freedom, then it is recommended to choose a direct solver (e.g. SuiteSparse):

  1. install SuiteSparse.
  2. Set ENABLE_AMGCL to OFF and set ENABLE_SUITESPARSE to ON in CMakeLists.txt.

Otherwise, it is recommended to choose an iterative solver (e.g. AMGCL),in CPU:

  1. install OpenMP and AMGCL.
  2. Set ENABLE_AMGCL to ON, ENABLE_AMGCL_CUDA to OFF and ENABLE_SUITESPARSE to OFF in CMakeLists.txt.

Further, CUDA can be used to speed up the iterative solver:

  1. install OpenMP, CUDA Toolkit and AMGCL.
  2. Set ENABLE_AMGCL to ON, ENABLE_AMGCL_CUDA to ON and ENABLE_SUITESPARSE to OFF in CMakeLists.txt.

Finally, if all options are set to OFF, then the Eigen build-in iterative solver will be chosen.(not recommended).

Build

  1. set path in CMakeLists.txt.
set(CMAKE_CUDA_COMPILER "/path/to/nvcc") # set path to nvcc
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j 16

Usage

3/28 update

  1. Use example/top-thermolastic-compare-3d to run mechanical(Me)/mechanical thermal(MeTh) topology optimization(Top) and simulation(Sim). The procedure run in following order:
    1. Me Top & MeTh Top -> density(*_MeTop_rho.vtk & _MethTop_rho.vtk) and compliance/volume each iteration(_MeTop_compliance.txt *_MeTop_volume.txt & ...)
    2. clamp density by different threshold(.XX) -> 0/1 density(*_MeSim_threshXX_rho.vtk & *_MeThSim_threshXX_rho.vtk)
    3. MeTh Sim -> temperature(_T.vtk), displacement(_U.vtk), Von Mise Stress(*_von_stress.vtk). Note: open .vtk via Paraview software.
  2. Input
    1. Set parameters in *.json. see comments in assets/top-thermoelastic-*.json(see comments in assets/config_biclamed.json and ref paper for MeTh parameters; see comments in assets/top/config_Lshape.json)
    2. Redirect in main.cpp or main.cu if ENABLE_AMGCL_CUDA is ON:
  3. Output see output/txt/${example_name}/${example_name}_* and output/vtk/${example_name}/${example_name}_*.

  1. See example/top-thermoelastic-BiclampedStructure or examples/top-thermoelastic-Lshape-condition.

NOTE:

  1. "//*" in examples/*/config.json file mean comments.
  2. you can modify CONFIG_FILE, OUTPUT_DIR and ASSETS_DIR in examples/*/CMAKEList.txt.
  3. you can modify the linear solver arguments prm.solver.tol and prm.solver.maxiter in src/LinearSolver/Amgcl.h or src/LinearSolver/AmgclCuda.h.
  4. you should modify example content in *.cpp rather than *.cu, the latter is copied from the former by cmake.