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.
|
1 year ago | |
---|---|---|
3rd | 1 year ago | |
assets | 2 years ago | |
cmake | 2 years ago | |
docs/imgs | 2 years ago | |
examples | 1 year ago | |
ref | 2 years ago | |
src | 1 year ago | |
.gitignore | 1 year ago | |
CMakeLists.txt | 1 year ago | |
README.md | 1 year ago |
README.md
Thermo-elastic Topology Optimization
(Optional) temperature limits, optimization of voxel mesh.
This is the implementation of the paper Thermo-elastic topology optimization with stress and temperature constraints.
Files
3rd/
: third-party libraryassets/
: user-defined assetsexamples/
: several teaching examplesoutput/
: output directoryref/
: reference materialsrc/
: source codecmake/
: CMake files
Dependencies
A inside library:
The following dependencies require user installation:
sudo apt install libomp-dev
- SuiteSparse: Linear solver. Optional, NOTE: Use of the Intel MKL BLAS is strongly recommended.
- boost: Use filesystem
- AMGCL: Linear solver. Optional.
- CUDA Toolkit: CUDA support. Optional.
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):
- install SuiteSparse.
- Set
ENABLE_AMGCL
toOFF
and setENABLE_SUITESPARSE
toON
in CMakeLists.txt.
Otherwise, it is recommended to choose an iterative solver (e.g. AMGCL),in CPU:
- install OpenMP and AMGCL.
- Set
ENABLE_AMGCL
toON
,ENABLE_AMGCL_CUDA
toOFF
andENABLE_SUITESPARSE
toOFF
in CMakeLists.txt.
Further, CUDA can be used to speed up the iterative solver:
- install OpenMP, CUDA Toolkit and AMGCL.
- Set
ENABLE_AMGCL
toON
,ENABLE_AMGCL_CUDA
toON
andENABLE_SUITESPARSE
toOFF
in CMakeLists.txt.
Finally, if all options are set to OFF
, then the Eigen build-in iterative solver will be chosen.(not recommended).
Build
- 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
- Git switch to multiple_top branch.
- 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:- Me Top & MeTh Top -> density(*_MeTop_rho.vtk & _MethTop_rho.vtk) and compliance/volume each iteration(_MeTop_compliance.txt *_MeTop_volume.txt & ...)
- clamp density by different threshold(.XX) -> 0/1 density(*_MeSim_threshXX_rho.vtk & *_MeThSim_threshXX_rho.vtk)
- MeTh Sim -> temperature(_T.vtk), displacement(_U.vtk), Von Mise Stress(*_von_stress.vtk). Note: open .vtk via Paraview software.
- Input
- Set parameters in *.json. see comments in
example/top-thermoelastic-*.json
(see comments inexamples/top-thermoelastic-BiclampedStructure/config.json
and ref paper for MeTh parameters; see comments inexamples/top-thermoelastic-compare-3d/config_beam.json
) - Redirect in
main.cpp
ormain.cu
if ENABLE_AMGCL_CUDA is ON:
top::fs_path config_file( CMAKE_SOURCE_DIR "/examples/top-thermoelastic-compare-3d/${your_config_file}.json");
- For irregular voxel model(e.g. Lshape), you can define the initial density in
main.cpp
ormain.cu
:
// NOTE: USER DEFINE GRID HERE!!! std::shared_ptr<top::Mesh> sp_mech_mesh; std::shared_ptr<top::HeatMesh> sp_thermal_mesh; if (ex_name=="Lshape") { // L-shape condition spdlog::critical("Using User Defined density!"); top::Tensor3d L_shape_model(len_x, len_y, len_z); L_shape_model.setConstant(1); // set the initial voxel model for (int k = 0; k < len_z; ++k) { for (int j = 0; j < len_y; ++j) { for (int i = 0; i < len_x; ++i) { if (j > len_y* 0.6 & k >len_z * 0.5) { L_shape_model(i, j, k) = 0; } } } } //... }
- Set parameters in *.json. see comments in
- Output see
output/txt/${example_name}/${example_name}_*
andoutput/vtk/${example_name}/${example_name}_*
.
- See
example/top-thermoelastic-BiclampedStructure
orexamples/top-thermoelastic-Lshape-condition
.
NOTE:
"//*"
inexamples/*/config.json
file mean comments.- you can modify
CONFIG_FILE
,OUTPUT_DIR
andASSETS_DIR
inexamples/*/CMAKEList.txt
. - you can modify the linear solver arguments
prm.solver.tol
andprm.solver.maxiter
insrc/LinearSolver/Amgcl.h
orsrc/LinearSolver/AmgclCuda.h
. - you should modify example content in
*.cpp
rather than*.cu
, the latter is copied from the former by cmake.